Skip to content

Commit abb98ca

Browse files
committed
Auto merge of #76018 - pietroalbini:ci-left-fallible-finish-2, r=Mark-Simulacrum
Run cancel-outdated-builds after fully setting up the env This PR fixes #75995 not working as expected. Due to GitHub Actions limitations the environment variables set in the build matrix definition are not added by the GHA runner, but by the `setup-environment.sh` script. Before this PR the `cancel-outdated-builds` action was started before that script, so it was never able to detect the "suppression" variable added in #75995. This PR reorders the jobs to make sure `setup-environment.sh` runs before the action. r? @Mark-Simulacrum
2 parents 3e3c552 + 19d072f commit abb98ca

File tree

2 files changed

+29
-29
lines changed

2 files changed

+29
-29
lines changed

.github/workflows/ci.yml

+20-20
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,6 @@ jobs:
5959
uses: actions/checkout@v1
6060
with:
6161
fetch-depth: 2
62-
- name: configure GitHub Actions to kill the build when outdated
63-
uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@master
64-
with:
65-
github_token: "${{ secrets.github_token }}"
66-
if: "success() && !env.SKIP_JOB && github.ref != 'refs/heads/try' && !env.RUST_CI_TEMP_SKIP_CANCEL_OUTDATED"
6762
- name: configure the PR in which the error message will be posted
6863
run: "echo \"[CI_PR_NUMBER=$num]\""
6964
env:
@@ -77,6 +72,11 @@ jobs:
7772
- name: decide whether to skip this job
7873
run: src/ci/scripts/should-skip-this.sh
7974
if: success() && !env.SKIP_JOB
75+
- name: configure GitHub Actions to kill the build when outdated
76+
uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@master
77+
with:
78+
github_token: "${{ secrets.github_token }}"
79+
if: "success() && !env.SKIP_JOB && github.ref != 'refs/heads/try' && !env.RUST_CI_TEMP_SKIP_CANCEL_OUTDATED"
8080
- name: collect CPU statistics
8181
run: src/ci/scripts/collect-cpu-stats.sh
8282
if: success() && !env.SKIP_JOB
@@ -163,11 +163,6 @@ jobs:
163163
uses: actions/checkout@v1
164164
with:
165165
fetch-depth: 2
166-
- name: configure GitHub Actions to kill the build when outdated
167-
uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@master
168-
with:
169-
github_token: "${{ secrets.github_token }}"
170-
if: "success() && !env.SKIP_JOB && github.ref != 'refs/heads/try' && !env.RUST_CI_TEMP_SKIP_CANCEL_OUTDATED"
171166
- name: configure the PR in which the error message will be posted
172167
run: "echo \"[CI_PR_NUMBER=$num]\""
173168
env:
@@ -181,6 +176,11 @@ jobs:
181176
- name: decide whether to skip this job
182177
run: src/ci/scripts/should-skip-this.sh
183178
if: success() && !env.SKIP_JOB
179+
- name: configure GitHub Actions to kill the build when outdated
180+
uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@master
181+
with:
182+
github_token: "${{ secrets.github_token }}"
183+
if: "success() && !env.SKIP_JOB && github.ref != 'refs/heads/try' && !env.RUST_CI_TEMP_SKIP_CANCEL_OUTDATED"
184184
- name: collect CPU statistics
185185
run: src/ci/scripts/collect-cpu-stats.sh
186186
if: success() && !env.SKIP_JOB
@@ -482,11 +482,6 @@ jobs:
482482
uses: actions/checkout@v1
483483
with:
484484
fetch-depth: 2
485-
- name: configure GitHub Actions to kill the build when outdated
486-
uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@master
487-
with:
488-
github_token: "${{ secrets.github_token }}"
489-
if: "success() && !env.SKIP_JOB && github.ref != 'refs/heads/try' && !env.RUST_CI_TEMP_SKIP_CANCEL_OUTDATED"
490485
- name: configure the PR in which the error message will be posted
491486
run: "echo \"[CI_PR_NUMBER=$num]\""
492487
env:
@@ -500,6 +495,11 @@ jobs:
500495
- name: decide whether to skip this job
501496
run: src/ci/scripts/should-skip-this.sh
502497
if: success() && !env.SKIP_JOB
498+
- name: configure GitHub Actions to kill the build when outdated
499+
uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@master
500+
with:
501+
github_token: "${{ secrets.github_token }}"
502+
if: "success() && !env.SKIP_JOB && github.ref != 'refs/heads/try' && !env.RUST_CI_TEMP_SKIP_CANCEL_OUTDATED"
503503
- name: collect CPU statistics
504504
run: src/ci/scripts/collect-cpu-stats.sh
505505
if: success() && !env.SKIP_JOB
@@ -621,11 +621,6 @@ jobs:
621621
uses: actions/checkout@v1
622622
with:
623623
fetch-depth: 2
624-
- name: configure GitHub Actions to kill the build when outdated
625-
uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@master
626-
with:
627-
github_token: "${{ secrets.github_token }}"
628-
if: "success() && !env.SKIP_JOB && github.ref != 'refs/heads/try' && !env.RUST_CI_TEMP_SKIP_CANCEL_OUTDATED"
629624
- name: configure the PR in which the error message will be posted
630625
run: "echo \"[CI_PR_NUMBER=$num]\""
631626
env:
@@ -639,6 +634,11 @@ jobs:
639634
- name: decide whether to skip this job
640635
run: src/ci/scripts/should-skip-this.sh
641636
if: success() && !env.SKIP_JOB
637+
- name: configure GitHub Actions to kill the build when outdated
638+
uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@master
639+
with:
640+
github_token: "${{ secrets.github_token }}"
641+
if: "success() && !env.SKIP_JOB && github.ref != 'refs/heads/try' && !env.RUST_CI_TEMP_SKIP_CANCEL_OUTDATED"
642642
- name: collect CPU statistics
643643
run: src/ci/scripts/collect-cpu-stats.sh
644644
if: success() && !env.SKIP_JOB

