|
24 | 24 | # Cross-platform build, test and lint (i686) |
25 | 25 | # --------------------------------------------------------------------------- |
26 | 26 | build: |
| 27 | + name: build (${{ matrix.target }}) |
27 | 28 | strategy: |
28 | 29 | matrix: |
29 | 30 | include: |
@@ -99,3 +100,52 @@ jobs: |
99 | 100 | name: plugin-${{ matrix.target }} |
100 | 101 | path: ${{ matrix.artifact }} |
101 | 102 | retention-days: 14 |
| 103 | + |
| 104 | + # --------------------------------------------------------------------------- |
| 105 | + # Formatting |
| 106 | + # --------------------------------------------------------------------------- |
| 107 | + # Kept out of the build matrix: rustfmt is target-independent, so running it |
| 108 | + # once is enough and it reports a failure in seconds instead of behind a build. |
| 109 | + rustfmt: |
| 110 | + name: rustfmt |
| 111 | + runs-on: ubuntu-latest |
| 112 | + permissions: |
| 113 | + contents: read |
| 114 | + steps: |
| 115 | + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 |
| 116 | + |
| 117 | + - name: Install Rust (stable + rustfmt) |
| 118 | + uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable |
| 119 | + with: |
| 120 | + components: rustfmt |
| 121 | + |
| 122 | + - name: Check formatting |
| 123 | + run: cargo fmt --all -- --check |
| 124 | + |
| 125 | + # --------------------------------------------------------------------------- |
| 126 | + # Aggregate gate: the single required status check on `master`. |
| 127 | + # --------------------------------------------------------------------------- |
| 128 | + # The `build` matrix produces check names derived from the matrix values, which |
| 129 | + # change whenever a matrix entry is edited — too brittle to require directly. |
| 130 | + # This job's name is stable, so the branch ruleset requires only this one. |
| 131 | + # |
| 132 | + # A docs-only PR never triggers this workflow at all (see `paths-ignore`), so |
| 133 | + # `rust-skip.yml` reports a passing check under the same `ci-status` name to |
| 134 | + # keep such PRs mergeable. Keep the two names in sync. |
| 135 | + ci-status: |
| 136 | + name: ci-status |
| 137 | + if: always() |
| 138 | + needs: [build, rustfmt] |
| 139 | + runs-on: ubuntu-latest |
| 140 | + permissions: |
| 141 | + contents: read |
| 142 | + steps: |
| 143 | + - name: Check job results |
| 144 | + env: |
| 145 | + BUILD_RESULT: ${{ needs.build.result }} |
| 146 | + RUSTFMT_RESULT: ${{ needs.rustfmt.result }} |
| 147 | + run: | |
| 148 | + echo "build: $BUILD_RESULT" |
| 149 | + echo "rustfmt: $RUSTFMT_RESULT" |
| 150 | + [ "$BUILD_RESULT" = "success" ] || exit 1 |
| 151 | + [ "$RUSTFMT_RESULT" = "success" ] || exit 1 |
0 commit comments