Skip to content

Commit

Permalink
Refactor test and clippy workflows for feature matrix
Browse files Browse the repository at this point in the history
The GitHub Actions workflows for testing and linting have been refactored to use a matrix strategy. This allows us to run tests and lints against multiple feature flags in parallel, improving the efficiency of our CI/CD pipeline. The changes include removing individual steps for each feature flag and replacing them with a single step that uses the matrix feature.
  • Loading branch information
rrrodzilla committed May 29, 2024
1 parent c46c8d2 commit 7e235c4
Showing 1 changed file with 27 additions and 30 deletions.
57 changes: 27 additions & 30 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,17 @@ jobs:
test:
name: Test Suite
runs-on: ubuntu-latest
strategy:
matrix:
feature:
- v1_local
- v1_public
- v2_local
- v2_public
- v3_local
- v3_public
- v4_local
- v4_public
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
Expand All @@ -30,38 +41,22 @@ jobs:
- uses: actions-rs/cargo@v1
with:
command: test
args: --features v1_local
- uses: actions-rs/cargo@v1
with:
command: test
args: --features v1_public
- uses: actions-rs/cargo@v1
with:
command: test
args: --features v2_local
- uses: actions-rs/cargo@v1
with:
command: test
args: --features v2_public
- uses: actions-rs/cargo@v1
with:
command: test
args: --features v3_local
- uses: actions-rs/cargo@v1
with:
command: test
args: --features v3_public
- uses: actions-rs/cargo@v1
with:
command: test
args: --features v4_local
- uses: actions-rs/cargo@v1
with:
command: test
args: --features v4_public
args: --no-default-features --features ${{ matrix.feature }}

clippy:
name: Clippy
runs-on: ubuntu-latest
strategy:
matrix:
feature:
- v1_local
- v1_public
- v2_local
- v2_public
- v3_local
- v3_public
- v4_local
- v4_public
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
Expand All @@ -73,7 +68,8 @@ jobs:
- uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -D warnings
args: --no-default-features --features ${{ matrix.feature }} -- -D warnings

audit:
name: Security Audit
runs-on: ubuntu-latest
Expand All @@ -88,3 +84,4 @@ jobs:
- uses: actions-rs/audit-check@v1.2.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
- run: cargo audit

0 comments on commit 7e235c4

Please sign in to comment.