Skip to content

Commit 72c7328

Browse files
committed
ci: pull out separate rust doc job
Previously `cargo doc` was being invoked in the per-platform CI jobs. This feels unnecessary since no documentation items are gated per-platform and we can rely on the upstream `cargo doc` tool owners to test for general doc generation platform compatibility. In this commit the `cargo doc` invocation is moved to a dedicated job. This also allows shifting the `RUSTDOCFLAGS` env var from a global env var to one scoped to just the job that requires it. We continue to test doc generation using the stable, beta, nightly and MSRV rust versions.
1 parent d42a2a4 commit 72c7328

File tree

1 file changed

+20
-5
lines changed

1 file changed

+20
-5
lines changed

.github/workflows/ci.yml

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ on:
99

1010
env:
1111
RUSTFLAGS: -D warnings
12-
RUSTDOCFLAGS: -D warnings
1312

1413
jobs:
1514
rustfmt:
@@ -41,6 +40,26 @@ jobs:
4140
components: clippy
4241
- run: cargo clippy --all-features
4342

43+
rustdoc:
44+
name: Documentation
45+
runs-on: ubuntu-latest
46+
strategy:
47+
matrix:
48+
toolchain: [stable, beta, nightly, stable 7 months ago]
49+
steps:
50+
- name: Checkout sources
51+
uses: actions/checkout@v4
52+
with:
53+
persist-credentials: false
54+
- name: Install rust toolchain
55+
uses: dtolnay/rust-toolchain@master
56+
with:
57+
toolchain: ${{ matrix.toolchain }}
58+
- name: cargo doc (all features)
59+
run: cargo doc --all --all-features
60+
env:
61+
RUSTDOCFLAGS: '-Dwarnings'
62+
4463
build-windows:
4564
runs-on: windows-latest
4665
env:
@@ -67,8 +86,6 @@ jobs:
6786
run: cargo test --all
6887
- name: Run the tests with x509-parser enabled
6988
run: cargo test --verbose --features x509-parser
70-
- name: Run cargo doc
71-
run: cargo doc --all --all-features
7289

7390
build:
7491
strategy:
@@ -97,8 +114,6 @@ jobs:
97114
run: cargo test --all
98115
- name: Run the tests with x509-parser enabled
99116
run: cargo test --verbose --features x509-parser
100-
- name: Run cargo doc
101-
run: cargo doc --all --all-features
102117

103118
coverage:
104119
name: Measure coverage

0 commit comments

Comments
 (0)