Skip to content

Commit 72daaec

Browse files
authored
Feature dtcenter/METplus#3247 link check (#427)
* Per METplus#3247, adding automated link checking in conjunction with new repo dtcenter/metplus-action-linkcheck * Resolving error * Per METplus#3247, add workflow dispatch to the linkcheck PR workflow too * Per METplus#3247, combine workflows into one file * Per METplus#3247, added upload-artifact * Per METplus#3247, modified name and checkout version. * Unrelated to this PR but updating to resolve deprecated version. * Unrelated to this PR but updating to resolve deprecated version. * Unrelated to this PR but updating to resolve deprecated version. * Modifying workflow to resolve extension error * Removing main.yaml as a test to resolve a documentation build error. * Fixing spacing
1 parent 1381832 commit 72daaec

5 files changed

Lines changed: 44 additions & 46 deletions

File tree

.github/workflows/benchmark_pandas3x.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ jobs:
7979
echo "Finished benchmark for pandas 2.2"
8080
8181
# - name: Archive benchmark results
82-
# uses: actions/upload-artifact@v4
82+
# uses: actions/upload-artifact@v7
8383
# with:
8484
# name: benchmark-report
8585
# path: /home/runner/work/METdataio/METdatio/METreformat/test/**

.github/workflows/documentation.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,16 @@ jobs:
2525
- name: Install dependencies
2626
run: |
2727
python -m pip install --upgrade python-dateutil requests sphinx \
28-
sphinx-gallery Pillow sphinx_rtd_theme sphinx-design
28+
sphinx-gallery Pillow sphinx_rtd_theme sphinx-panels
2929
python -m pip install -r docs/requirements.txt
3030
- name: Build docs
3131
run: ./.github/jobs/build_documentation.sh
32-
- uses: actions/upload-artifact@v4
32+
- uses: actions/upload-artifact@v7
3333
if: always()
3434
with:
3535
name: documentation
3636
path: artifact/documentation
37-
- uses: actions/upload-artifact@v4
37+
- uses: actions/upload-artifact@v7
3838
if: failure()
3939
with:
4040
name: documentation_warnings.log

.github/workflows/linkcheck.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Linkcheck
2+
on:
3+
schedule:
4+
- cron: '0 6 * * 1'
5+
pull_request:
6+
paths:
7+
- 'docs/**'
8+
workflow_dispatch: {}
9+
10+
jobs:
11+
linkcheck:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v6
15+
- uses: dtcenter/metplus-action-linkcheck@v1
16+
with:
17+
fail-on-broken-links: 'true'
18+
upload-artifact: 'true'
19+
install-package: 'true'

.github/workflows/main.yaml

Lines changed: 0 additions & 42 deletions
This file was deleted.

docs/conf.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,27 @@
7878
'figure': 'Figure %s',
7979
}
8080

81+
# -- linkcheck builder configuration ----------------------------------
82+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-the-linkcheck-builder
83+
84+
linkcheck_timeout = 10
85+
linkcheck_retries = 2
86+
linkcheck_workers = 8
87+
88+
linkcheck_ignore = [
89+
# add regex patterns for URLs that should be skipped, e.g.:
90+
# r'https://dtcenter\.org/.*', # if this site blocks automated requests
91+
# r'https://dev\.mysql\.com/doc/.*', # occasionally slow/rate-limited, not actually broken
92+
# r'https://.*\.rap\.ucar\.edu/.*', # internal DTC/NCAR-network resources unreachable from CI runners
93+
]
94+
95+
linkcheck_allowed_redirects = {
96+
# map of regex -> regex for redirects that are fine to follow
97+
}
98+
99+
linkcheck_anchors = True
100+
linkcheck_anchors_ignore = ['^!']
101+
81102
# -- Export variables --------------------------------------------------------
82103

83104
rst_epilog = """

0 commit comments

Comments
 (0)