diff --git a/.github/workflows/ci-linkchecks.yml b/.github/workflows/ci-linkchecks.yml new file mode 100644 index 00000000..1771ec59 --- /dev/null +++ b/.github/workflows/ci-linkchecks.yml @@ -0,0 +1,50 @@ +name: Linkcheck + +on: + workflow_dispatch: + schedule: + - cron: "00 06 * * *" + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + linkChecker: + runs-on: ubuntu-latest + permissions: + issues: write # required for peter-evans/create-issue-from-file + + steps: + - uses: actions/checkout@v6 + with: + fetch-depth: 0 + persist-credentials: false + + - name: Link Checker + id: lychee + uses: lycheeverse/lychee-action@8646ba30535128ac92d33dfc9133794bfdd9b411 + with: + token: ${{secrets.GITHUB_TOKEN}} + fail: false + args: | + --verbose + --max-concurrency 1 + './docs/**/*.rst' + './lib/**/*.py' + + - name: Create Issue From File + if: ${{ fromJSON(steps.lychee.outputs.exit_code) != 0 }} + uses: peter-evans/create-issue-from-file@fca9117c27cdc29c6c4db3b86c48e4115a786710 + with: + title: Link Checker Report + content-filepath: ./lychee/out.md + labels: | + Bot + Type: Documentation + Type: Bug + + - name: Fail Workflow On Link Errors + if: ${{ fromJSON(steps.lychee.outputs.exit_code) != 0 }} + run: + exit ${{ fromJSON(steps.lychee.outputs.exit_code) }} diff --git a/.github/workflows/ci-tests.yml b/.github/workflows/ci-tests.yml index 0d5c205f..cc6f09e8 100644 --- a/.github/workflows/ci-tests.yml +++ b/.github/workflows/ci-tests.yml @@ -36,7 +36,7 @@ jobs: matrix: os: ["ubuntu-latest"] python-version: ["3.14"] - session: ["doctest", "linkcheck"] + session: ["doctest"] iris-source : ["conda-forge"] include: - os: "ubuntu-latest" diff --git a/.lycheeignore b/.lycheeignore new file mode 100644 index 00000000..eb3c2bb1 --- /dev/null +++ b/.lycheeignore @@ -0,0 +1,10 @@ +# Change-log entries reference GitHub user accounts, which are common enough +# to trigger GitHub rate limiting. +https://github.com/[^/]*$ + +# GitHub seems especially keen to rate-limit "blob" URLs. +# (maybe because these are especially associated with abuse?) +https://github.com/[^/]*/[^/]*/blob/.* + +# Returns 403 when accessed from GitHub Actions +https://stackoverflow.com \ No newline at end of file diff --git a/README.md b/README.md index 14412ad0..baddfa6d 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ |------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ⚙️ CI | [![ci-manifest](https://github.com/SciTools/iris-grib/actions/workflows/ci-manifest.yml/badge.svg)](https://github.com/SciTools/iris-grib/actions/workflows/ci-manifest.yml) [![ci-tests](https://github.com/SciTools/iris-grib/actions/workflows/ci-tests.yml/badge.svg)](https://github.com/SciTools/iris-grib/actions/workflows/ci-tests.yml) [![pre-commit](https://results.pre-commit.ci/badge/github/SciTools/iris-grib/main.svg)](https://results.pre-commit.ci/latest/github/SciTools/iris-grib/main) | | 💬 Community | [![Contributor Covenant](https://img.shields.io/badge/contributor%20covenant-2.1-4baaaa.svg)](https://www.contributor-covenant.org/version/2/1/code_of_conduct/) [![GH Discussions](https://img.shields.io/badge/github-discussions%20%F0%9F%92%AC-yellow?logo=github&logoColor=lightgrey)](https://github.com/SciTools/iris-grib/discussions) | -| 📖 Documentation | [![rtd](https://readthedocs.org/projects/iris-grib/badge/?version=latest)](https://iris-grib.readthedocs.io/en/latest/?badge=latest) | +| 📖 Documentation | [![rtd](https://readthedocs.org/projects/iris-grib/badge/?version=latest)](https://iris-grib.readthedocs.io/en/latest/?badge=latest) [![Check Links](https://github.com/SciTools/iris-grib/actions/workflows/ci-linkchecks.yml/badge.svg)](https://github.com/SciTools/iris-grib/actions/workflows/ci-linkchecks.yml) | | 📈 Health | [![codecov](https://codecov.io/gh/SciTools/iris-grib/graph/badge.svg?token=5VtBaElXFW)](https://codecov.io/gh/SciTools/iris-grib) | | ✨ Meta | [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff) [![NEP29](https://raster.shields.io/badge/follows-NEP29-orange.png)](https://numpy.org/neps/nep-0029-deprecation_policy.html) [![license - bds-3-clause](https://img.shields.io/github/license/SciTools/iris-grib)](https://github.com/SciTools/iris-grib/blob/main/LICENSE) [![conda platform](https://img.shields.io/conda/pn/conda-forge/iris-grib.svg)](https://anaconda.org/conda-forge/iris-grib) | | 📦 Package | [![conda-forge](https://img.shields.io/conda/vn/conda-forge/iris-grib?color=orange&label=conda-forge&logo=conda-forge&logoColor=white)](https://anaconda.org/conda-forge/iris-grib) [![pypi](https://img.shields.io/pypi/v/iris-grib?color=orange&label=pypi&logo=python&logoColor=white)](https://pypi.org/project/iris-grib/) [![pypi - python version](https://img.shields.io/pypi/pyversions/iris-grib.svg?color=orange&logo=python&label=python&logoColor=white)](https://pypi.org/project/iris-grib/) | diff --git a/docs/Makefile b/docs/Makefile index 3dfa5d6c..3f197d11 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -47,7 +47,6 @@ help: @echo " changes to make an overview of all changed/added/deprecated items" @echo " xml to make Docutils-native XML files" @echo " pseudoxml to make pseudoxml-XML files for display purposes" - @echo " linkcheck to check all external links for integrity" @echo " doctest to run all doctests embedded in the documentation (if enabled)" @echo " coverage to run coverage check of the documentation (if enabled)" @echo " dummy to check syntax errors of document sources" @@ -196,13 +195,6 @@ changes: @echo @echo "The overview file is in $(BUILDDIR)/changes." -.PHONY: linkcheck -linkcheck: - $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck - @echo - @echo "Link check complete; look for any errors in the above output " \ - "or in $(BUILDDIR)/linkcheck/output.txt." - .PHONY: doctest doctest: $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest diff --git a/docs/conf.py b/docs/conf.py index 861e0ff6..e6f26ae8 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -101,15 +101,6 @@ # If true, `todo` and `todoList` produce output, else they produce nothing. todo_include_todos = False -# url link checker. Some links registering as faulty, despite being functional. -# See https://www.sphinx-doc.org/en/1.2/config.html[...] -# [...]#options-for-the-linkcheck-builder - -linkcheck_ignore = [ - "https://github.com/Scitools/iris-grib/compare" - "/c4243ae..5c314e3#diff-cf46b46880cae59e82a91c7ab6bb81ba" -] - # -- Autodoc ------------------------------------------------------------------ autodoc_member_order = "groupwise" diff --git a/docs/make.bat b/docs/make.bat index d485d3bc..b567efac 100644 --- a/docs/make.bat +++ b/docs/make.bat @@ -36,7 +36,6 @@ if "%1" == "help" ( echo. changes to make an overview over all changed/added/deprecated items echo. xml to make Docutils-native XML files echo. pseudoxml to make pseudoxml-XML files for display purposes - echo. linkcheck to check all external links for integrity echo. doctest to run all doctests embedded in the documentation if enabled echo. coverage to run coverage check of the documentation if enabled echo. dummy to check syntax errors of document sources @@ -227,15 +226,6 @@ if "%1" == "changes" ( goto end ) -if "%1" == "linkcheck" ( - %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck - if errorlevel 1 exit /b 1 - echo. - echo.Link check complete; look for any errors in the above output ^ -or in %BUILDDIR%/linkcheck/output.txt. - goto end -) - if "%1" == "doctest" ( %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest if errorlevel 1 exit /b 1 diff --git a/docs/reference/release_notes.rst b/docs/reference/release_notes.rst index 946c5c74..381a87f6 100644 --- a/docs/reference/release_notes.rst +++ b/docs/reference/release_notes.rst @@ -3,6 +3,18 @@ Release Notes ============= +What's new in iris-grib v0.23.0 +------------------------------- + +:Release: 0.23.0 +:Date: TBC + +Internal +^^^^^^^^ +* `@trexfeathers `_ switched the link check CI + to be the standard SciTools overnight job using Lychee. + `(PR#795) `_ + What's new in iris-grib v0.22.0 ------------------------------- diff --git a/noxfile.py b/noxfile.py index 6e489e1d..fc347727 100755 --- a/noxfile.py +++ b/noxfile.py @@ -319,31 +319,5 @@ def doctest(session: nox.sessions.Session): ) -@nox.session(python=PY_VER, venv_backend="conda") -def linkcheck(session: nox.sessions.Session): - """ - Perform iris-grib doc link check. - - Parameters - ---------- - session: object - A `nox.sessions.Session` object. - - """ - prepare_venv(session) - session.cd("docs") - session.run( - "make", - "clean", - "html", - external=True, - ) - session.run( - "make", - "linkcheck", - external=True, - ) - - if __name__ == "__main__": nox.main()