Skip to content

Commit

Permalink
Tweak action caching
Browse files Browse the repository at this point in the history
  • Loading branch information
adriankumpf committed May 22, 2023
1 parent c1e367f commit 3bbb3d2
Showing 1 changed file with 39 additions and 18 deletions.
57 changes: 39 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,26 +21,49 @@ jobs:
- pair:
elixir: "1.14.4"
otp: "26.0"
- pair:
elixir: "1.14.4"
otp: "25.3"
lint: lint
- pair:
elixir: "1.12.3"
otp: "24.3"
steps:
- uses: actions/checkout@v3

- uses: actions/cache@v3.3.1
- uses: erlef/setup-beam@v1
id: beam
with:
path: |
deps
_build
key: ${{ runner.os }}-${{ matrix.elixir }}-${{ matrix.otp }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
otp-version: ${{matrix.pair.otp}}
elixir-version: ${{matrix.pair.elixir}}
version-type: "strict"

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable

- name: Cache deps
id: cache-deps
uses: actions/cache@v3
env:
cache-name: cache-elixir-deps
with:
path: deps
key: ${{ runner.os }}-mix-${{ env.cache-name }}-${{ hashFiles('**/mix.lock') }}
restore-keys: |
${{ runner.os }}-${{ matrix.elixir }}-${{ matrix.otp }}-mix-
${{ runner.os }}-mix-${{ env.cache-name }}-
- uses: actions/cache@v3.3.1
- name: Cache compiled build
id: cache-build
uses: actions/cache@v3
env:
cache-name: cache-compiled-build
with:
path: _build
key: ${{ runner.os }}-mix-${{ env.cache-name }}-${{ matrix.pair.elixir }}-${{ matrix.pair.otp }}-${{ hashFiles('**/mix.lock') }}
restore-keys: |
${{ runner.os }}-mix-${{ env.cache-name }}-${{ matrix.pair.elixir }}-${{ matrix.pair.otp }}-
${{ runner.os }}-mix-${{ env.cache-name }}-
${{ runner.os }}-mix-
- name: Cache NIF build
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
Expand All @@ -50,14 +73,12 @@ jobs:
native/arb/target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

- uses: erlef/setup-beam@v1
with:
otp-version: ${{matrix.pair.otp}}
elixir-version: ${{matrix.pair.elixir}}
version-type: "strict"

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Clean to rule out incremental build as a source of flakiness
if: github.run_attempt != '1'
run: |
mix deps.clean --all
mix clean
shell: sh

- name: Install Dependencies
run: mix deps.get
Expand Down

0 comments on commit 3bbb3d2

Please sign in to comment.