|
1 | 1 | name: CI
|
2 | 2 |
|
3 | 3 | on:
|
4 |
| - push: |
5 |
| - # Run in PRs and for bors, but not on master. |
6 |
| - branches: |
7 |
| - - 'auto' |
8 |
| - - 'try' |
| 4 | + merge_group: |
9 | 5 | pull_request:
|
10 | 6 | branches:
|
11 | 7 | - 'master'
|
@@ -68,27 +64,24 @@ jobs:
|
68 | 64 | - name: rustdoc
|
69 | 65 | run: RUSTDOCFLAGS="-Dwarnings" ./miri doc --document-private-items
|
70 | 66 |
|
71 |
| - # These jobs doesn't actually test anything, but they're only used to tell |
72 |
| - # bors the build completed, as there is no practical way to detect when a |
73 |
| - # workflow is successful listening to webhooks only. |
74 |
| - # |
75 |
| - # ALL THE PREVIOUS JOBS NEED TO BE ADDED TO THE `needs` SECTION OF THIS JOB! |
76 |
| - end-success: |
77 |
| - name: bors build finished |
78 |
| - runs-on: ubuntu-latest |
| 67 | + conclusion: |
79 | 68 | needs: [build, style]
|
80 |
| - if: github.event.pusher.name == 'bors' && success() |
81 |
| - steps: |
82 |
| - - name: mark the job as a success |
83 |
| - run: exit 0 |
84 |
| - end-failure: |
85 |
| - name: bors build finished |
| 69 | + # We need to ensure this job does *not* get skipped if its dependencies fail, |
| 70 | + # because a skipped job is considered a success by GitHub. So we have to |
| 71 | + # overwrite `if:`. We use `!cancelled()` to ensure the job does still not get run |
| 72 | + # when the workflow is canceled manually. |
| 73 | + # |
| 74 | + # ALL THE PREVIOUS JOBS NEED TO BE ADDED TO THE `needs` SECTION OF THIS JOB! |
| 75 | + if: ${{ !cancelled() }} |
86 | 76 | runs-on: ubuntu-latest
|
87 |
| - needs: [build, style] |
88 |
| - if: github.event.pusher.name == 'bors' && (failure() || cancelled()) |
89 | 77 | steps:
|
90 |
| - - name: mark the job as a failure |
91 |
| - run: exit 1 |
| 78 | + # Manually check the status of all dependencies. `if: failure()` does not work. |
| 79 | + - name: Conclusion |
| 80 | + run: | |
| 81 | + # Print the dependent jobs to see them in the CI log |
| 82 | + jq -C <<< '${{ toJson(needs) }}' |
| 83 | + # Check if all jobs that we depend on (in the needs array) were successful. |
| 84 | + jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}' |
92 | 85 |
|
93 | 86 | cron-fail-notify:
|
94 | 87 | name: cronjob failure notification
|
|
0 commit comments