From 19667b86d38d1e6b76162a80557ef3b25745c49f Mon Sep 17 00:00:00 2001 From: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com> Date: Mon, 27 Feb 2023 00:08:47 +0530 Subject: [PATCH 01/27] add lychee workflow --- .github/workflows/lychee_url_checker.yml | 28 ++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/lychee_url_checker.yml diff --git a/.github/workflows/lychee_url_checker.yml b/.github/workflows/lychee_url_checker.yml new file mode 100644 index 0000000000..90e9985412 --- /dev/null +++ b/.github/workflows/lychee_url_checker.yml @@ -0,0 +1,28 @@ +name: Check URLs with Lychee + +on: + push: + pull_request: + schedule: + # Run everyday at 3 am UTC + - cron: 0 3 * * * + +jobs: + linkChecker: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Lychee URL checker + # use stable version for now to avoid breaking changes + uses: lycheeverse/lychee-action@v1 + with: + fail: true + # env: + # to be used in case rate limits are surpassed + # GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + args: --no-progress + --exclude-path CHANGELOG.md + --exclude http://127.0.0.1 + --timeout 10 + --max-retries 5 \ No newline at end of file From 8e93d0d27542df8aaf38ce36aa0690a2e4d832a5 Mon Sep 17 00:00:00 2001 From: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com> Date: Mon, 27 Feb 2023 19:45:08 +0530 Subject: [PATCH 02/27] pin version with sha-256 hash for stable v1.6.1 --- .github/workflows/lychee_url_checker.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/lychee_url_checker.yml b/.github/workflows/lychee_url_checker.yml index 90e9985412..2b04221d93 100644 --- a/.github/workflows/lychee_url_checker.yml +++ b/.github/workflows/lychee_url_checker.yml @@ -15,7 +15,8 @@ jobs: - name: Lychee URL checker # use stable version for now to avoid breaking changes - uses: lycheeverse/lychee-action@v1 + # sha-256 hash of latest stable version for security reasons + uses: lycheeverse/lychee-action@d322e38893906cef8788eefe9c63694c562c7dfa with: fail: true # env: From 457f30e090093de32eceee90bd292b220d6670b0 Mon Sep 17 00:00:00 2001 From: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com> Date: Mon, 27 Feb 2023 19:49:57 +0530 Subject: [PATCH 03/27] add config file --- .github/workflows/lychee_url_checker.yml | 1 - lychee.toml | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 lychee.toml diff --git a/.github/workflows/lychee_url_checker.yml b/.github/workflows/lychee_url_checker.yml index 2b04221d93..990a91df37 100644 --- a/.github/workflows/lychee_url_checker.yml +++ b/.github/workflows/lychee_url_checker.yml @@ -23,7 +23,6 @@ jobs: # to be used in case rate limits are surpassed # GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} args: --no-progress - --exclude-path CHANGELOG.md --exclude http://127.0.0.1 --timeout 10 --max-retries 5 \ No newline at end of file diff --git a/lychee.toml b/lychee.toml new file mode 100644 index 0000000000..56ea55becd --- /dev/null +++ b/lychee.toml @@ -0,0 +1 @@ +exclude_path = [./CHANGELOG.md] \ No newline at end of file From 68cf5fda675e1454d5d90e8d79cf0d1a6c30312d Mon Sep 17 00:00:00 2001 From: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com> Date: Mon, 27 Feb 2023 20:24:46 +0530 Subject: [PATCH 04/27] add file formats to be checked --- .github/workflows/lychee_url_checker.yml | 7 +++---- lychee.toml | 1 - 2 files changed, 3 insertions(+), 5 deletions(-) delete mode 100644 lychee.toml diff --git a/.github/workflows/lychee_url_checker.yml b/.github/workflows/lychee_url_checker.yml index 990a91df37..191746d317 100644 --- a/.github/workflows/lychee_url_checker.yml +++ b/.github/workflows/lychee_url_checker.yml @@ -18,11 +18,10 @@ jobs: # sha-256 hash of latest stable version for security reasons uses: lycheeverse/lychee-action@d322e38893906cef8788eefe9c63694c562c7dfa with: + # fail the action on broken links fail: true # env: # to be used in case rate limits are surpassed # GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} - args: --no-progress - --exclude http://127.0.0.1 - --timeout 10 - --max-retries 5 \ No newline at end of file + # arguments with file types to check + args: --no-progress './**/*.rst' './**/*.md' './**/*.py' './**/*.ipynb' --timeout 10 --max-retries 5 \ No newline at end of file diff --git a/lychee.toml b/lychee.toml deleted file mode 100644 index 56ea55becd..0000000000 --- a/lychee.toml +++ /dev/null @@ -1 +0,0 @@ -exclude_path = [./CHANGELOG.md] \ No newline at end of file From 333d1e82f9caa78d5ca5887b9814aa429a28de71 Mon Sep 17 00:00:00 2001 From: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com> Date: Mon, 27 Feb 2023 20:29:29 +0530 Subject: [PATCH 05/27] use github API token because of timeouts --- .github/workflows/lychee_url_checker.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lychee_url_checker.yml b/.github/workflows/lychee_url_checker.yml index 191746d317..9abc88feb2 100644 --- a/.github/workflows/lychee_url_checker.yml +++ b/.github/workflows/lychee_url_checker.yml @@ -20,8 +20,8 @@ jobs: with: # fail the action on broken links fail: true - # env: + env: # to be used in case rate limits are surpassed - # GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} # arguments with file types to check args: --no-progress './**/*.rst' './**/*.md' './**/*.py' './**/*.ipynb' --timeout 10 --max-retries 5 \ No newline at end of file From 3dfb9c0a2a562cbcb377bbc3d538784c1dda8241 Mon Sep 17 00:00:00 2001 From: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com> Date: Mon, 27 Feb 2023 20:36:34 +0530 Subject: [PATCH 06/27] oops, fix formatting error --- .github/workflows/lychee_url_checker.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/lychee_url_checker.yml b/.github/workflows/lychee_url_checker.yml index 9abc88feb2..8e1d9352a8 100644 --- a/.github/workflows/lychee_url_checker.yml +++ b/.github/workflows/lychee_url_checker.yml @@ -20,8 +20,8 @@ jobs: with: # fail the action on broken links fail: true - env: - # to be used in case rate limits are surpassed - GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + env: + # to be used in case rate limits are surpassed + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} # arguments with file types to check args: --no-progress './**/*.rst' './**/*.md' './**/*.py' './**/*.ipynb' --timeout 10 --max-retries 5 \ No newline at end of file From 9d8c889d0b9aff4d294215e8982c701f4fad326d Mon Sep 17 00:00:00 2001 From: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com> Date: Mon, 27 Feb 2023 23:31:10 +0530 Subject: [PATCH 07/27] pin version and add cache job --- .github/workflows/lychee_url_checker.yml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/lychee_url_checker.yml b/.github/workflows/lychee_url_checker.yml index 8e1d9352a8..89f48d17be 100644 --- a/.github/workflows/lychee_url_checker.yml +++ b/.github/workflows/lychee_url_checker.yml @@ -11,12 +11,20 @@ jobs: linkChecker: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + + # cache Lychee results to avoid hitting rate limits + - name: Restore lychee cache + - uses: actions/cache@v3 + with: + path: .lycheecache + key: cache-lychee-${{ github.sha }} + restore-keys: cache-lychee- + # check URLs - name: Lychee URL checker + - uses: actions/checkout@v3 # use stable version for now to avoid breaking changes - # sha-256 hash of latest stable version for security reasons - uses: lycheeverse/lychee-action@d322e38893906cef8788eefe9c63694c562c7dfa + uses: lycheeverse/lychee-action@v1.6.1 with: # fail the action on broken links fail: true @@ -24,4 +32,4 @@ jobs: # to be used in case rate limits are surpassed GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} # arguments with file types to check - args: --no-progress './**/*.rst' './**/*.md' './**/*.py' './**/*.ipynb' --timeout 10 --max-retries 5 \ No newline at end of file + args: --no-progress './**/*.rst' './**/*.md' './**/*.py' './**/*.ipynb' --timeout 10 --max-retries 5 From 4c1d2ccd5b8c7686b8d4691d748ac25fb7b83fad Mon Sep 17 00:00:00 2001 From: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com> Date: Mon, 27 Feb 2023 23:50:29 +0530 Subject: [PATCH 08/27] fix formatting --- .github/workflows/lychee_url_checker.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/lychee_url_checker.yml b/.github/workflows/lychee_url_checker.yml index 89f48d17be..e1eb670565 100644 --- a/.github/workflows/lychee_url_checker.yml +++ b/.github/workflows/lychee_url_checker.yml @@ -11,14 +11,14 @@ jobs: linkChecker: runs-on: ubuntu-latest steps: - + # cache Lychee results to avoid hitting rate limits - name: Restore lychee cache - uses: actions/cache@v3 - with: - path: .lycheecache - key: cache-lychee-${{ github.sha }} - restore-keys: cache-lychee- + with: + path: .lycheecache + key: cache-lychee-${{ github.sha }} + restore-keys: cache-lychee- # check URLs - name: Lychee URL checker From b904f3087cf54632f4f58e22c68bd484cdf52a5b Mon Sep 17 00:00:00 2001 From: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com> Date: Mon, 27 Feb 2023 23:56:42 +0530 Subject: [PATCH 09/27] fix formatting again --- .github/workflows/lychee_url_checker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lychee_url_checker.yml b/.github/workflows/lychee_url_checker.yml index e1eb670565..0b9c013c89 100644 --- a/.github/workflows/lychee_url_checker.yml +++ b/.github/workflows/lychee_url_checker.yml @@ -14,7 +14,7 @@ jobs: # cache Lychee results to avoid hitting rate limits - name: Restore lychee cache - - uses: actions/cache@v3 + uses: actions/cache@v3 with: path: .lycheecache key: cache-lychee-${{ github.sha }} From c396db5cf8dc962443737883695cb812afd71ce1 Mon Sep 17 00:00:00 2001 From: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com> Date: Tue, 28 Feb 2023 00:05:11 +0530 Subject: [PATCH 10/27] reorder jobs schema, should fix run --- .github/workflows/lychee_url_checker.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lychee_url_checker.yml b/.github/workflows/lychee_url_checker.yml index 0b9c013c89..2b4b02fd8f 100644 --- a/.github/workflows/lychee_url_checker.yml +++ b/.github/workflows/lychee_url_checker.yml @@ -20,9 +20,9 @@ jobs: key: cache-lychee-${{ github.sha }} restore-keys: cache-lychee- - # check URLs - - name: Lychee URL checker + # check URLs with Lychee - uses: actions/checkout@v3 + - name: Lychee URL checker # use stable version for now to avoid breaking changes uses: lycheeverse/lychee-action@v1.6.1 with: From 51745b31d8fe59a97041c68a43d1ee9e74e40452 Mon Sep 17 00:00:00 2001 From: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com> Date: Sat, 4 Mar 2023 23:37:55 +0530 Subject: [PATCH 11/27] exclude changelog from being checked --- .github/workflows/lychee_url_checker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lychee_url_checker.yml b/.github/workflows/lychee_url_checker.yml index 2b4b02fd8f..6320981c9f 100644 --- a/.github/workflows/lychee_url_checker.yml +++ b/.github/workflows/lychee_url_checker.yml @@ -32,4 +32,4 @@ jobs: # to be used in case rate limits are surpassed GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} # arguments with file types to check - args: --no-progress './**/*.rst' './**/*.md' './**/*.py' './**/*.ipynb' --timeout 10 --max-retries 5 + args: --no-progress './**/*.rst' './**/*.md' './**/*.py' './**/*.ipynb' --timeout 10 --max-retries 5 --skip-missing --exclude-path CHANGELOG.md From 0cfb2b302844a99367dcfe47653229c877122e3a Mon Sep 17 00:00:00 2001 From: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com> Date: Sat, 4 Mar 2023 23:41:23 +0530 Subject: [PATCH 12/27] and delete old URL checker workflow --- .github/workflows/url_checker.yml | 34 ------------------------------- 1 file changed, 34 deletions(-) delete mode 100644 .github/workflows/url_checker.yml diff --git a/.github/workflows/url_checker.yml b/.github/workflows/url_checker.yml deleted file mode 100644 index 88ff52b470..0000000000 --- a/.github/workflows/url_checker.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: Check URLs - -on: - push: - schedule: - # Run everyday at 3 am UTC - - cron: 0 3 * * * - -jobs: - urlchecks: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - - name: URLs-checker - uses: urlstechie/urlchecker-action@master - with: - # A comma-separated list of file types to cover in the URL checks - file_types: .rst,.md,.py,.ipynb - - # Choose whether to include file with no URLs in the prints. - print_all: false - - # Timeout in 10 seconds if url is not reached - timeout: 10 - - # How many times to retry a failed request (each is logged, defaults to 1) - retry_count: 5 - - # A comma separated patterns to exclude during URL checks - exclude_patterns: https://www.datacamp.com/community/tutorials/fuzzy-string-python,http://127.0.0.1,https://github.com/pybamm-team/PyBaMM/tree/v,https::/doi.org,https::/www.sciencedirect.com - - # A comma separated list of file patterns (direct paths work as well) to exclude - exclude_files: CHANGELOG.md From e782c3e20122d68a49284b64803a45b97e6e3ca4 Mon Sep 17 00:00:00 2001 From: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com> Date: Sun, 5 Mar 2023 12:35:42 +0530 Subject: [PATCH 13/27] fix cache --- .github/workflows/lychee_url_checker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lychee_url_checker.yml b/.github/workflows/lychee_url_checker.yml index 6320981c9f..caeb1a2e2f 100644 --- a/.github/workflows/lychee_url_checker.yml +++ b/.github/workflows/lychee_url_checker.yml @@ -32,4 +32,4 @@ jobs: # to be used in case rate limits are surpassed GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} # arguments with file types to check - args: --no-progress './**/*.rst' './**/*.md' './**/*.py' './**/*.ipynb' --timeout 10 --max-retries 5 --skip-missing --exclude-path CHANGELOG.md + args: --no-progress --cache --max-cache-age 2d './**/*.rst' './**/*.md' './**/*.py' './**/*.ipynb' --timeout 10 --max-retries 5 --skip-missing --exclude-path CHANGELOG.md From 9cb4909c4a6da05a751278918b57f0c38c4ba704 Mon Sep 17 00:00:00 2001 From: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com> Date: Sun, 5 Mar 2023 23:01:52 +0530 Subject: [PATCH 14/27] reduce max concurrency from 128 to 32 --- .github/workflows/lychee_url_checker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lychee_url_checker.yml b/.github/workflows/lychee_url_checker.yml index caeb1a2e2f..50f002b3f4 100644 --- a/.github/workflows/lychee_url_checker.yml +++ b/.github/workflows/lychee_url_checker.yml @@ -32,4 +32,4 @@ jobs: # to be used in case rate limits are surpassed GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} # arguments with file types to check - args: --no-progress --cache --max-cache-age 2d './**/*.rst' './**/*.md' './**/*.py' './**/*.ipynb' --timeout 10 --max-retries 5 --skip-missing --exclude-path CHANGELOG.md + args: --no-progress --cache --max-cache-age 2d './**/*.rst' './**/*.md' './**/*.py' './**/*.ipynb' --timeout 10 --max-retries 5 --skip-missing --exclude-path CHANGELOG.md --max-concurrency 32 From a366d9a2b3bef100f47fa3e03a5585dc7512fee1 Mon Sep 17 00:00:00 2001 From: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com> Date: Sun, 5 Mar 2023 23:10:04 +0530 Subject: [PATCH 15/27] accept status code 429 with max concurrency 128 --- .github/workflows/lychee_url_checker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lychee_url_checker.yml b/.github/workflows/lychee_url_checker.yml index 50f002b3f4..9afadbdda1 100644 --- a/.github/workflows/lychee_url_checker.yml +++ b/.github/workflows/lychee_url_checker.yml @@ -32,4 +32,4 @@ jobs: # to be used in case rate limits are surpassed GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} # arguments with file types to check - args: --no-progress --cache --max-cache-age 2d './**/*.rst' './**/*.md' './**/*.py' './**/*.ipynb' --timeout 10 --max-retries 5 --skip-missing --exclude-path CHANGELOG.md --max-concurrency 32 + args: --no-progress --cache --max-cache-age 2d './**/*.rst' './**/*.md' './**/*.py' './**/*.ipynb' --timeout 10 --max-retries 5 --skip-missing --exclude-path ./CHANGELOG.md --accept 429 From 8ee9cbcf353f4545eb881371bf89368c52ecd613 Mon Sep 17 00:00:00 2001 From: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com> Date: Mon, 6 Mar 2023 00:32:51 +0530 Subject: [PATCH 16/27] accept both 200 and 429 --- .github/workflows/lychee_url_checker.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lychee_url_checker.yml b/.github/workflows/lychee_url_checker.yml index 9afadbdda1..03630870bd 100644 --- a/.github/workflows/lychee_url_checker.yml +++ b/.github/workflows/lychee_url_checker.yml @@ -5,7 +5,7 @@ on: pull_request: schedule: # Run everyday at 3 am UTC - - cron: 0 3 * * * + - cron: "0 3 * * *" jobs: linkChecker: @@ -32,4 +32,4 @@ jobs: # to be used in case rate limits are surpassed GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} # arguments with file types to check - args: --no-progress --cache --max-cache-age 2d './**/*.rst' './**/*.md' './**/*.py' './**/*.ipynb' --timeout 10 --max-retries 5 --skip-missing --exclude-path ./CHANGELOG.md --accept 429 + args: --no-progress --cache --max-cache-age 2d './**/*.rst' './**/*.md' './**/*.py' './**/*.ipynb' --timeout 10 --max-retries 5 --skip-missing --exclude-path ./CHANGELOG.md --accept 200,429 From fc86b7bc3a9b933a4b495b7df8e09a0771830075 Mon Sep 17 00:00:00 2001 From: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com> Date: Tue, 7 Mar 2023 14:23:28 +0530 Subject: [PATCH 17/27] retry accepting 200 and 429 Co-authored-by: Saransh Chopra --- .github/workflows/lychee_url_checker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lychee_url_checker.yml b/.github/workflows/lychee_url_checker.yml index 03630870bd..763bad89d9 100644 --- a/.github/workflows/lychee_url_checker.yml +++ b/.github/workflows/lychee_url_checker.yml @@ -32,4 +32,4 @@ jobs: # to be used in case rate limits are surpassed GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} # arguments with file types to check - args: --no-progress --cache --max-cache-age 2d './**/*.rst' './**/*.md' './**/*.py' './**/*.ipynb' --timeout 10 --max-retries 5 --skip-missing --exclude-path ./CHANGELOG.md --accept 200,429 + args: --no-progress --cache --max-cache-age 2d './**/*.rst' './**/*.md' './**/*.py' './**/*.ipynb' --timeout 10 --max-retries 5 --skip-missing --exclude-path ./CHANGELOG.md --accept "200,429" From af79897654369234524d59e089a2bee69f8dba11 Mon Sep 17 00:00:00 2001 From: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com> Date: Tue, 7 Mar 2023 14:37:58 +0530 Subject: [PATCH 18/27] fix accept status codes --- .github/workflows/lychee_url_checker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lychee_url_checker.yml b/.github/workflows/lychee_url_checker.yml index 763bad89d9..ed87446cba 100644 --- a/.github/workflows/lychee_url_checker.yml +++ b/.github/workflows/lychee_url_checker.yml @@ -32,4 +32,4 @@ jobs: # to be used in case rate limits are surpassed GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} # arguments with file types to check - args: --no-progress --cache --max-cache-age 2d './**/*.rst' './**/*.md' './**/*.py' './**/*.ipynb' --timeout 10 --max-retries 5 --skip-missing --exclude-path ./CHANGELOG.md --accept "200,429" + args: --no-progress --cache --max-cache-age 2d './**/*.rst' './**/*.md' './**/*.py' './**/*.ipynb' --timeout 10 --max-retries 5 --skip-missing --exclude-path ./CHANGELOG.md --accept [200,429] From d751e7b2f718de173f65893b5649e9155134a998 Mon Sep 17 00:00:00 2001 From: Matthias Endler Date: Tue, 7 Mar 2023 14:06:56 +0100 Subject: [PATCH 19/27] Move lychee args to correct position The args were inside the `env` block, causing all arguments to be ignored and the default arguments to be used instead since the very beginning. --- .github/workflows/lychee_url_checker.yml | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/.github/workflows/lychee_url_checker.yml b/.github/workflows/lychee_url_checker.yml index ed87446cba..37066f2e24 100644 --- a/.github/workflows/lychee_url_checker.yml +++ b/.github/workflows/lychee_url_checker.yml @@ -22,14 +22,27 @@ jobs: # check URLs with Lychee - uses: actions/checkout@v3 - - name: Lychee URL checker + # use stable version for now to avoid breaking changes + - name: Lychee URL checker uses: lycheeverse/lychee-action@v1.6.1 with: + # arguments with file types to check + args: >- + --cache + --no-progress + --max-cache-age 2d + --timeout 10 + --max-retries 5 + --skip-missing + --accept 200,429 + --exclude-path ./CHANGELOG.md + './**/*.rst' + './**/*.md' + './**/*.py' + './**/*.ipynb' # fail the action on broken links fail: true env: - # to be used in case rate limits are surpassed + # to be used in case rate limits are surpassed GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} - # arguments with file types to check - args: --no-progress --cache --max-cache-age 2d './**/*.rst' './**/*.md' './**/*.py' './**/*.ipynb' --timeout 10 --max-retries 5 --skip-missing --exclude-path ./CHANGELOG.md --accept [200,429] From 998dc1a227fdc5e637334ddf0c4ec67598d3cdf4 Mon Sep 17 00:00:00 2001 From: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com> Date: Tue, 7 Mar 2023 19:31:39 +0530 Subject: [PATCH 20/27] changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 019e6f4eca..f72586ffc6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,10 @@ - Fixed `plot_voltage_components` so that the sum of overpotentials is now equal to the voltage ([#2740](https://github.com/pybamm-team/PyBaMM/pull/2740)) +## Optimizations + +- Migrated to [Lychee](https://github.com/lycheeverse/lychee-action) workflow for checking URLs [#2734](https://github.com/pybamm-team/PyBaMM/pull/2734) + ## Breaking changes - Renamed "Measured open circuit voltage [V]" to "Surface open-circuit voltage [V]". This variable was calculated from surface particle concentrations, and hence "hid" the overpotential from particle gradients. The new variable "Open-circuit voltage [V]" is calculated from bulk particle concentrations instead. ([#2740](https://github.com/pybamm-team/PyBaMM/pull/2740)) From 8fcd5ff1cfc4d958d65ed2fe9b4226148b9e5d21 Mon Sep 17 00:00:00 2001 From: Saransh Chopra Date: Tue, 7 Mar 2023 20:42:15 +0530 Subject: [PATCH 21/27] trigger on push only on main and develop --- .github/workflows/lychee_url_checker.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/lychee_url_checker.yml b/.github/workflows/lychee_url_checker.yml index 37066f2e24..c8d07e5457 100644 --- a/.github/workflows/lychee_url_checker.yml +++ b/.github/workflows/lychee_url_checker.yml @@ -2,6 +2,9 @@ name: Check URLs with Lychee on: push: + branches: + - main + - develop pull_request: schedule: # Run everyday at 3 am UTC From e0f459aacf3af8a80db116e8f9042b4835055da7 Mon Sep 17 00:00:00 2001 From: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com> Date: Tue, 7 Mar 2023 22:01:48 +0530 Subject: [PATCH 22/27] exclude local links and pybamm twitter handle Co-authored-by: Saransh Chopra --- .github/workflows/lychee_url_checker.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/lychee_url_checker.yml b/.github/workflows/lychee_url_checker.yml index c8d07e5457..4996545cfc 100644 --- a/.github/workflows/lychee_url_checker.yml +++ b/.github/workflows/lychee_url_checker.yml @@ -38,6 +38,8 @@ jobs: --timeout 10 --max-retries 5 --skip-missing + --exclude-loopback + --exclude https://twitter.com/pybamm_ --accept 200,429 --exclude-path ./CHANGELOG.md './**/*.rst' From 8e88fb2e4575020ae3a36baa632524de33114174 Mon Sep 17 00:00:00 2001 From: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com> Date: Tue, 7 Mar 2023 23:42:54 +0530 Subject: [PATCH 23/27] fix links for license file and match ScienceDirect and DOI links with regex --- .github/workflows/lychee_url_checker.yml | 4 +++- CONTRIBUTING.md | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lychee_url_checker.yml b/.github/workflows/lychee_url_checker.yml index 4996545cfc..30c7774c6a 100644 --- a/.github/workflows/lychee_url_checker.yml +++ b/.github/workflows/lychee_url_checker.yml @@ -40,8 +40,10 @@ jobs: --skip-missing --exclude-loopback --exclude https://twitter.com/pybamm_ + --exclude https:\/\/doi\.org|www.sciencedirect.com\/* --accept 200,429 - --exclude-path ./CHANGELOG.md + --exclude-path ./CHANGELOG.md + --exclude-path scripts/update_version.py './**/*.rst' './**/*.md' './**/*.py' diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 330d296761..9431486d4e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -400,7 +400,7 @@ Editable notebooks are made available using [Google Colab](https://colab.researc GitHub does some magic with particular filenames. In particular: - The first page people see when they go to [our GitHub page](https://github.com/pybamm-team/PyBaMM) displays the contents of [README.md](README.md), which is written in the [Markdown](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet) format. Some guidelines can be found [here](https://help.github.com/articles/about-readmes/). -- The license for using PyBaMM is stored in [LICENSE](LICENSE), and [automatically](https://help.github.com/articles/adding-a-license-to-a-repository/) linked to by GitHub. +- The license for using PyBaMM is stored in [LICENSE](LICENSE.txt), and [automatically](https://help.github.com/articles/adding-a-license-to-a-repository/) linked to by GitHub. - This file, [CONTRIBUTING.md](CONTRIBUTING.md) is recognised as the contribution guidelines and a link is [automatically](https://github.com/blog/1184-contributing-guidelines) displayed when new issues or pull requests are created. ## Acknowledgements From 589a9c08972c7b045a2c1111c32b1729d685c5b4 Mon Sep 17 00:00:00 2001 From: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com> Date: Tue, 7 Mar 2023 23:48:25 +0530 Subject: [PATCH 24/27] Update lychee_url_checker.yml --- .github/workflows/lychee_url_checker.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/lychee_url_checker.yml b/.github/workflows/lychee_url_checker.yml index 30c7774c6a..a00ffa18ff 100644 --- a/.github/workflows/lychee_url_checker.yml +++ b/.github/workflows/lychee_url_checker.yml @@ -39,11 +39,9 @@ jobs: --max-retries 5 --skip-missing --exclude-loopback - --exclude https://twitter.com/pybamm_ - --exclude https:\/\/doi\.org|www.sciencedirect.com\/* + --exclude https://twitter.com/pybamm_, https:\/\/doi\.org|www.sciencedirect.com\/* --accept 200,429 - --exclude-path ./CHANGELOG.md - --exclude-path scripts/update_version.py + --exclude-path ./CHANGELOG.md, scripts/update_version.py './**/*.rst' './**/*.md' './**/*.py' From 2c97aae4cb4c1a59af2ce6b9daf9ea2e33f50303 Mon Sep 17 00:00:00 2001 From: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com> Date: Wed, 8 Mar 2023 00:09:48 +0530 Subject: [PATCH 25/27] fix regex --- .github/workflows/lychee_url_checker.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lychee_url_checker.yml b/.github/workflows/lychee_url_checker.yml index a00ffa18ff..d53797c80d 100644 --- a/.github/workflows/lychee_url_checker.yml +++ b/.github/workflows/lychee_url_checker.yml @@ -39,9 +39,11 @@ jobs: --max-retries 5 --skip-missing --exclude-loopback - --exclude https://twitter.com/pybamm_, https:\/\/doi\.org|www.sciencedirect.com\/* + --exclude https://twitter.com/pybamm_ + --exclude "https:\/\/doi\.org|www.sciencedirect\.com\/*" --accept 200,429 - --exclude-path ./CHANGELOG.md, scripts/update_version.py + --exclude-path ./CHANGELOG.md + --exclude-path ./scripts/update_version.py './**/*.rst' './**/*.md' './**/*.py' From fc1b7a36f130d4255c72af8c202152ba8294d013 Mon Sep 17 00:00:00 2001 From: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com> Date: Wed, 8 Mar 2023 00:19:04 +0530 Subject: [PATCH 26/27] remove escape characters --- .github/workflows/lychee_url_checker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lychee_url_checker.yml b/.github/workflows/lychee_url_checker.yml index d53797c80d..e99ba9c290 100644 --- a/.github/workflows/lychee_url_checker.yml +++ b/.github/workflows/lychee_url_checker.yml @@ -40,7 +40,7 @@ jobs: --skip-missing --exclude-loopback --exclude https://twitter.com/pybamm_ - --exclude "https:\/\/doi\.org|www.sciencedirect\.com\/*" + --exclude "https://doi\.org|www.sciencedirect\.com/*" --accept 200,429 --exclude-path ./CHANGELOG.md --exclude-path ./scripts/update_version.py From fb825921e1fc025e71609ae859c3b887a1590821 Mon Sep 17 00:00:00 2001 From: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com> Date: Wed, 8 Mar 2023 12:31:32 +0530 Subject: [PATCH 27/27] Create .lycheeignore --- .lycheeignore | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .lycheeignore diff --git a/.lycheeignore b/.lycheeignore new file mode 100644 index 0000000000..b95c44b763 --- /dev/null +++ b/.lycheeignore @@ -0,0 +1,17 @@ +# a list of links/files to be ignored by lychee link checker (see workflow file) + +# Errors in docs/source/user_guide/getting_started.md +file:///home/runner/work/PyBaMM/PyBaMM/docs/source/user_guide/api_docs + +# Errors in docs/source/user_guide/fundamentals/index.md +file:///home/runner/work/PyBaMM/PyBaMM/docs/source/user_guide/fundamentals/base_battery_model +file:///home/runner/work/PyBaMM/PyBaMM/docs/source/user_guide/fundamentals/parameter_sets +file:///home/runner/work/PyBaMM/PyBaMM/docs/source/user_guide/fundamentals/quick_plot +file:///home/runner/work/PyBaMM/PyBaMM/docs/source/user_guide/fundamentals/plot_voltage_components + +# Errors in docs/source/user_guide/index.md +file:///home/runner/work/PyBaMM/PyBaMM/docs/source/user_guide/api_docs + +# Errors in examples/notebooks/README.md +file:///home/runner/work/PyBaMM/PyBaMM/examples/notebooks/using-submodels.ipynb +file:///home/runner/work/PyBaMM/PyBaMM/examples/notebooks/create-model.ipynb