|
1 | | -name: Clippy Test (bors) |
| 1 | +name: Clippy Test (merge queue) |
2 | 2 |
|
3 | 3 | on: |
4 | | - push: |
5 | | - branches: |
6 | | - - auto |
7 | | - - try |
| 4 | + merge_group: |
8 | 5 |
|
9 | 6 | env: |
10 | 7 | RUST_BACKTRACE: 1 |
|
13 | 10 | CARGO_INCREMENTAL: 0 |
14 | 11 | RUSTFLAGS: -D warnings |
15 | 12 |
|
16 | | -concurrency: |
17 | | - # For a given workflow, if we push to the same branch, cancel all previous builds on that branch. |
18 | | - group: "${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}" |
19 | | - cancel-in-progress: true |
20 | | - |
21 | 13 | defaults: |
22 | 14 | run: |
23 | 15 | shell: bash |
@@ -218,28 +210,21 @@ jobs: |
218 | 210 | env: |
219 | 211 | INTEGRATION: ${{ matrix.integration }} |
220 | 212 |
|
221 | | - # These jobs doesn't actually test anything, but they're only used to tell |
222 | | - # bors the build completed, as there is no practical way to detect when a |
223 | | - # workflow is successful listening to webhooks only. |
224 | | - # |
225 | | - # ALL THE PREVIOUS JOBS NEED TO BE ADDED TO THE `needs` SECTION OF THIS JOB! |
226 | | - |
227 | | - end-success: |
228 | | - name: bors test finished |
229 | | - if: github.event.pusher.name == 'bors' && success() |
| 213 | + conclusion: |
| 214 | + needs: [ changelog, base, metadata_collection, integration_build, integration ] |
| 215 | + # We need to ensure this job does *not* get skipped if its dependencies fail, |
| 216 | + # because a skipped job is considered a success by GitHub. So we have to |
| 217 | + # overwrite `if:`. We use `!cancelled()` to ensure the job does still not get run |
| 218 | + # when the workflow is canceled manually. |
| 219 | + # |
| 220 | + # ALL THE PREVIOUS JOBS NEED TO BE ADDED TO THE `needs` SECTION OF THIS JOB! |
| 221 | + if: ${{ !cancelled() }} |
230 | 222 | runs-on: ubuntu-latest |
231 | | - needs: [changelog, base, metadata_collection, integration_build, integration] |
232 | | - |
233 | | - steps: |
234 | | - - name: Mark the job as successful |
235 | | - run: exit 0 |
236 | | - |
237 | | - end-failure: |
238 | | - name: bors test finished |
239 | | - if: github.event.pusher.name == 'bors' && (failure() || cancelled()) |
240 | | - runs-on: ubuntu-latest |
241 | | - needs: [changelog, base, metadata_collection, integration_build, integration] |
242 | | - |
243 | 223 | steps: |
244 | | - - name: Mark the job as a failure |
245 | | - run: exit 1 |
| 224 | + # Manually check the status of all dependencies. `if: failure()` does not work. |
| 225 | + - name: Conclusion |
| 226 | + run: | |
| 227 | + # Print the dependent jobs to see them in the CI log |
| 228 | + jq -C <<< '${{ toJson(needs) }}' |
| 229 | + # Check if all jobs that we depend on (in the needs array) were successful. |
| 230 | + jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}' |
0 commit comments