Skip to content

Commit f1ca3d6

Browse files
authored
ci: don't run most CI on push (#12230)
* ci: don't run most CI on push Merge group status checks are reported on push. I believe there is no point in re-running everything again after the merge group is committed. * ci: fix nested concurrency
1 parent 65c39cc commit f1ca3d6

File tree

2 files changed

+66
-42
lines changed

2 files changed

+66
-42
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@ name: CI
33
permissions: {}
44

55
on:
6-
push:
7-
branches:
8-
- master
96
pull_request:
107
merge_group:
118

@@ -28,48 +25,12 @@ jobs:
2825
secrets: inherit
2926

3027
docs:
31-
runs-on: depot-ubuntu-latest
32-
timeout-minutes: 30
28+
uses: ./.github/workflows/docs.yml
3329
permissions:
3430
contents: read
35-
steps:
36-
- uses: actions/checkout@v5
37-
with:
38-
persist-credentials: false
39-
- uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9 # master
40-
with:
41-
toolchain: nightly
42-
- uses: rui314/setup-mold@725a8794d15fc7563f59595bd9556495c0564878 # v1
43-
- uses: mozilla-actions/sccache-action@7d986dd989559c6ecdb630a3fd2557667be217ad # v0.0.9
44-
- uses: Swatinem/rust-cache@f13886b937689c021905a6b90929199931d60db1 # v2
45-
- name: Build documentation
46-
run: cargo doc --workspace --all-features --no-deps --document-private-items
47-
env:
48-
RUSTDOCFLAGS: --cfg docsrs -D warnings --show-type-layout --generate-link-to-definition --enable-index-page -Zunstable-options
49-
- name: Setup Pages
50-
if: github.ref_name == 'master' && github.event_name == 'push'
51-
uses: actions/configure-pages@v5
52-
- name: Upload artifact
53-
if: github.ref_name == 'master' && github.event_name == 'push'
54-
uses: actions/upload-pages-artifact@v4
55-
with:
56-
path: ./target/doc
57-
58-
deploy-docs:
59-
if: github.ref_name == 'master' && github.event_name == 'push'
60-
needs: [docs]
61-
runs-on: depot-ubuntu-latest
62-
timeout-minutes: 30
63-
permissions:
6431
pages: write
6532
id-token: write
66-
environment:
67-
name: github-pages
68-
url: ${{ steps.deployment.outputs.page_url }}
69-
steps:
70-
- name: Deploy to GitHub Pages
71-
id: deployment
72-
uses: actions/deploy-pages@v4
33+
secrets: inherit
7334

7435
doctest:
7536
runs-on: depot-ubuntu-latest
@@ -179,7 +140,7 @@ jobs:
179140
contents: read
180141

181142
codeql:
182-
name: Analyze (${{ matrix.language }})
143+
name: analyze (${{ matrix.language }})
183144
runs-on: ubuntu-latest
184145
permissions:
185146
security-events: write

.github/workflows/docs.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: docs
2+
3+
permissions: {}
4+
5+
on:
6+
push:
7+
branches:
8+
- master
9+
workflow_call:
10+
11+
concurrency:
12+
group: docs-${{ github.workflow }}-${{ github.head_ref || github.run_id }}
13+
cancel-in-progress: true
14+
15+
env:
16+
CARGO_TERM_COLOR: always
17+
RUST_BACKTRACE: full
18+
RUSTC_WRAPPER: "sccache"
19+
20+
jobs:
21+
docs:
22+
runs-on: depot-ubuntu-latest
23+
timeout-minutes: 30
24+
permissions:
25+
contents: read
26+
steps:
27+
- uses: actions/checkout@v5
28+
with:
29+
persist-credentials: false
30+
- uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9 # master
31+
with:
32+
toolchain: nightly
33+
- uses: rui314/setup-mold@725a8794d15fc7563f59595bd9556495c0564878 # v1
34+
- uses: mozilla-actions/sccache-action@7d986dd989559c6ecdb630a3fd2557667be217ad # v0.0.9
35+
- uses: Swatinem/rust-cache@f13886b937689c021905a6b90929199931d60db1 # v2
36+
- name: Build documentation
37+
run: cargo doc --workspace --all-features --no-deps --document-private-items
38+
env:
39+
RUSTDOCFLAGS: --cfg docsrs -D warnings --show-type-layout --generate-link-to-definition --enable-index-page -Zunstable-options
40+
- name: Setup Pages
41+
if: github.ref_name == 'master' && github.event_name == 'push'
42+
uses: actions/configure-pages@v5
43+
- name: Upload artifact
44+
if: github.ref_name == 'master' && github.event_name == 'push'
45+
uses: actions/upload-pages-artifact@v4
46+
with:
47+
path: ./target/doc
48+
49+
deploy-docs:
50+
if: github.ref_name == 'master' && github.event_name == 'push'
51+
needs: [docs]
52+
runs-on: depot-ubuntu-latest
53+
timeout-minutes: 30
54+
permissions:
55+
pages: write
56+
id-token: write
57+
environment:
58+
name: github-pages
59+
url: ${{ steps.deployment.outputs.page_url }}
60+
steps:
61+
- name: Deploy to GitHub Pages
62+
id: deployment
63+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)