Skip to content

Commit d6ec7d6

Browse files
authored
ENH: use lychee for linkchecking (#349)
* ENH: use lychee for linkchecking * see if directory needs / * parse the whole repo * add inputs to args * TST: open an issue * fix syntax issue in yml * fix typo for machine * enable reporting of errors as an issue * enable html parsing from the cache * lychee on the live site + schedule
1 parent 2bfbcad commit d6ec7d6

File tree

2 files changed

+21
-35
lines changed

2 files changed

+21
-35
lines changed

.github/workflows/linkcheck.yml

Lines changed: 20 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,30 @@
11
name: Link Checker [Anaconda, Linux]
22
on:
3-
pull_request:
4-
types: [opened, reopened]
53
schedule:
6-
# UTC 12:00 is early morning in Australia
7-
- cron: '0 12 * * *'
4+
# UTC 23:00 is early morning in Australia (9am)
5+
- cron: '0 23 * * *'
86
jobs:
9-
execution-tests-linux:
10-
name: Execution Tests (${{ matrix.python-version }}, ${{ matrix.os }})
11-
runs-on: ${{ matrix.os }}
12-
strategy:
13-
fail-fast: false
14-
matrix:
15-
os: ["ubuntu-latest"]
16-
python-version: ["3.12"]
7+
link-checking:
8+
name: Link Checking
9+
runs-on: "ubuntu-latest"
10+
permissions:
11+
issues: write # required for peter-evans/create-issue-from-file
1712
steps:
13+
# Checkout the live site (html)
1814
- name: Checkout
1915
uses: actions/checkout@v4
20-
- name: Setup Anaconda
21-
uses: conda-incubator/setup-miniconda@v3
2216
with:
23-
auto-update-conda: true
24-
auto-activate-base: true
25-
miniconda-version: 'latest'
26-
python-version: "3.12"
27-
environment-file: environment.yml
28-
activate-environment: quantecon
29-
- name: Download "build" folder (cache)
30-
uses: dawidd6/action-download-artifact@v10
31-
with:
32-
workflow: cache.yml
33-
branch: main
34-
name: build-cache
35-
path: _build
17+
ref: gh-pages
3618
- name: Link Checker
37-
shell: bash -l {0}
38-
run: jb build lectures --path-output=./ --builder=custom --custom-builder=linkcheck
39-
- name: Upload Link Checker Reports
40-
uses: actions/upload-artifact@v4
41-
if: failure()
19+
id: lychee
20+
uses: lycheeverse/lychee-action@v2
21+
with:
22+
fail: false
23+
args: --accept 403 .
24+
- name: Create Issue From File
25+
if: steps.lychee.outputs.exit_code != 0
26+
uses: peter-evans/create-issue-from-file@v5
4227
with:
43-
name: linkcheck-reports
44-
path: _build/linkcheck
28+
title: Link Checker Report
29+
content-filepath: ./lychee/out.md
30+
labels: report, automated issue, linkchecker

lectures/_config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ execute:
88
timeout: 600 # 10 minutes
99

1010
html:
11-
baseurl: https://python.quantecon.org/
11+
baseurl: https://python-programming.quantecon.org/
1212

1313
latex:
1414
latex_documents:

0 commit comments

Comments
 (0)