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