src/ci/github-actions/ci.yml

+9-9
Original file line numberDiff line numberDiff line change
@@ -103,15 +103,6 @@ x--expand-yaml-anchors--remove:
103103
with:
104104
fetch-depth: 2
105105

106-
- name: configure GitHub Actions to kill the build when outdated
107-
uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@master
108-
with:
109-
github_token: "${{ secrets.github_token }}"
110-
# TODO: remove the condition on RUST_CI_TEMP_SKIP_CANCEL_OUTDATED once
111-
# we remove the `auto-fallible` job.
112-
if: success() && !env.SKIP_JOB && github.ref != 'refs/heads/try' && !env.RUST_CI_TEMP_SKIP_CANCEL_OUTDATED
113-
<<: *step
114-
115106
# Rust Log Analyzer can't currently detect the PR number of a GitHub
116107
# Actions build on its own, so a hint in the log message is needed to
117108
# point it in the right direction.
@@ -135,6 +126,15 @@ x--expand-yaml-anchors--remove:
135126
run: src/ci/scripts/should-skip-this.sh
136127
<<: *step
137128

129+
- name: configure GitHub Actions to kill the build when outdated
130+
uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@master
131+
with:
132+
github_token: "${{ secrets.github_token }}"
133+
# TODO: remove the condition on RUST_CI_TEMP_SKIP_CANCEL_OUTDATED once
134+
# we remove the `auto-fallible` job.
135+
if: success() && !env.SKIP_JOB && github.ref != 'refs/heads/try' && !env.RUST_CI_TEMP_SKIP_CANCEL_OUTDATED
136+
<<: *step
137+
138138
- name: collect CPU statistics
139139
run: src/ci/scripts/collect-cpu-stats.sh
140140
<<: *step

0 commit comments

Comments
 (0)