|
9 | 9 |
|
10 | 10 | jobs: |
11 | 11 | test: |
12 | | - name: Run Rust Tests (OS = ${{ matrix.os }}) |
| 12 | + name: Test (OS=${{ matrix.os }}, Features=${{ matrix.name }}) |
13 | 13 | runs-on: ${{ matrix.os }} |
14 | 14 | strategy: |
| 15 | + fail-fast: false |
15 | 16 | matrix: |
16 | 17 | os: [ubuntu-latest, macos-latest, windows-latest] |
| 18 | + include: |
| 19 | + - name: "Default" |
| 20 | + flags: "" |
| 21 | + - name: "No Default Features" |
| 22 | + flags: "--no-default-features" |
| 23 | + - name: "Parallel" |
| 24 | + flags: "--features parallel" |
| 25 | + - name: "Expose Internal API" |
| 26 | + flags: "--features expose-internal-api" |
| 27 | + - name: "Parallel + Expose API" |
| 28 | + flags: "--features=parallel,expose-internal-api" |
| 29 | + - name: "All Features" |
| 30 | + flags: "--all-features" |
17 | 31 |
|
18 | 32 | steps: |
19 | 33 | - name: Checkout repository |
|
22 | 36 | - name: Install Rust |
23 | 37 | uses: dtolnay/rust-toolchain@stable |
24 | 38 |
|
25 | | - - name: Build workspace |
26 | | - run: cargo build --workspace |
| 39 | + # Added caching step to speed up dependency builds. |
| 40 | + - name: Cache Cargo dependencies |
| 41 | + uses: actions/cache@v4 |
| 42 | + with: |
| 43 | + path: | |
| 44 | + ~/.cargo/bin/ |
| 45 | + ~/.cargo/registry/index/ |
| 46 | + ~/.cargo/registry/cache/ |
| 47 | + ~/.cargo/git/db/ |
| 48 | + target/ |
| 49 | + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-${{ matrix.flags }} |
| 50 | + restore-keys: | |
| 51 | + ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}- |
27 | 52 |
|
28 | | - - name: Run tests |
29 | | - run: cargo test --workspace --all-targets --verbose |
| 53 | + - name: Build |
| 54 | + run: cargo build --workspace --all-targets ${{ matrix.flags }} |
| 55 | + |
| 56 | + - name: Test |
| 57 | + run: cargo test --workspace --all-targets --verbose ${{ matrix.flags }} |
| 58 | + |
| 59 | + # Added step to ensure benchmarks compile. `--no-run` is important. |
| 60 | + - name: Check benchmarks compile |
| 61 | + run: cargo bench --workspace --no-run ${{ matrix.flags }} |
0 commit comments