|
1 | | -name: Checks |
| 1 | +name: Rust CI |
2 | 2 |
|
3 | 3 | env: |
4 | 4 | CACHE_VERSION: 0 |
|
10 | 10 |
|
11 | 11 | on: |
12 | 12 | push: |
13 | | - branches: |
14 | | - - main |
| 13 | + branches: [main] |
15 | 14 | pull_request: |
16 | | - branches: |
17 | | - - main |
| 15 | + branches: [main] |
18 | 16 | merge_group: |
19 | 17 |
|
20 | 18 | jobs: |
21 | 19 | cargo-checks: |
22 | 20 | name: Task cargo ${{ matrix.action }} |
23 | 21 | runs-on: ubuntu-latest |
| 22 | + |
24 | 23 | strategy: |
25 | 24 | matrix: |
26 | 25 | action: [clippy, fmt, nextest] |
| 26 | + |
27 | 27 | steps: |
28 | 28 | - name: Fetch latest code |
29 | 29 | uses: actions/checkout@v4 |
| 30 | + |
30 | 31 | - name: Setup build environment |
31 | 32 | if: matrix.action != 'fmt' |
32 | 33 | run: rustup show |
33 | | - - uses: Swatinem/rust-cache@v2 |
| 34 | + |
| 35 | + - name: Cache cargo target |
34 | 36 | if: matrix.action != 'fmt' |
| 37 | + uses: Swatinem/rust-cache@v2 |
35 | 38 | with: |
36 | 39 | prefix-key: ${{ env.CACHE_VERSION }} |
37 | 40 | key: ${{ matrix.action }} |
| 41 | + |
38 | 42 | - name: Cargo clippy |
39 | 43 | if: matrix.action == 'clippy' |
40 | 44 | uses: giraffate/clippy-action@v1 |
41 | 45 | with: |
42 | 46 | clippy_flags: --workspace --all-features --all-targets --locked |
| 47 | + |
43 | 48 | - name: Cargo fmt |
44 | 49 | if: matrix.action == 'fmt' |
45 | 50 | run: | |
46 | 51 | rustup toolchain install nightly |
47 | 52 | rustup component add rustfmt --toolchain nightly |
48 | 53 | cargo +nightly fmt --all -- --check |
| 54 | +
|
49 | 55 | - name: Install cargo-nextest |
50 | 56 | if: matrix.action == 'nextest' |
51 | 57 | uses: taiki-e/install-action@nextest |
| 58 | + |
52 | 59 | - name: Cargo nextest |
53 | 60 | if: matrix.action == 'nextest' |
54 | | - run: cargo nextest run --cargo-profile ci-dev --workspace --all-features --all-targets --locked |
| 61 | + run: | |
| 62 | + cargo nextest run --no-tests=pass --cargo-profile ci-dev --workspace --all-features --all-targets --locked |
| 63 | +
|
55 | 64 | - name: Fast fail |
56 | | - uses: vishnudxb/cancel-workflow@v1.2 |
57 | 65 | if: failure() |
| 66 | + uses: vishnudxb/cancel-workflow@v1.2 |
58 | 67 | with: |
59 | 68 | repo: hack-ink/<NAME> |
60 | 69 | workflow_id: ${{ github.run_id }} |
|
0 commit comments