Start using mdbook-linkcheck2 (#2103)
This commit is contained in:
parent
5f32a38a3d
commit
0d9aca4ccd
|
|
@ -15,7 +15,7 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
env:
|
env:
|
||||||
MDBOOK_VERSION: 0.4.21
|
MDBOOK_VERSION: 0.4.21
|
||||||
MDBOOK_LINKCHECK_VERSION: 0.7.6
|
MDBOOK_LINKCHECK2_VERSION: 0.8.1
|
||||||
MDBOOK_MERMAID_VERSION: 0.12.6
|
MDBOOK_MERMAID_VERSION: 0.12.6
|
||||||
MDBOOK_TOC_VERSION: 0.11.2
|
MDBOOK_TOC_VERSION: 0.11.2
|
||||||
DEPLOY_DIR: book/html
|
DEPLOY_DIR: book/html
|
||||||
|
|
@ -33,7 +33,7 @@ jobs:
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
~/.cargo/bin
|
~/.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
|
- name: Cache linkcheck
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
|
|
@ -52,7 +52,7 @@ jobs:
|
||||||
if: steps.mdbook-cache.outputs.cache-hit != 'true'
|
if: steps.mdbook-cache.outputs.cache-hit != 'true'
|
||||||
run: |
|
run: |
|
||||||
cargo install mdbook --version ${{ env.MDBOOK_VERSION }}
|
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-toc --version ${{ env.MDBOOK_TOC_VERSION }}
|
||||||
cargo install mdbook-mermaid --version ${{ env.MDBOOK_MERMAID_VERSION }}
|
cargo install mdbook-mermaid --version ${{ env.MDBOOK_MERMAID_VERSION }}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@ rustdocs][rustdocs].
|
||||||
To build a local static HTML site, install [`mdbook`](https://github.com/rust-lang/mdBook) with:
|
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:
|
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
|
### 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.
|
`linkcheck` will be run automatically when you build with the instructions in the section above.
|
||||||
|
|
||||||
### Table of Contents
|
### Table of Contents
|
||||||
|
|
|
||||||
|
|
@ -14,9 +14,6 @@ if [ "$GITHUB_EVENT_NAME" = "schedule" ] ; then # running in scheduled job
|
||||||
|
|
||||||
echo "Doing full link check."
|
echo "Doing full link check."
|
||||||
elif [ "$GITHUB_EVENT_NAME" = "pull_request" ] ; then # running in PR CI build
|
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
|
if [ -z "$BASE_SHA" ]; then
|
||||||
echo "error: unexpected state: BASE_SHA must be non-empty in CI"
|
echo "error: unexpected state: BASE_SHA must be non-empty in CI"
|
||||||
exit 1
|
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"
|
echo "Checking files changed since $BASE_SHA: $CHANGED_FILES"
|
||||||
else # running locally
|
else # running locally
|
||||||
echo "*** WARNING: linkcheck temporarily disabled due to bugs ***"
|
|
||||||
exit 0
|
|
||||||
|
|
||||||
COMMIT_RANGE=master...
|
COMMIT_RANGE=master...
|
||||||
CHANGED_FILES=$(git diff --name-only $COMMIT_RANGE | sed 's#^src/##' | tr '\n' ' ')
|
CHANGED_FILES=$(git diff --name-only $COMMIT_RANGE | sed 's#^src/##' | tr '\n' ' ')
|
||||||
FLAGS="-f $CHANGED_FILES"
|
FLAGS="-f $CHANGED_FILES"
|
||||||
|
|
@ -38,10 +32,10 @@ else # running locally
|
||||||
echo "Checking files changed in $COMMIT_RANGE: $CHANGED_FILES"
|
echo "Checking files changed in $COMMIT_RANGE: $CHANGED_FILES"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "exec mdbook-linkcheck $FLAGS"
|
echo "exec mdbook-linkcheck2 $FLAGS"
|
||||||
if [ "$USE_TOKEN" = 1 ]; then
|
if [ "$USE_TOKEN" = 1 ]; then
|
||||||
config=$(set_github_token)
|
config=$(set_github_token)
|
||||||
exec mdbook-linkcheck $FLAGS <<<"$config"
|
exec mdbook-linkcheck2 $FLAGS <<<"$config"
|
||||||
else
|
else
|
||||||
exec mdbook-linkcheck $FLAGS
|
exec mdbook-linkcheck2 $FLAGS
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue