Skip to content

Commit fffaaef

Browse files
committed
[ci] use cargo deadlinks to check for dead links
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.
1 parent 52705df commit fffaaef

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

.github/workflows/ci.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -270,12 +270,15 @@ jobs:
270270
# --document-hidden-items is unstable; if a future release breaks or removes it,
271271
# we can just update CI to no longer pass that flag.
272272
run: |
273+
cargo install -q cargo-deadlinks --version 0.8.1
273274
# Include arguments passed during docs.rs deployments to make sure those
274275
# work properly.
275276
METADATA_DOCS_RS_RUSTDOC_ARGS="$(cargo metadata --format-version 1 | \
276277
jq -r ".packages[] | select(.name == \"zerocopy\").metadata.docs.rs.\"rustdoc-args\".[]" | tr '\n' ' ')"
278+
# We invoke `cargo deadlinks` instead of `cargo doc`; `cargo deadlinks`
279+
# is a link-checking wrapper around `cargo doc`.
277280
export RUSTDOCFLAGS="${{ matrix.toolchain == 'nightly' && '-Z unstable-options --document-hidden-items' || '' }} $RUSTDOCFLAGS $METADATA_DOCS_RS_RUSTDOC_ARGS"
278-
./cargo.sh +${{ matrix.toolchain }} doc --document-private-items --package ${{ matrix.crate }} ${{ matrix.features }}
281+
./cargo.sh +${{ matrix.toolchain }} deadlinks --check-intra-doc-links -- --document-private-items --package ${{ matrix.crate }} ${{ matrix.features }}
279282
280283
# Check semver compatibility with the most recently-published version on
281284
# crates.io. We do this in the matrix rather than in its own job so that it
@@ -412,11 +415,12 @@ jobs:
412415
# in parallel.
413416
#
414417
# [1] https://stackoverflow.com/a/42139535/836390
415-
cargo check --workspace --tests &> /dev/null &
416-
cargo metadata &> /dev/null &
417-
cargo install cargo-readme --version 3.2.0 &> /dev/null &
418-
cargo install --locked kani-verifier &> /dev/null &
419-
cargo kani setup &> /dev/null &
418+
cargo check --workspace --tests &> /dev/null &
419+
cargo metadata &> /dev/null &
420+
cargo install cargo-readme --version 3.2.0 &> /dev/null &
421+
cargo install cargo-deadlinks --version 0.8.1 &> /dev/null &
422+
cargo install --locked kani-verifier &> /dev/null &
423+
cargo kani setup &> /dev/null &
420424
421425
wait
422426

0 commit comments

Comments
 (0)