-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ci] use cargo deadlinks
to check for dead links
#1021
base: main
Are you sure you want to change the base?
Conversation
.github/workflows/ci.yml
Outdated
# is a link-checking wrapper around `cargo doc`. | ||
export RUSTDOCFLAGS="${{ matrix.toolchain == 'nightly' && '-Z unstable-options --document-hidden-items' || '' }} $RUSTDOCFLAGS $METADATA_DOCS_RS_RUSTDOC_ARGS" | ||
./cargo.sh +${{ matrix.toolchain }} deadlinks --check-intra-doc-links -- --document-private-items --package ${{ matrix.crate }} ${{ matrix.features }} | ||
if: matrix.toolchain != 'msrv' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Explain why?
Also, I'd recommend just nightly. Runs fewer jobs and the behavior of this is very unlikely to differ by toolchain. Notably, our docs.rs docs are only built from nightly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The MSRV of this version of deadlinks is higher than our MSRV.
Restricting to nightly seems reasonable, though.
.github/workflows/ci.yml
Outdated
# We invoke `cargo deadlinks` instead of `cargo doc`; `cargo deadlinks` | ||
# is a link-checking wrapper around `cargo doc`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No we don't anymore 🙂
61ac2c7
to
2022b0c
Compare
Since `cargo deadlinks` is just a link-checking wrapper around `cargo doc`, we can simply replace our `doc` invocation with `deadlinks` to get the benefits of both.
Hm, I can't replicate the issue here locally: https://github.com/google/zerocopy/actions/runs/8159490578/job/22304041953?pr=1021 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, I can't replicate the issue here locally: https://github.com/google/zerocopy/actions/runs/8159490578/job/22304041953?pr=1021
Is it possible that this jq
failure is behind it? https://github.com/google/zerocopy/actions/runs/8159490578/job/22304041953?pr=1021#step:16:21
@@ -277,6 +277,17 @@ jobs: | |||
export RUSTDOCFLAGS="${{ matrix.toolchain == 'nightly' && '-Z unstable-options --document-hidden-items' || '' }} $RUSTDOCFLAGS $METADATA_DOCS_RS_RUSTDOC_ARGS" | |||
./cargo.sh +${{ matrix.toolchain }} doc --document-private-items --package ${{ matrix.crate }} ${{ matrix.features }} | |||
|
|||
- name: Check dead links | |||
run: | | |||
cargo install -q cargo-deadlinks --version 0.8.1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cargo install -q cargo-deadlinks --version 0.8.1 | |
set -eo pipefail | |
cargo install -q cargo-deadlinks --version 0.8.1 |
And honestly, in other jobs (notably, the previous one) while you're at it. We should have it in every job.
This is a point in favor of landing #1021
Release 0.8.2. This is a point in favor of landing #1021
Release 0.8.2. This is a point in favor of landing #1021
Since
cargo deadlinks
is just a link-checking wrapper aroundcargo doc
, we can simply replace ourdoc
invocation withdeadlinks
to get the benefits of both.