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

Introduce CI cache #541

Merged
merged 4 commits into from
May 25, 2023
Merged
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
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