@@ -268,29 +268,28 @@ jobs:
268
268
# erroring about invalid credentials instead.
269
269
if : success() && (github.event_name == 'push' || env.DEPLOY == '1' || env.DEPLOY_ALT == '1')
270
270
271
- # These jobs don't actually test anything, but they're used to tell bors the
272
- # build completed, as there is no practical way to detect when a workflow is
273
- # successful listening to webhooks only.
274
- try-success :
275
- needs : [ job ]
276
- if : " success() && github.event_name == 'push' && (github.ref == 'refs/heads/try' || github.ref == 'refs/heads/try-perf') && github.repository == 'rust-lang-ci/rust'"
277
- << : *base-success-job
278
- try-failure :
279
- needs : [ job ]
280
- if : " !success() && github.event_name == 'push' && (github.ref == 'refs/heads/try' || github.ref == 'refs/heads/try-perf') && github.repository == 'rust-lang-ci/rust'"
281
- << : *base-failure-job
282
- auto-success :
271
+ # This job isused to tell bors the final status of the build, as there is no practical way to detect
272
+ # when a workflow is successful listening to webhooks only in our current bors implementation (homu).
273
+ outcome :
274
+ name : bors build finished
275
+ runs-on : ubuntu-latest
283
276
needs : [ job ]
284
- if : " success () && github.event_name == 'push' && github.ref == 'refs/heads/auto' && github.repository == 'rust-lang-ci/rust' "
285
- << : *base-outcome-job
277
+ # !cancelled () executes the job regardless of whether the previous jobs passed or failed
278
+ if : " !cancelled() && github.event_name == 'push' "
286
279
steps :
280
+ # Calculate the exit status of the whole CI workflow (0 if all dependent jobs were either successful
281
+ # or skipped, otherwise 1).
282
+ - name : calculate the correct exit status
283
+ id : status
284
+ run : |
285
+ jq --exit-status 'all(.result == "success" or .result == "skipped")' <<< '${{ toJson(needs) }}'
286
+ echo "status=$?" >> $GITHUB_OUTPUT
287
+ # Publish the toolstate if an auto build succeeds (just before push to master)
287
288
- name : publish toolstate
288
289
run : src/ci/publish_toolstate.sh
289
290
shell : bash
291
+ if : steps.outputs.status == 0 && github.event_name == 'push' && github.ref == 'refs/heads/auto' && github.repository == 'rust-lang-ci/rust'
290
292
env :
291
293
TOOLSTATE_REPO_ACCESS_TOKEN : ${{ secrets.TOOLSTATE_REPO_ACCESS_TOKEN }}
292
-
293
- auto-failure :
294
- needs : [ job ]
295
- if : " !success() && github.event_name == 'push' && github.ref == 'refs/heads/auto' && github.repository == 'rust-lang-ci/rust'"
296
- << : *base-failure-job
294
+ - name : set the correct exit status
295
+ run : exit ${{ steps.outputs.status == 0 }}
0 commit comments