Skip to content

Commit

Permalink
matrify workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
mo271 authored and veluca93 committed Dec 24, 2024
1 parent fcf5d8e commit 1315510
Showing 1 changed file with 26 additions and 9 deletions.
35 changes: 26 additions & 9 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,20 @@ jobs:
run:
./ci/pull_request_checks.sh

rust:
name: Test, Format and Clippy
runs-on: [ubuntu-latest]
checks:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
check: [format, clippy, test]
features: [all, default]
exclude:
# Remove the "format+all" combination, since it is the same as "format+default"
- check: format
features: all
steps:
- uses: actions/checkout@v4
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive

Expand All @@ -38,20 +47,28 @@ jobs:
with:
components: clippy, rustfmt

- name: Build artefact caching
- name: Rust cache
uses: Swatinem/[email protected]

- name: Format
# format
- name: Cargo fmt (check)
if: ${{ matrix.check == 'format' }}
run: cargo fmt --all -- --check

- name: Clippy
# clippy
- name: Clippy with all features
if: ${{ matrix.check == 'clippy' && matrix.features == 'all' }}
run: cargo clippy --release --all-targets --all-features --tests --all -- -D warnings

- name: Clippy with default features
if: ${{ matrix.check == 'clippy' && matrix.features == 'default' }}
run: cargo clippy --release --all-targets --tests --all -- -D warnings

- name: Run tests
# test
- name: Tests with all features
if: ${{ matrix.check == 'test' && matrix.features == 'all' }}
run: cargo test --release --all --no-fail-fast --all-features

- name: Run tests with default features
- name: Tests with default features
if: ${{ matrix.check == 'test' && matrix.features == 'default' }}
run: cargo test --release --all --no-fail-fast

0 comments on commit 1315510

Please sign in to comment.