Skip to content

Commit

Permalink
fix: inter-docs links
Browse files Browse the repository at this point in the history
  • Loading branch information
tdejager committed Sep 20, 2024
1 parent 42797f3 commit 755f550
Showing 1 changed file with 23 additions and 3 deletions.
26 changes: 23 additions & 3 deletions .github/workflows/rust-compile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,28 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
- run: |
for package in $(cargo metadata --no-deps --format-version=1 | jq -r '.packages[] | .name'); do
cargo rustdoc -p "$package" --all-features -- -D warnings -W unreachable-pub
- run: >
# Check intra-doc links, thanks to ChatGPT
cargo metadata --no-deps --format-version=1 \
| jq -r '.packages[] | .name as $pname | .targets[] | [$pname, .kind[], .name] | @tsv' \
| while IFS=$'\t' read -r package kind name; do
case "$kind" in
lib)
cargo rustdoc -p "$package" --lib --all-features -- -D warnings -W unreachable-pub
;;
bin)
cargo rustdoc -p "$package" --bin "$name" --all-features -- -D warnings -W unreachable-pub
;;
example)
cargo rustdoc -p "$package" --example "$name" --all-features -- -D warnings -W unreachable-pub
;;
test)
cargo rustdoc -p "$package" --test "$name" --all-features -- -D warnings -W unreachable-pub
;;
bench)
cargo rustdoc -p "$package" --bench "$name" --all-features -- -D warnings -W unreachable-pub
;;
esac
done
format_and_lint:
Expand Down Expand Up @@ -54,6 +73,7 @@ jobs:
steps:
- name: Checkout source code
uses: actions/checkout@v4

- name: Install Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
Expand Down

0 comments on commit 755f550

Please sign in to comment.