Skip to content

Commit 840fc19

Browse files
committed
CI install rustdoc nightly with stable date version
1 parent 3e510f6 commit 840fc19

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

.github/workflows/ci.yml

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -134,19 +134,26 @@ jobs:
134134
run: ./.github/workflows/disable-bench-deps.sh
135135
- name: Install dependencies
136136
run: sudo bash ./.github/workflows/install-deps.sh
137-
- name: Install Rust nightly
138-
run: rustup toolchain install nightly
137+
- name: Install Rust nightly (stable date version)
138+
id: install-rust
139+
run: |
140+
STABLE_DATE=$(rustdoc --version | perl -ne 'print $& if /\b\d{4}-\d{2}-\d{2}\b/')
141+
echo "stable_date=$STABLE_DATE" >> $GITHUB_OUTPUT
142+
143+
rustup toolchain install nightly-$STABLE_DATE
144+
145+
echo "Stable version: $(rustdoc --version)"
146+
echo "Near stable nightly version: $(rustdoc +nightly-$STABLE_DATE --version)"
139147
- name: Restore cargo caches
140148
uses: Swatinem/rust-cache@v1
141-
- name: Run rustdoc
149+
- name: Run rustdoc nightly-${{ steps.install-rust.outputs.stable_date }}
142150
run: |
143151
cd spdlog
144-
# The reason for allowing lint `unexpected_cfgs` not in `build.rs` or `Cargo.toml` but only in CI is that we need to keep MSRV
145-
cargo +nightly rustdoc --verbose -- -D warnings -A unexpected_cfgs -A rustdoc::broken-intra-doc-links
146-
cargo +nightly rustdoc --all-features --verbose -- -D warnings -A unexpected_cfgs
152+
cargo +nightly-${{ steps.install-rust.outputs.stable_date }} rustdoc --verbose -- -D warnings -A rustdoc::broken-intra-doc-links
153+
cargo +nightly-${{ steps.install-rust.outputs.stable_date }} rustdoc --all-features --verbose -- -D warnings
147154
cd ../spdlog-macros
148-
cargo +nightly rustdoc --verbose -- -D warnings -A unexpected_cfgs -A rustdoc::broken-intra-doc-links
149-
cargo +nightly rustdoc --all-features --verbose -- -D warnings -A unexpected_cfgs
155+
cargo +nightly-${{ steps.install-rust.outputs.stable_date }} rustdoc --verbose -- -D warnings -A rustdoc::broken-intra-doc-links
156+
cargo +nightly-${{ steps.install-rust.outputs.stable_date }} rustdoc --all-features --verbose -- -D warnings
150157
151158
check-msrv:
152159
strategy:

0 commit comments

Comments
 (0)