Skip to content

Commit bffd960

Browse files
authored
Merge branch 'master' into check-cfg-enable-without
2 parents 4d81b62 + 96c4cc7 commit bffd960

File tree

1 file changed

+15
-22
lines changed

1 file changed

+15
-22
lines changed

.github/workflows/main.yml

+15-22
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
11
name: CI
22
on:
3-
push:
4-
branches:
5-
- auto
6-
- try
73
pull_request:
8-
branches:
9-
- master
4+
merge_group:
105

116
jobs:
127
style:
@@ -29,14 +24,6 @@ jobs:
2924
- run: ci/dox.sh
3025
env:
3126
CI: 1
32-
- name: Publish documentation
33-
run: |
34-
cd target/doc
35-
git init
36-
git add .
37-
git -c user.name='ci' -c user.email='ci' commit -m init
38-
git push -f -q https://git:${{ secrets.github_token }}@github.com/${{ github.repository }} HEAD:gh-pages
39-
if: github.event_name == 'push' && github.event.ref == 'refs/heads/master'
4027

4128
verify:
4229
name: Automatic intrinsic verification
@@ -246,19 +233,25 @@ jobs:
246233
run: rustup update nightly && rustup default nightly
247234
- run: ./ci/build-std-detect.sh
248235

249-
success:
236+
conclusion:
250237
needs:
251238
- docs
252239
- verify
253240
- env_override
254241
- test
255242
- build-std-detect
256243
runs-on: ubuntu-latest
257-
# GitHub branch protection is exceedingly silly and treats "jobs skipped because a dependency
258-
# failed" as success. So we have to do some contortions to ensure the job fails if any of its
259-
# dependencies fails.
260-
if: always() # make sure this is never "skipped"
244+
# We need to ensure this job does *not* get skipped if its dependencies fail,
245+
# because a skipped job is considered a success by GitHub. So we have to
246+
# overwrite `if:`. We use `!cancelled()` to ensure the job does still not get run
247+
# when the workflow is canceled manually.
248+
#
249+
# ALL THE PREVIOUS JOBS NEED TO BE ADDED TO THE `needs` SECTION OF THIS JOB!
250+
if: ${{ !cancelled() }} # make sure this is never "skipped"
261251
steps:
262-
# Manually check the status of all dependencies. `if: failure()` does not work.
263-
- name: check if any dependency failed
264-
run: jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'
252+
- name: Conclusion
253+
run: |
254+
# Print the dependent jobs to see them in the CI log
255+
jq -C <<< '${{ toJson(needs) }}'
256+
# Check if all jobs that we depend on (in the needs array) were successful.
257+
jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'

0 commit comments

Comments
 (0)