diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d04a798b86..144099239a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -73,10 +73,21 @@ jobs: pip install tox-uv tox -e lint-${{ matrix.py-version.tox }} + lychee: + name: "Link Check" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7 + with: + persist-credentials: false + - uses: lycheeverse/lychee-action@e7477775783ea5526144ba13e8db5eec57747ce8 # v2.9.0 + with: + args: -vv --root-dir ${{ github.workspace }} --config lychee.toml baybe docs examples README.md CONTRIBUTING.md CHANGELOG.md + build-docs: name: "Build Docs" runs-on: ubuntu-latest - needs: [lint] + needs: [lint, lychee] permissions: contents: read pages: write # Required to deploy to GitHub Pages diff --git a/docs/scripts/check_links.py b/docs/scripts/check_links.py index a2e3b415ac..a374af0e8f 100644 --- a/docs/scripts/check_links.py +++ b/docs/scripts/check_links.py @@ -1,16 +1,16 @@ -"""Utility for checking the links of the documentation.""" +"""Utility for checking the cross-references of the documentation.""" from subprocess import check_call def check_links() -> None: - """Check whether the links of the documentation are valid.""" - link_call = [ - "sphinx-build", - "-b", - "linkcheck", - "docs", - "docs/build", - ] - - check_call(link_call) + """Check that documentation cross-references resolve (external links: lychee).""" + check_call( + [ + "sphinx-build", + "-b", + "dummy", + "docs", + "docs/build", + ] + ) diff --git a/lychee.toml b/lychee.toml new file mode 100644 index 0000000000..5a46fb02a9 --- /dev/null +++ b/lychee.toml @@ -0,0 +1,7 @@ +# External link check. Keep `exclude` in sync with `linkcheck_ignore` in docs/conf.py. +scheme = ["https", "http"] +exclude = [ + "https://github\\.com/b-shields/edbo/blob.*", + "https://doi\\.org/10\\.26434/chemrxiv\\.10001986/v2", + "https://doi\\.org/10\\.1039/D5DD00050E", +]