File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -53,14 +53,25 @@ jobs:
5353 - name : Install dependencies
5454 run : |
5555 python -m pip install --upgrade nox virtualenv
56+ - name : Restore linkcheck baseline
57+ if : matrix.noxenv == 'linkcheck' && (github.event_name == 'pull_request' || github.event_name == 'merge_group')
58+ uses : actions/cache/restore@v4
59+ with :
60+ path : build/output.json
61+ key : linkcheck-baseline-${{ github.event.pull_request.base.sha || github.event.merge_group.base_sha || github.sha }}
5662
5763 - name : Nox ${{ matrix.noxenv }}
5864 env :
5965 # Authenticate github.com requests during linkcheck to avoid rate limits.
6066 GITHUB_TOKEN : ${{ matrix.noxenv == 'linkcheck' && github.token || '' }}
6167 run : |
6268 python -m nox -s ${{ matrix.noxenv }}
63-
69+ - name : Save linkcheck baseline
70+ if : always() && matrix.noxenv == 'linkcheck' && github.event_name == 'push' && github.ref == 'refs/heads/main'
71+ uses : actions/cache/save@v4
72+ with :
73+ path : build/output.json
74+ key : linkcheck-baseline-${{ github.sha }}
6475
6576 check :
6677 # This job does nothing and is only used for the branch protection
Original file line number Diff line number Diff line change 11# -- Project information ---------------------------------------------------------------
22# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
33
4+ import json
45import os
56import pathlib
7+ import re
68import sys
79
810_ROOT = pathlib .Path (__file__ ).resolve ().parent .parent
165167 # Temporarily ignored due to expired TLS cert.
166168 r"https://kivy.org/.*" ,
167169]
170+ if (
171+ os .getenv ("GITHUB_ACTIONS" ) == "true"
172+ and os .getenv ("GITHUB_EVENT_NAME" ) in {"pull_request" , "merge_group" }
173+ and (baseline := pathlib .Path ("build/output.json" )).exists ()
174+ ):
175+ with baseline .open () as f :
176+ linkcheck_ignore .extend (
177+ re .escape (json .loads (line )["uri" ])
178+ for line in f
179+ )
168180linkcheck_retries = 2
169181linkcheck_timeout = 30
170182# Ignore anchors for common targets when we know they likely won't be found
You can’t perform that action at this time.
0 commit comments