-
Notifications
You must be signed in to change notification settings - Fork 218
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: check internal links in mdbook after build
- Loading branch information
1 parent
69c6db0
commit e695fd2
Showing
1 changed file
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# We also have a check-links-markdown job, however it will not spot mdbook | ||
# mistakes such as forgetting to list an .md file in SUMMARY.md. | ||
# Running a link checker on the generated HTML is more reliable. | ||
|
||
name: check-links-book | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
- "web/book/**" | ||
- ".github/workflows/check-links-book.yaml" | ||
workflow_call: | ||
|
||
env: | ||
RUSTFLAGS: "-C debuginfo=0" | ||
|
||
concurrency: | ||
# See notes in `pull-request.yaml` | ||
group: ${{ github.workflow }}-${{ github.ref }}-check-links | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
check: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- uses: baptiste0928/cargo-install@v2 | ||
with: | ||
crate: mdbook | ||
|
||
# the link checker | ||
- uses: baptiste0928/cargo-install@v2 | ||
with: | ||
crate: hyperlink | ||
|
||
- name: Cache | ||
uses: Swatinem/rust-cache@v2 | ||
with: | ||
prefix-key: 0.8.1 | ||
save-if: ${{ github.ref == 'refs/heads/main' }} | ||
|
||
- uses: arduino/setup-task@v1 | ||
with: | ||
repo-token: "${{ secrets.GITHUB_TOKEN }}" | ||
|
||
- name: Build the mdbook | ||
run: mdbook build web/book/ | ||
|
||
- name: Check links | ||
run: hyperlink web/book/book/ |