Skip to content

Commit af5411f

Browse files
authored
Start using mdbook-linkcheck2 (rust-lang#2103)
1 parent a749d66 commit af5411f

File tree

3 files changed

+8
-14
lines changed

3 files changed

+8
-14
lines changed

Diff for: .github/workflows/ci.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
runs-on: ubuntu-latest
1616
env:
1717
MDBOOK_VERSION: 0.4.21
18-
MDBOOK_LINKCHECK_VERSION: 0.7.6
18+
MDBOOK_LINKCHECK2_VERSION: 0.8.1
1919
MDBOOK_MERMAID_VERSION: 0.12.6
2020
MDBOOK_TOC_VERSION: 0.11.2
2121
DEPLOY_DIR: book/html
@@ -33,7 +33,7 @@ jobs:
3333
with:
3434
path: |
3535
~/.cargo/bin
36-
key: ${{ runner.os }}-${{ env.MDBOOK_VERSION }}--${{ env.MDBOOK_LINKCHECK_VERSION }}--${{ env.MDBOOK_TOC_VERSION }}--${{ env.MDBOOK_MERMAID_VERSION }}
36+
key: ${{ runner.os }}-${{ env.MDBOOK_VERSION }}--${{ env.MDBOOK_LINKCHECK2_VERSION }}--${{ env.MDBOOK_TOC_VERSION }}--${{ env.MDBOOK_MERMAID_VERSION }}
3737

3838
- name: Cache linkcheck
3939
uses: actions/cache@v4
@@ -52,7 +52,7 @@ jobs:
5252
if: steps.mdbook-cache.outputs.cache-hit != 'true'
5353
run: |
5454
cargo install mdbook --version ${{ env.MDBOOK_VERSION }}
55-
cargo install mdbook-linkcheck --version ${{ env.MDBOOK_LINKCHECK_VERSION }}
55+
cargo install mdbook-linkcheck2 --version ${{ env.MDBOOK_LINKCHECK2_VERSION }}
5656
cargo install mdbook-toc --version ${{ env.MDBOOK_TOC_VERSION }}
5757
cargo install mdbook-mermaid --version ${{ env.MDBOOK_MERMAID_VERSION }}
5858

Diff for: README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ rustdocs][rustdocs].
4343
To build a local static HTML site, install [`mdbook`](https://github.com/rust-lang/mdBook) with:
4444

4545
```
46-
> cargo install mdbook mdbook-linkcheck mdbook-toc mdbook-mermaid
46+
> cargo install mdbook mdbook-linkcheck2 mdbook-toc mdbook-mermaid
4747
```
4848

4949
and execute the following command in the root of the repository:
@@ -56,7 +56,7 @@ The build files are found in the `book/html` directory.
5656

5757
### Link Validations
5858

59-
We use `mdbook-linkcheck` to validate URLs included in our documentation.
59+
We use `mdbook-linkcheck2` to validate URLs included in our documentation.
6060
`linkcheck` will be run automatically when you build with the instructions in the section above.
6161

6262
### Table of Contents

Diff for: ci/linkcheck.sh

+3-9
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ if [ "$GITHUB_EVENT_NAME" = "schedule" ] ; then # running in scheduled job
1414

1515
echo "Doing full link check."
1616
elif [ "$GITHUB_EVENT_NAME" = "pull_request" ] ; then # running in PR CI build
17-
echo "*** WARNING: linkcheck temporarily disabled due to bugs ***"
18-
exit 0
19-
2017
if [ -z "$BASE_SHA" ]; then
2118
echo "error: unexpected state: BASE_SHA must be non-empty in CI"
2219
exit 1
@@ -28,20 +25,17 @@ elif [ "$GITHUB_EVENT_NAME" = "pull_request" ] ; then # running in PR CI build
2825

2926
echo "Checking files changed since $BASE_SHA: $CHANGED_FILES"
3027
else # running locally
31-
echo "*** WARNING: linkcheck temporarily disabled due to bugs ***"
32-
exit 0
33-
3428
COMMIT_RANGE=master...
3529
CHANGED_FILES=$(git diff --name-only $COMMIT_RANGE | sed 's#^src/##' | tr '\n' ' ')
3630
FLAGS="-f $CHANGED_FILES"
3731

3832
echo "Checking files changed in $COMMIT_RANGE: $CHANGED_FILES"
3933
fi
4034

41-
echo "exec mdbook-linkcheck $FLAGS"
35+
echo "exec mdbook-linkcheck2 $FLAGS"
4236
if [ "$USE_TOKEN" = 1 ]; then
4337
config=$(set_github_token)
44-
exec mdbook-linkcheck $FLAGS <<<"$config"
38+
exec mdbook-linkcheck2 $FLAGS <<<"$config"
4539
else
46-
exec mdbook-linkcheck $FLAGS
40+
exec mdbook-linkcheck2 $FLAGS
4741
fi

0 commit comments

Comments
 (0)