Skip to content

Commit

Permalink
improve ci cache keys (#233)
Browse files Browse the repository at this point in the history
  • Loading branch information
ruslandoga authored Dec 23, 2024
1 parent 9829ec6 commit 4d85823
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/bench.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: erlef/setup-beam@v1
- id: beam
uses: erlef/setup-beam@v1
with:
elixir-version: 1
otp-version: 27
Expand All @@ -37,10 +38,10 @@ jobs:
path: |
deps
_build
key: bench-${{ github.head_ref || github.ref }}-${{ hashFiles('**/mix.lock') }}
key: bench-${{ steps.beam.outputs.elixir-version }}-${{ github.head_ref || github.ref }}-${{ hashFiles('**/mix.lock') }}
restore-keys: |
bench-${{ github.head_ref || github.ref }}-
bench-refs/heads/master-
bench-${{ steps.beam.outputs.elixir-version }}-${{ github.head_ref || github.ref }}-
bench-${{ steps.beam.outputs.elixir-version }}-refs/heads/master-
- run: mix deps.get --only $MIX_ENV
- run: mix compile --warnings-as-errors
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: erlef/setup-beam@v1
- id: beam
uses: erlef/setup-beam@v1
with:
elixir-version: ${{ matrix.elixir }}
otp-version: ${{ matrix.otp }}
Expand All @@ -67,10 +68,10 @@ jobs:
path: |
deps
_build
key: test-${{ matrix.otp }}-${{ matrix.elixir }}-${{ github.head_ref || github.ref }}-${{ hashFiles('**/mix.lock') }}
key: test-${{ steps.beam.outputs.elixir-version }}-${{ github.head_ref || github.ref }}-${{ hashFiles('**/mix.lock') }}
restore-keys: |
test-${{ matrix.otp }}-${{ matrix.elixir }}-${{ github.head_ref || github.ref }}-
test-${{ matrix.otp }}-${{ matrix.elixir }}-refs/heads/master-
test-${{ steps.beam.outputs.elixir-version }}-${{ github.head_ref || github.ref }}-
test-${{ steps.beam.outputs.elixir-version }}-refs/heads/master-
- run: mix deps.get --only $MIX_ENV
- run: mix compile --warnings-as-errors
Expand Down

0 comments on commit 4d85823

Please sign in to comment.