From b950d37c560cd6742c742b4e171cac0f0cd20506 Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Thu, 24 Oct 2024 09:14:05 +0200 Subject: [PATCH] Start using mdbook-linkcheck2 --- .github/workflows/ci.yml | 6 +++--- README.md | 4 ++-- ci/linkcheck.sh | 12 +++--------- 3 files changed, 8 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0132d6983..f7bfb77a3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,7 +15,7 @@ jobs: runs-on: ubuntu-latest env: MDBOOK_VERSION: 0.4.21 - MDBOOK_LINKCHECK_VERSION: 0.7.6 + MDBOOK_LINKCHECK2_VERSION: 0.8.1 MDBOOK_MERMAID_VERSION: 0.12.6 MDBOOK_TOC_VERSION: 0.11.2 DEPLOY_DIR: book/html @@ -33,7 +33,7 @@ jobs: with: path: | ~/.cargo/bin - key: ${{ runner.os }}-${{ env.MDBOOK_VERSION }}--${{ env.MDBOOK_LINKCHECK_VERSION }}--${{ env.MDBOOK_TOC_VERSION }}--${{ env.MDBOOK_MERMAID_VERSION }} + key: ${{ runner.os }}-${{ env.MDBOOK_VERSION }}--${{ env.MDBOOK_LINKCHECK2_VERSION }}--${{ env.MDBOOK_TOC_VERSION }}--${{ env.MDBOOK_MERMAID_VERSION }} - name: Cache linkcheck uses: actions/cache@v4 @@ -52,7 +52,7 @@ jobs: if: steps.mdbook-cache.outputs.cache-hit != 'true' run: | cargo install mdbook --version ${{ env.MDBOOK_VERSION }} - cargo install mdbook-linkcheck --version ${{ env.MDBOOK_LINKCHECK_VERSION }} + cargo install mdbook-linkcheck2 --version ${{ env.MDBOOK_LINKCHECK2_VERSION }} cargo install mdbook-toc --version ${{ env.MDBOOK_TOC_VERSION }} cargo install mdbook-mermaid --version ${{ env.MDBOOK_MERMAID_VERSION }} diff --git a/README.md b/README.md index 500dcf9e4..599de487b 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ rustdocs][rustdocs]. To build a local static HTML site, install [`mdbook`](https://github.com/rust-lang/mdBook) with: ``` -> cargo install mdbook mdbook-linkcheck mdbook-toc mdbook-mermaid +> cargo install mdbook mdbook-linkcheck2 mdbook-toc mdbook-mermaid ``` 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. ### Link Validations -We use `mdbook-linkcheck` to validate URLs included in our documentation. +We use `mdbook-linkcheck2` to validate URLs included in our documentation. `linkcheck` will be run automatically when you build with the instructions in the section above. ### Table of Contents diff --git a/ci/linkcheck.sh b/ci/linkcheck.sh index 5f523f874..b3d8a4444 100755 --- a/ci/linkcheck.sh +++ b/ci/linkcheck.sh @@ -14,9 +14,6 @@ if [ "$GITHUB_EVENT_NAME" = "schedule" ] ; then # running in scheduled job echo "Doing full link check." elif [ "$GITHUB_EVENT_NAME" = "pull_request" ] ; then # running in PR CI build - echo "*** WARNING: linkcheck temporarily disabled due to bugs ***" - exit 0 - if [ -z "$BASE_SHA" ]; then echo "error: unexpected state: BASE_SHA must be non-empty in CI" exit 1 @@ -28,9 +25,6 @@ elif [ "$GITHUB_EVENT_NAME" = "pull_request" ] ; then # running in PR CI build echo "Checking files changed since $BASE_SHA: $CHANGED_FILES" else # running locally - echo "*** WARNING: linkcheck temporarily disabled due to bugs ***" - exit 0 - COMMIT_RANGE=master... CHANGED_FILES=$(git diff --name-only $COMMIT_RANGE | sed 's#^src/##' | tr '\n' ' ') FLAGS="-f $CHANGED_FILES" @@ -38,10 +32,10 @@ else # running locally echo "Checking files changed in $COMMIT_RANGE: $CHANGED_FILES" fi -echo "exec mdbook-linkcheck $FLAGS" +echo "exec mdbook-linkcheck2 $FLAGS" if [ "$USE_TOKEN" = 1 ]; then config=$(set_github_token) - exec mdbook-linkcheck $FLAGS <<<"$config" + exec mdbook-linkcheck2 $FLAGS <<<"$config" else - exec mdbook-linkcheck $FLAGS + exec mdbook-linkcheck2 $FLAGS fi