Skip to content

Commit 14649f1

Browse files
authored
Merge pull request #459 from ehuss/merge-queue
CI: Switch to merge queue
2 parents 6ecf95c + 3aa27d4 commit 14649f1

File tree

1 file changed

+24
-5
lines changed

1 file changed

+24
-5
lines changed

.github/workflows/main.yml

+24-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
name: CI
2-
on: [push, pull_request]
2+
on:
3+
pull_request:
4+
merge_group:
5+
6+
env:
7+
MDBOOK_VERSION: 0.4.40
38

49
jobs:
510
test:
611
name: Test
712
runs-on: ubuntu-latest
813
steps:
9-
- uses: actions/checkout@v3
14+
- uses: actions/checkout@v4
1015
- name: Update rustup
1116
run: rustup self update
1217
- name: Install Rust
@@ -15,11 +20,9 @@ jobs:
1520
rustup toolchain install nightly -c rust-docs
1621
rustup default nightly
1722
- name: Install mdbook
18-
env:
19-
MDBOOK_VER: v0.4.3
2023
run: |
2124
mkdir bin
22-
curl -sSL https://github.com/rust-lang/mdBook/releases/download/${{ env.MDBOOK_VER }}/mdbook-${{ env.MDBOOK_VER }}-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=bin
25+
curl -sSL https://github.com/rust-lang/mdBook/releases/download/v${MDBOOK_VERSION}/mdbook-v${MDBOOK_VERSION}-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=bin
2326
echo "$(pwd)/bin" >> $GITHUB_PATH
2427
- name: Report versions
2528
run: |
@@ -33,3 +36,19 @@ jobs:
3336
curl -sSLo linkcheck.sh \
3437
https://raw.githubusercontent.com/rust-lang/rust/master/src/tools/linkchecker/linkcheck.sh
3538
sh linkcheck.sh --all nomicon
39+
40+
# The success job is here to consolidate the total success/failure state of
41+
# all other jobs. This job is then included in the GitHub branch protection
42+
# rule which prevents merges unless all other jobs are passing. This makes
43+
# it easier to manage the list of jobs via this yml file and to prevent
44+
# accidentally adding new jobs without also updating the branch protections.
45+
success:
46+
name: Success gate
47+
if: always()
48+
needs:
49+
- test
50+
runs-on: ubuntu-latest
51+
steps:
52+
- run: jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'
53+
- name: Done
54+
run: exit 0

0 commit comments

Comments
 (0)