From b6962cbf66e83084245fbbcc334a9f4e569b1942 Mon Sep 17 00:00:00 2001 From: dmathieu Date: Fri, 5 Apr 2024 11:11:09 +0200 Subject: [PATCH 1/6] add caching to lychee links checker --- .github/workflows/links-fail-fast.yml | 9 ++++++++- .github/workflows/links.yml | 10 +++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/.github/workflows/links-fail-fast.yml b/.github/workflows/links-fail-fast.yml index 7bc1215119e..deaca104565 100644 --- a/.github/workflows/links-fail-fast.yml +++ b/.github/workflows/links-fail-fast.yml @@ -10,8 +10,15 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Restore lychee cache + uses: actions/cache@v3 + with: + path: .lycheecache + key: cache-lychee-${{ github.sha }} + restore-keys: cache-lychee- + - name: Link Checker uses: lycheeverse/lychee-action@v1.9.3 with: fail: true - args: --max-concurrency 5 . + args: --max-concurrency 5 --cache --max-cache-age 1d . diff --git a/.github/workflows/links.yml b/.github/workflows/links.yml index 0b77bb86703..35b62ad036f 100644 --- a/.github/workflows/links.yml +++ b/.github/workflows/links.yml @@ -14,11 +14,19 @@ jobs: - name: Checkout Repo uses: actions/checkout@v4 + + - name: Restore lychee cache + uses: actions/cache@v3 + with: + path: .lycheecache + key: cache-lychee-${{ github.sha }} + restore-keys: cache-lychee- + - name: Link Checker id: lychee uses: lycheeverse/lychee-action@v1.9.3 with: - args: --max-concurrency 5 . + args: --max-concurrency 5 --cache --max-cache-age 1d . - name: Create Issue From File if: steps.lychee.outputs.exit_code != 0 From f4431957709d940c3397179aada39297b7633524 Mon Sep 17 00:00:00 2001 From: dmathieu Date: Mon, 8 Apr 2024 09:36:48 +0200 Subject: [PATCH 2/6] run the post lychee cache even on failure --- .github/workflows/links-fail-fast.yml | 1 + .github/workflows/links.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/links-fail-fast.yml b/.github/workflows/links-fail-fast.yml index deaca104565..f7c034515ed 100644 --- a/.github/workflows/links-fail-fast.yml +++ b/.github/workflows/links-fail-fast.yml @@ -12,6 +12,7 @@ jobs: - name: Restore lychee cache uses: actions/cache@v3 + if: always() with: path: .lycheecache key: cache-lychee-${{ github.sha }} diff --git a/.github/workflows/links.yml b/.github/workflows/links.yml index 35b62ad036f..8ed02ae2e91 100644 --- a/.github/workflows/links.yml +++ b/.github/workflows/links.yml @@ -17,6 +17,7 @@ jobs: - name: Restore lychee cache uses: actions/cache@v3 + if: always() with: path: .lycheecache key: cache-lychee-${{ github.sha }} From fdeabec7a1ed8c46ac5d68ebfef45bb83e77b97f Mon Sep 17 00:00:00 2001 From: dmathieu Date: Mon, 8 Apr 2024 10:40:18 +0200 Subject: [PATCH 3/6] use cache v4 --- .github/workflows/links-fail-fast.yml | 2 +- .github/workflows/links.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/links-fail-fast.yml b/.github/workflows/links-fail-fast.yml index f7c034515ed..3ea2c5728cb 100644 --- a/.github/workflows/links-fail-fast.yml +++ b/.github/workflows/links-fail-fast.yml @@ -11,7 +11,7 @@ jobs: - uses: actions/checkout@v4 - name: Restore lychee cache - uses: actions/cache@v3 + uses: actions/cache@v4 if: always() with: path: .lycheecache diff --git a/.github/workflows/links.yml b/.github/workflows/links.yml index 8ed02ae2e91..19e6eb9adc5 100644 --- a/.github/workflows/links.yml +++ b/.github/workflows/links.yml @@ -16,7 +16,7 @@ jobs: - name: Restore lychee cache - uses: actions/cache@v3 + uses: actions/cache@v4 if: always() with: path: .lycheecache From 1ef4e3f0c5548d04f2860e2797d5c0f829c5a994 Mon Sep 17 00:00:00 2001 From: dmathieu Date: Mon, 8 Apr 2024 10:43:47 +0200 Subject: [PATCH 4/6] always save the cache, even on failure --- .github/workflows/links-fail-fast.yml | 1 + .github/workflows/links.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/links-fail-fast.yml b/.github/workflows/links-fail-fast.yml index 3ea2c5728cb..e382d191a3f 100644 --- a/.github/workflows/links-fail-fast.yml +++ b/.github/workflows/links-fail-fast.yml @@ -17,6 +17,7 @@ jobs: path: .lycheecache key: cache-lychee-${{ github.sha }} restore-keys: cache-lychee- + save-always: true - name: Link Checker uses: lycheeverse/lychee-action@v1.9.3 diff --git a/.github/workflows/links.yml b/.github/workflows/links.yml index 19e6eb9adc5..2e126400274 100644 --- a/.github/workflows/links.yml +++ b/.github/workflows/links.yml @@ -22,6 +22,7 @@ jobs: path: .lycheecache key: cache-lychee-${{ github.sha }} restore-keys: cache-lychee- + save-always: true - name: Link Checker id: lychee From 1170152628956faa4a09cf94f49e501c76e37290 Mon Sep 17 00:00:00 2001 From: dmathieu Date: Mon, 8 Apr 2024 10:54:02 +0200 Subject: [PATCH 5/6] only cache for full successes, as lychee caches even failures --- .github/workflows/links-fail-fast.yml | 2 -- .github/workflows/links.yml | 2 -- 2 files changed, 4 deletions(-) diff --git a/.github/workflows/links-fail-fast.yml b/.github/workflows/links-fail-fast.yml index e382d191a3f..526d66628e2 100644 --- a/.github/workflows/links-fail-fast.yml +++ b/.github/workflows/links-fail-fast.yml @@ -12,12 +12,10 @@ jobs: - name: Restore lychee cache uses: actions/cache@v4 - if: always() with: path: .lycheecache key: cache-lychee-${{ github.sha }} restore-keys: cache-lychee- - save-always: true - name: Link Checker uses: lycheeverse/lychee-action@v1.9.3 diff --git a/.github/workflows/links.yml b/.github/workflows/links.yml index 2e126400274..71836c1595f 100644 --- a/.github/workflows/links.yml +++ b/.github/workflows/links.yml @@ -17,12 +17,10 @@ jobs: - name: Restore lychee cache uses: actions/cache@v4 - if: always() with: path: .lycheecache key: cache-lychee-${{ github.sha }} restore-keys: cache-lychee- - save-always: true - name: Link Checker id: lychee From f99af8f651295c2002f185b4f40f61fa30d8e182 Mon Sep 17 00:00:00 2001 From: Damien Mathieu <42@dmathieu.com> Date: Mon, 8 Apr 2024 11:09:05 +0200 Subject: [PATCH 6/6] Update .github/workflows/links.yml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Robert PajÄ…k --- .github/workflows/links.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/links.yml b/.github/workflows/links.yml index 71836c1595f..72f65d0e6bd 100644 --- a/.github/workflows/links.yml +++ b/.github/workflows/links.yml @@ -26,7 +26,7 @@ jobs: id: lychee uses: lycheeverse/lychee-action@v1.9.3 with: - args: --max-concurrency 5 --cache --max-cache-age 1d . + args: --max-concurrency 1 --cache --max-cache-age 1d . - name: Create Issue From File if: steps.lychee.outputs.exit_code != 0