diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 936d1c81..0ddf5b46 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -7,6 +7,10 @@ on: - 'v*' pull_request: +env: + PY_COLORS: 1 + FORCE_COLOR: True + jobs: pre-commit: runs-on: ubuntu-latest @@ -75,9 +79,15 @@ jobs: run: | python -m pip install --upgrade pip pip install -e .[doc] - - name: Build documentation + + - name: Check for broken links + run: > + sphinx-build -b linkcheck docs docs/_build/linkcheck + + - name: Build documentation to audit run: > sphinx-build -b html docs docs/_build/html -w warnings.txt + - name: Check that there are no unexpected warnings shell: python run: | @@ -87,34 +97,6 @@ jobs: unexpected = [ii for ii in text.split("\n") if "kitchen-sink" not in ii] assert len(unexpected) == 0 - # Ref: https://github.com/lycheeverse/lychee-action - # Excluded files: - # - nature.com: DOI redirect works but errors anyway - # - doi.org: DOI redirect works but errors anyway - # - yahoo.com: Kitchen sink redirect we don't control - # - someurl: dummy url - # - mailto: fails test but works for people - # - pathto(: because the pydata theme packages invalid HTML w/ this in it - # - mybinder.org: because Binder sometimes incorrectly doesn't respond - # - github.com/search: because GitHub search results return a network error - - name: Check for broken links - id: lychee - uses: lycheeverse/lychee-action@v1.4.1 - env: - GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} - with: - fail: true - args: > - './docs/_build/html/**/*.html' - --exclude 'nature.com' - --exclude 'doi.org' - --exclude 'yahoo.com' - --exclude 'someurl' - --exclude 'mailto:docutils-develop' - --exclude 'pathto\(' - --exclude 'mybinder.org' - --exclude 'github.com/search' - - name: Audit with Lighthouse uses: treosh/lighthouse-ci-action@9.3.0 with: diff --git a/docs/conf.py b/docs/conf.py index 5b6db00a..4e959e01 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -145,6 +145,11 @@ bibtex_reference_style = "author_year" bibtex_default_style = "plain" +linkcheck_ignore = [ + "http://someurl/release", # This is a fake link + "https://doi.org", # These don't resolve properly and cause SSL issues +] + # -- Download kitchen sink reference docs ------------------------------------- # These are the kitchen sink files used by the Sphinx Themes gallery at # https://github.com/sphinx-themes/sphinx-themes.org