Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve ci cache keys #233

Merged
merged 1 commit into from
Dec 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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') }}
Copy link
Contributor Author

@ruslandoga ruslandoga Dec 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

elixir-version contains both Elixir and OTP version information.

See https://github.com/plausible/ch/actions/caches

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
Loading