Skip to content

Commit

Permalink
Act on env vars issue
Browse files Browse the repository at this point in the history
  • Loading branch information
williamthome committed Aug 9, 2024
1 parent 735be2b commit 30a5d05
Showing 1 changed file with 5 additions and 16 deletions.
21 changes: 5 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ name: CI
workflow_dispatch: {}
merge_group:

# Sets the ENV `MIX_ENV` to `test` for running tests
env:
MIX_ENV: test

permissions:
contents: read

Expand Down Expand Up @@ -47,7 +43,7 @@ jobs:
elixir-version: "1.17"

env:
polyfil: fromJSON(matrix.otp-version) < 27
MIX_ENV: ${{ fromJSON(matrix.otp-version) < 27 && 'polyfill' || 'test' }}

steps:
# Step: Setup Elixir + Erlang image as the base.
Expand All @@ -71,9 +67,9 @@ jobs:
with:
path: deps
key: |
${{runner.os}}-polyfill-${{env.polyfil}}-mix-${{env.cache-name}}-${{hashFiles('**/mix.lock')}}
${{runner.os}}-end-${{env.MIX_ENV}}-mix-${{env.cache-name}}-${{hashFiles('**/mix.lock')}}
restore-keys: |
${{runner.os}}-polyfill-${{env.polyfil}}-mix-${{env.cache-name}}-
${{runner.os}}-end-${{env.MIX_ENV}}-mix-${{env.cache-name}}-
# Step: Define how to cache the `_build` directory. After the first run,
# this speeds up tests runs a lot. This includes not re-compiling our
Expand All @@ -86,19 +82,12 @@ jobs:
with:
path: _build
key: |
${{runner.os}}-polyfill-${{env.polyfil}}-mix-${{env.cache-name}}-${{hashFiles('**/mix.lock')}}
${{runner.os}}-env-${{env.MIX_ENV}}-mix-${{env.cache-name}}-${{hashFiles('**/mix.lock')}}
restore-keys: |
${{runner.os}}-polyfill-${{env.polyfil}}-mix-${{env.cache-name}}-
${{runner.os}}-end-${{env.MIX_ENV}}-mix-${{env.cache-name}}-
# Step: Download project dependencies. If unchanged, uses the cached version.
- name: Install dependencies (Polyfill)
if: ${{env.polyfil}}
run: mix deps.get
env:
MIX_ENV: polyfill

- name: Install dependencies
if: ${{!env.polyfil}}
run: mix deps.get

# Step: Compile the project treating any warnings as errors.
Expand Down

0 comments on commit 30a5d05

Please sign in to comment.