Skip to content

Commit

Permalink
Run explicit build step to fill the cache and use it in clippy/test
Browse files Browse the repository at this point in the history
  • Loading branch information
filmor committed May 25, 2023
1 parent 5174798 commit b6c87e6
Showing 1 changed file with 24 additions and 3 deletions.
27 changes: 24 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,30 @@ jobs:
working-directory: rustler_tests
run: mix format --check-formatted

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

- uses: dtolnay/rust-toolchain@stable
with:
components: clippy

- 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 @@ -52,14 +73,14 @@ jobs:

- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
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 @@ -107,8 +128,8 @@ jobs:

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

- run: cargo test

Expand Down

0 comments on commit b6c87e6

Please sign in to comment.