Skip to content

Commit

Permalink
Merge pull request #541 from rusterlium/ci-cache
Browse files Browse the repository at this point in the history
Introduce CI cache
  • Loading branch information
filmor committed May 25, 2023
2 parents 20d51df + 9c412d9 commit 1b1641b
Showing 1 changed file with 33 additions and 1 deletion.
34 changes: 33 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,31 @@ jobs:
working-directory: rustler_tests
run: mix format --check-formatted

build:
name: Build ${{matrix.os}} ${{matrix.toolchain}}
runs-on: ${{matrix.os}}-latest
strategy:
matrix:
os: [ubuntu, windows, macos]
toolchain: [stable, nightly]
steps:
- uses: actions/checkout@v3

- uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{matrix.toolchain}}

- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
shared-key: rustler

- run: cargo build

clippy:
name: Clippy ${{matrix.os}}
runs-on: ${{matrix.os}}-latest
needs: [build]
strategy:
matrix:
os: [ubuntu, windows, macos]
Expand All @@ -50,11 +72,16 @@ jobs:
with:
components: clippy

- uses: Swatinem/rust-cache@v2
with:
shared-key: rustler
save-if: false

- run: cargo clippy --all-targets --all-features -- -D warnings

test:
name: OTP ${{matrix.pair.erlang}} / Elixir ${{matrix.pair.elixir}} / Rust ${{matrix.rust}} / OS ${{matrix.os}}
needs: [format, clippy]
needs: [build]
strategy:
matrix:
pair:
Expand Down Expand Up @@ -100,6 +127,11 @@ jobs:
with:
toolchain: ${{matrix.rust}}

- uses: Swatinem/rust-cache@v2
with:
shared-key: rustler
save-if: false

- run: cargo test

- name: Test rustler_mix
Expand Down

0 comments on commit 1b1641b

Please sign in to comment.