about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMartin Liska <martin.liska@hey.com>2025-01-06 08:58:29 +0100
committerMartin Liska <martin.liska@hey.com>2025-01-08 17:05:11 +0100
commit9577119d1987289ba1291d79527e2b866c98eb55 (patch)
tree837e344d2586c6aa9f29da10d24ebcec9fcdb0da
parent5a11197efd883b72492f69efc115fdd464d63bcb (diff)
downloadrust-9577119d1987289ba1291d79527e2b866c98eb55.tar.gz
rust-9577119d1987289ba1291d79527e2b866c98eb55.zip
Save linkcheck cache always
-rw-r--r--src/doc/rustc-dev-guide/.github/workflows/ci.yml22
-rw-r--r--src/doc/rustc-dev-guide/book.toml4
2 files changed, 19 insertions, 7 deletions
diff --git a/src/doc/rustc-dev-guide/.github/workflows/ci.yml b/src/doc/rustc-dev-guide/.github/workflows/ci.yml
index 07c20d8d88b..1b5c41417cd 100644
--- a/src/doc/rustc-dev-guide/.github/workflows/ci.yml
+++ b/src/doc/rustc-dev-guide/.github/workflows/ci.yml
@@ -35,12 +35,13 @@ jobs:
             ~/.cargo/bin
           key: ${{ runner.os }}-${{ env.MDBOOK_VERSION }}--${{ env.MDBOOK_LINKCHECK2_VERSION }}--${{ env.MDBOOK_TOC_VERSION }}--${{ env.MDBOOK_MERMAID_VERSION }}
 
-      - name: Cache linkcheck
-        uses: actions/cache@v4
+      - name: Restore cached Linkcheck
+        if: github.event_name == 'schedule'
+        id: cache-linkcheck-restore
+        uses: actions/cache/restore@v4
         with:
-          path: |
-            ~/book/linkcheck
-          key: ${{ runner.os }}-${{ hashFiles('./book/linkcheck') }}
+          path: book/linkcheck/cache.json
+          key: linkcheck
 
       - name: Install latest nightly Rust toolchain
         if: steps.mdbook-cache.outputs.cache-hit != 'true'
@@ -57,7 +58,16 @@ jobs:
           cargo install mdbook-mermaid --version ${{ env.MDBOOK_MERMAID_VERSION }}
 
       - name: Check build
-        run: ENABLE_LINKCHECK=1 mdbook build
+        run: mdbook build
+        continue-on-error: true
+
+      - name: Save cached Linkcheck
+        id: cache-linkcheck-save
+        if: github.event_name == 'schedule'
+        uses: actions/cache/save@v4
+        with:
+          path: book/linkcheck/cache.json
+          key: linkcheck
 
       - name: Deploy to gh-pages
         if: github.event_name == 'push'
diff --git a/src/doc/rustc-dev-guide/book.toml b/src/doc/rustc-dev-guide/book.toml
index 2f67aecf6f0..67069d9930f 100644
--- a/src/doc/rustc-dev-guide/book.toml
+++ b/src/doc/rustc-dev-guide/book.toml
@@ -52,7 +52,9 @@ exclude = [
     # 500 is returned for HEAD request
     "code\\.visualstudio\\.com/docs/editor/tasks",
 ]
-cache-timeout = 86400
+# The scheduled CI runs every day and so we need to reuse a part of the cache
+# in order to face "Server returned 429 Too Many Requests" errors for github.com.
+cache-timeout = 90000
 warning-policy = "error"
 
 [output.html.redirect]