@@ -11,11 +11,9 @@ name: CI
1111on :
1212 push :
1313 branches :
14- - auto
15- - try
16- - try-perf
17- - automation/bors/try
1814 - automation/bors/auto
15+ - automation/bors/try
16+ - try-perf
1917 pull_request :
2018 branches :
2119 - " **"
@@ -33,9 +31,10 @@ defaults:
3331
3432concurrency :
3533 # For a given workflow, if we push to the same branch, cancel all previous builds on that branch.
36- # We add an exception for try builds (try branch) and unrolled rollup builds (try-perf), which
37- # are all triggered on the same branch, but which should be able to run concurrently.
38- group : ${{ github.workflow }}-${{ ((github.ref == 'refs/heads/try' || github.ref == 'refs/heads/try-perf' || github.ref == 'refs/heads/automation/bors/try') && github.sha) || github.ref }}
34+ # We add an exception for try builds (automation/bors/try branch) and unrolled rollup builds
35+ # (try-perf), which are all triggered on the same branch, but which should be able to run
36+ # concurrently.
37+ group : ${{ github.workflow }}-${{ ((github.ref == 'refs/heads/try-perf' || github.ref == 'refs/heads/automation/bors/try') && github.sha) || github.ref }}
3938 cancel-in-progress : true
4039env :
4140 TOOLSTATE_REPO : " https://github.com/rust-lang-nursery/rust-toolstate"
5756 - name : Test citool
5857 # Only test citool on the auto branch, to reduce latency of the calculate matrix job
5958 # on PR/try builds.
60- if : ${{ github.ref == 'refs/heads/auto' || github.ref == 'refs/heads/ automation/bors/auto' }}
59+ if : ${{ github.ref == 'refs/heads/automation/bors/auto' }}
6160 run : |
6261 cd src/ci/citool
6362 CARGO_INCREMENTAL=0 cargo test
8079 # access the environment.
8180 #
8281 # We only enable the environment for the rust-lang/rust repository, so that CI works on forks.
83- environment : ${{ ((github.repository == 'rust-lang/rust' && (github.ref == 'refs/heads/try' || github.ref == 'refs/heads/try -perf' || github.ref == 'refs/heads/automation/bors/try' || github.ref == 'refs/heads/auto ' || github.ref == 'refs/heads/automation/bors/auto')) && 'bors') || '' }}
82+ environment : ${{ ((github.repository == 'rust-lang/rust' && (github.ref == 'refs/heads/try-perf' || github.ref == 'refs/heads/automation/bors/try' || github.ref == 'refs/heads/automation/bors/auto')) && 'bors') || '' }}
8483 env :
8584 CI_JOB_NAME : ${{ matrix.name }}
8685 CI_JOB_DOC_URL : ${{ matrix.doc_url }}
@@ -289,7 +288,7 @@ jobs:
289288 fi
290289
291290 # Get closest bors merge commit
292- PARENT_COMMIT=`git rev-list --author='bors <bors @rust-lang.org> ' -n1 --first-parent HEAD^1`
291+ PARENT_COMMIT=`git rev-list --author='bors@rust-lang.org' --author='122020455+rust-bors\[bot\]@users.noreply.github.com ' -n1 --first-parent HEAD^1`
293292
294293 ./build/citool/debug/citool postprocess-metrics \
295294 --job-name ${CI_JOB_NAME} \
@@ -306,30 +305,22 @@ jobs:
306305 DD_GITHUB_JOB_NAME : ${{ matrix.full_name }}
307306 run : ./build/citool/debug/citool upload-build-metrics build/cpu-usage.csv
308307
309- # This job isused to tell bors the final status of the build, as there is no practical way to detect
310- # when a workflow is successful listening to webhooks only in our current bors implementation (homu).
308+ # This job is used to publish toolstate for successful auto builds.
311309 outcome :
312- name : bors build finished
310+ name : publish toolstate
313311 runs-on : ubuntu-24.04
314312 needs : [ calculate_matrix, job ]
315- # !cancelled() executes the job regardless of whether the previous jobs passed or failed
316- if : ${{ !cancelled() && contains(fromJSON('["auto", "try"]'), needs.calculate_matrix.outputs.run_type) }}
317- environment : ${{ ((github.repository == 'rust-lang/rust' && (github.ref == 'refs/heads/try' || github.ref == 'refs/heads/try-perf' || github.ref == 'refs/heads/automation/bors/try' || github.ref == 'refs/heads/auto' || github.ref == 'refs/heads/automation/bors/auto')) && 'bors') || '' }}
313+ if : ${{ needs.calculate_matrix.outputs.run_type == 'auto' }}
314+ environment : ${{ (github.repository == 'rust-lang/rust' && 'bors') || '' }}
318315 steps :
319316 - name : checkout the source code
320317 uses : actions/checkout@v5
321318 with :
322319 fetch-depth : 2
323- # Calculate the exit status of the whole CI workflow.
324- # If all dependent jobs were successful, this exits with 0 (and the outcome job continues successfully).
325- # If a some dependent job has failed, this exits with 1.
326- - name : calculate the correct exit status
327- run : jq --exit-status 'all(.result == "success" or .result == "skipped")' <<< '${{ toJson(needs) }}'
328320 # Publish the toolstate if an auto build succeeds (just before push to the default branch)
329321 - name : publish toolstate
330322 run : src/ci/publish_toolstate.sh
331323 shell : bash
332- if : needs.calculate_matrix.outputs.run_type == 'auto'
333324 env :
334325 TOOLSTATE_ISSUES_API_URL : https://api.github.com/repos/rust-lang/rust/issues
335326 TOOLSTATE_PUBLISH : 1
0 commit comments