From 763bdbe3f7f18928f6555ff2fccc999675ca6469 Mon Sep 17 00:00:00 2001 From: mmcky Date: Thu, 5 Jun 2025 16:02:40 +1000 Subject: [PATCH 01/10] ENH: use lychee for linkchecking --- .github/workflows/linkcheck.yml | 52 ++++++++++++++++++--------------- 1 file changed, 29 insertions(+), 23 deletions(-) diff --git a/.github/workflows/linkcheck.yml b/.github/workflows/linkcheck.yml index 3d22241d..90cd9df6 100644 --- a/.github/workflows/linkcheck.yml +++ b/.github/workflows/linkcheck.yml @@ -17,28 +17,34 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - - name: Setup Anaconda - uses: conda-incubator/setup-miniconda@v3 - with: - auto-update-conda: true - auto-activate-base: true - miniconda-version: 'latest' - python-version: "3.12" - environment-file: environment.yml - activate-environment: quantecon - - name: Download "build" folder (cache) - uses: dawidd6/action-download-artifact@v10 - with: - workflow: cache.yml - branch: main - name: build-cache - path: _build - name: Link Checker - shell: bash -l {0} - run: jb build lectures --path-output=./ --builder=custom --custom-builder=linkcheck - - name: Upload Link Checker Reports - uses: actions/upload-artifact@v4 - if: failure() + id: lychee + uses: lycheeverse/lychee-action@v2 with: - name: linkcheck-reports - path: _build/linkcheck \ No newline at end of file + args: --accept 403 + workingDirectory: lectures + # - name: Setup Anaconda + # uses: conda-incubator/setup-miniconda@v3 + # with: + # auto-update-conda: true + # auto-activate-base: true + # miniconda-version: 'latest' + # python-version: "3.12" + # environment-file: environment.yml + # activate-environment: quantecon + # - name: Download "build" folder (cache) + # uses: dawidd6/action-download-artifact@v10 + # with: + # workflow: cache.yml + # branch: main + # name: build-cache + # path: _build + # - name: Link Checker + # shell: bash -l {0} + # run: jb build lectures --path-output=./ --builder=custom --custom-builder=linkcheck + # - name: Upload Link Checker Reports + # uses: actions/upload-artifact@v4 + # if: failure() + # with: + # name: linkcheck-reports + # path: _build/linkcheck \ No newline at end of file From 4cd108b88ba9e81da87f31c9b2e0835480c7ad28 Mon Sep 17 00:00:00 2001 From: mmcky Date: Thu, 5 Jun 2025 16:13:00 +1000 Subject: [PATCH 02/10] see if directory needs / --- .github/workflows/linkcheck.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linkcheck.yml b/.github/workflows/linkcheck.yml index 90cd9df6..98d41b62 100644 --- a/.github/workflows/linkcheck.yml +++ b/.github/workflows/linkcheck.yml @@ -22,7 +22,7 @@ jobs: uses: lycheeverse/lychee-action@v2 with: args: --accept 403 - workingDirectory: lectures + workingDirectory: lectures/ # - name: Setup Anaconda # uses: conda-incubator/setup-miniconda@v3 # with: From 3b368c751087fb951db3d242faac5857601386c8 Mon Sep 17 00:00:00 2001 From: mmcky Date: Thu, 5 Jun 2025 16:17:22 +1000 Subject: [PATCH 03/10] parse the whole repo --- .github/workflows/linkcheck.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/linkcheck.yml b/.github/workflows/linkcheck.yml index 98d41b62..d321ee48 100644 --- a/.github/workflows/linkcheck.yml +++ b/.github/workflows/linkcheck.yml @@ -22,7 +22,6 @@ jobs: uses: lycheeverse/lychee-action@v2 with: args: --accept 403 - workingDirectory: lectures/ # - name: Setup Anaconda # uses: conda-incubator/setup-miniconda@v3 # with: From 90e35e1c822476e4570b5f037dbfa2caeba5e842 Mon Sep 17 00:00:00 2001 From: mmcky Date: Thu, 5 Jun 2025 16:19:58 +1000 Subject: [PATCH 04/10] add inputs to args --- .github/workflows/linkcheck.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linkcheck.yml b/.github/workflows/linkcheck.yml index d321ee48..8411f3ba 100644 --- a/.github/workflows/linkcheck.yml +++ b/.github/workflows/linkcheck.yml @@ -21,7 +21,7 @@ jobs: id: lychee uses: lycheeverse/lychee-action@v2 with: - args: --accept 403 + args: --accept 403 lectures/*.md # - name: Setup Anaconda # uses: conda-incubator/setup-miniconda@v3 # with: From 08b8209ce908badc3577831da1de7ec65ed408fa Mon Sep 17 00:00:00 2001 From: mmcky Date: Thu, 5 Jun 2025 16:30:19 +1000 Subject: [PATCH 05/10] TST: open an issue --- .github/workflows/linkcheck.yml | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/workflows/linkcheck.yml b/.github/workflows/linkcheck.yml index 8411f3ba..426ddb13 100644 --- a/.github/workflows/linkcheck.yml +++ b/.github/workflows/linkcheck.yml @@ -6,14 +6,11 @@ on: # UTC 12:00 is early morning in Australia - cron: '0 12 * * *' jobs: - execution-tests-linux: - name: Execution Tests (${{ matrix.python-version }}, ${{ matrix.os }}) - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: ["ubuntu-latest"] - python-version: ["3.12"] + link-checking: + name: Link Checking + runs-on: "ubunut-latest" + permissions: + issues: write # required for peter-evans/create-issue-from-file steps: - name: Checkout uses: actions/checkout@v4 @@ -22,6 +19,13 @@ jobs: uses: lycheeverse/lychee-action@v2 with: args: --accept 403 lectures/*.md + - name: Create Issue From File + if: steps.lychee.outputs.exit_code != 0 + uses: peter-evans/create-issue-from-file@v5 + with: + title: Link Checker Report + content-filepath: ./lychee/out.md + labels: report, automated issue # - name: Setup Anaconda # uses: conda-incubator/setup-miniconda@v3 # with: From 37e1f965a71af7f0fd8a66ba4e9f2ce7e7e14d08 Mon Sep 17 00:00:00 2001 From: mmcky Date: Fri, 6 Jun 2025 08:53:33 +1000 Subject: [PATCH 06/10] fix syntax issue in yml --- .github/workflows/linkcheck.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linkcheck.yml b/.github/workflows/linkcheck.yml index 426ddb13..1d52d9b5 100644 --- a/.github/workflows/linkcheck.yml +++ b/.github/workflows/linkcheck.yml @@ -10,7 +10,7 @@ jobs: name: Link Checking runs-on: "ubunut-latest" permissions: - issues: write # required for peter-evans/create-issue-from-file + issues: write # required for peter-evans/create-issue-from-file steps: - name: Checkout uses: actions/checkout@v4 From 19aff56724179b42def168b8191ef5c81dd2aea4 Mon Sep 17 00:00:00 2001 From: mmcky Date: Fri, 6 Jun 2025 09:20:00 +1000 Subject: [PATCH 07/10] fix typo for machine --- .github/workflows/linkcheck.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linkcheck.yml b/.github/workflows/linkcheck.yml index 1d52d9b5..354a86d9 100644 --- a/.github/workflows/linkcheck.yml +++ b/.github/workflows/linkcheck.yml @@ -8,7 +8,7 @@ on: jobs: link-checking: name: Link Checking - runs-on: "ubunut-latest" + runs-on: "ubuntu-latest" permissions: issues: write # required for peter-evans/create-issue-from-file steps: From 95f16f99e027641618feb08c5779f307bb965a73 Mon Sep 17 00:00:00 2001 From: mmcky Date: Fri, 6 Jun 2025 09:22:43 +1000 Subject: [PATCH 08/10] enable reporting of errors as an issue --- .github/workflows/linkcheck.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/linkcheck.yml b/.github/workflows/linkcheck.yml index 354a86d9..81162a58 100644 --- a/.github/workflows/linkcheck.yml +++ b/.github/workflows/linkcheck.yml @@ -18,6 +18,7 @@ jobs: id: lychee uses: lycheeverse/lychee-action@v2 with: + fail: false args: --accept 403 lectures/*.md - name: Create Issue From File if: steps.lychee.outputs.exit_code != 0 From 597ac23ba527bb1972e1dfb6314df1c4aebf5efa Mon Sep 17 00:00:00 2001 From: mmcky Date: Fri, 6 Jun 2025 12:24:02 +1000 Subject: [PATCH 09/10] enable html parsing from the cache --- .github/workflows/linkcheck.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/linkcheck.yml b/.github/workflows/linkcheck.yml index 81162a58..aba243f8 100644 --- a/.github/workflows/linkcheck.yml +++ b/.github/workflows/linkcheck.yml @@ -14,6 +14,13 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 + - name: Download "build" folder (cache) + uses: dawidd6/action-download-artifact@v10 + with: + workflow: cache.yml + branch: main + name: build-cache + path: _build - name: Link Checker id: lychee uses: lycheeverse/lychee-action@v2 From e0332a68cef324c7d3dfd6cca4d3539bcb8f68ec Mon Sep 17 00:00:00 2001 From: mmcky Date: Fri, 6 Jun 2025 14:57:36 +1000 Subject: [PATCH 10/10] lychee on the live site + schedule --- .github/workflows/linkcheck.yml | 43 +++++---------------------------- lectures/_config.yml | 2 +- 2 files changed, 7 insertions(+), 38 deletions(-) diff --git a/.github/workflows/linkcheck.yml b/.github/workflows/linkcheck.yml index aba243f8..4f0e5875 100644 --- a/.github/workflows/linkcheck.yml +++ b/.github/workflows/linkcheck.yml @@ -1,10 +1,8 @@ name: Link Checker [Anaconda, Linux] on: - pull_request: - types: [opened, reopened] schedule: - # UTC 12:00 is early morning in Australia - - cron: '0 12 * * *' + # UTC 23:00 is early morning in Australia (9am) + - cron: '0 23 * * *' jobs: link-checking: name: Link Checking @@ -12,50 +10,21 @@ jobs: permissions: issues: write # required for peter-evans/create-issue-from-file steps: + # Checkout the live site (html) - name: Checkout uses: actions/checkout@v4 - - name: Download "build" folder (cache) - uses: dawidd6/action-download-artifact@v10 with: - workflow: cache.yml - branch: main - name: build-cache - path: _build + ref: gh-pages - name: Link Checker id: lychee uses: lycheeverse/lychee-action@v2 with: fail: false - args: --accept 403 lectures/*.md + args: --accept 403 . - name: Create Issue From File if: steps.lychee.outputs.exit_code != 0 uses: peter-evans/create-issue-from-file@v5 with: title: Link Checker Report content-filepath: ./lychee/out.md - labels: report, automated issue - # - name: Setup Anaconda - # uses: conda-incubator/setup-miniconda@v3 - # with: - # auto-update-conda: true - # auto-activate-base: true - # miniconda-version: 'latest' - # python-version: "3.12" - # environment-file: environment.yml - # activate-environment: quantecon - # - name: Download "build" folder (cache) - # uses: dawidd6/action-download-artifact@v10 - # with: - # workflow: cache.yml - # branch: main - # name: build-cache - # path: _build - # - name: Link Checker - # shell: bash -l {0} - # run: jb build lectures --path-output=./ --builder=custom --custom-builder=linkcheck - # - name: Upload Link Checker Reports - # uses: actions/upload-artifact@v4 - # if: failure() - # with: - # name: linkcheck-reports - # path: _build/linkcheck \ No newline at end of file + labels: report, automated issue, linkchecker \ No newline at end of file diff --git a/lectures/_config.yml b/lectures/_config.yml index 78ea39d0..2d1223df 100644 --- a/lectures/_config.yml +++ b/lectures/_config.yml @@ -8,7 +8,7 @@ execute: timeout: 600 # 10 minutes html: - baseurl: https://python.quantecon.org/ + baseurl: https://python-programming.quantecon.org/ latex: latex_documents: