From 3662cd28f3297ceb810e834f5cf60d5ada1915ee Mon Sep 17 00:00:00 2001 From: David Sherret Date: Wed, 15 Mar 2023 17:24:56 -0400 Subject: [PATCH 1/3] chore(ci): fix ci to restore the cache --- .github/workflows/ci.generate.ts | 10 ++++++---- .github/workflows/ci.yml | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.generate.ts b/.github/workflows/ci.generate.ts index 1d68439d690e2e..994483be62bec7 100755 --- a/.github/workflows/ci.generate.ts +++ b/.github/workflows/ci.generate.ts @@ -10,6 +10,8 @@ const Runners = { macos: "macos-12", windows: `\${{ ${windowsRunnerCondition} }}`, }; +// bump this when you want to purge the cache +const cacheVersion = 19; const installPkgsCommand = "sudo apt-get install --no-install-recommends debootstrap clang-15 lld-15"; @@ -442,8 +444,8 @@ const ci = { "!./target/*/*.tar.gz", ].join("\n"), key: "never_saved", - "restore-keys": - "19-cargo-target-${{ matrix.os }}-${{ matrix.profile }}-", + "restore-keys": cacheVersion + + "-cargo-target-${{ matrix.os }}-${{ matrix.profile }}-", }, }, { @@ -857,8 +859,8 @@ const ci = { "!./target/*/*.zip", "!./target/*/*.tar.gz", ].join("\n"), - key: - "18-cargo-target-${{ matrix.os }}-${{ matrix.profile }}-${{ github.sha }}", + key: cacheVersion + + "-cargo-target-${{ matrix.os }}-${{ matrix.profile }}-${{ github.sha }}", }, }, ]), diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 61a2ac6b69f17e..e7e839008e8c5a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -555,7 +555,7 @@ jobs: !./target/*/gn_out !./target/*/*.zip !./target/*/*.tar.gz - key: '18-cargo-target-${{ matrix.os }}-${{ matrix.profile }}-${{ github.sha }}' + key: '19-cargo-target-${{ matrix.os }}-${{ matrix.profile }}-${{ github.sha }}' publish-canary: name: publish canary runs-on: ubuntu-22.04 From d2dce5d5d4f125e3b950bbb47cc7a9a70cf0bc22 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Wed, 15 Mar 2023 17:27:50 -0400 Subject: [PATCH 2/3] Better. --- .github/workflows/ci.generate.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.generate.ts b/.github/workflows/ci.generate.ts index 994483be62bec7..d0b6516bd9df88 100755 --- a/.github/workflows/ci.generate.ts +++ b/.github/workflows/ci.generate.ts @@ -10,8 +10,9 @@ const Runners = { macos: "macos-12", windows: `\${{ ${windowsRunnerCondition} }}`, }; -// bump this when you want to purge the cache -const cacheVersion = 19; +// bump the number at the start when you want to purge the cache +const cacheKeyPrefix = + "19-cargo-target-${{ matrix.os }}-${{ matrix.profile }}-"; const installPkgsCommand = "sudo apt-get install --no-install-recommends debootstrap clang-15 lld-15"; @@ -444,8 +445,7 @@ const ci = { "!./target/*/*.tar.gz", ].join("\n"), key: "never_saved", - "restore-keys": cacheVersion + - "-cargo-target-${{ matrix.os }}-${{ matrix.profile }}-", + "restore-keys": cacheKeyPrefix, }, }, { @@ -859,8 +859,7 @@ const ci = { "!./target/*/*.zip", "!./target/*/*.tar.gz", ].join("\n"), - key: cacheVersion + - "-cargo-target-${{ matrix.os }}-${{ matrix.profile }}-${{ github.sha }}", + key: cacheKeyPrefix + "${{ github.sha }}", }, }, ]), From e1978fa496fdbd70d1bd1fdd9e2f08c76967bedf Mon Sep 17 00:00:00 2001 From: David Sherret Date: Wed, 15 Mar 2023 17:43:51 -0400 Subject: [PATCH 3/3] Let's actually use 18 since that's what main is saving the cache as right now. --- .github/workflows/ci.generate.ts | 2 +- .github/workflows/ci.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.generate.ts b/.github/workflows/ci.generate.ts index d0b6516bd9df88..35367adb871f33 100755 --- a/.github/workflows/ci.generate.ts +++ b/.github/workflows/ci.generate.ts @@ -12,7 +12,7 @@ const Runners = { }; // bump the number at the start when you want to purge the cache const cacheKeyPrefix = - "19-cargo-target-${{ matrix.os }}-${{ matrix.profile }}-"; + "18-cargo-target-${{ matrix.os }}-${{ matrix.profile }}-"; const installPkgsCommand = "sudo apt-get install --no-install-recommends debootstrap clang-15 lld-15"; diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e7e839008e8c5a..fbffd8ba70c166 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -274,7 +274,7 @@ jobs: !./target/*/*.zip !./target/*/*.tar.gz key: never_saved - restore-keys: '19-cargo-target-${{ matrix.os }}-${{ matrix.profile }}-' + restore-keys: '18-cargo-target-${{ matrix.os }}-${{ matrix.profile }}-' - name: Apply and update mtime cache if: '!(github.event_name == ''pull_request'' && matrix.skip_pr) && (steps.exit_early.outputs.EXIT_EARLY != ''true'' && (!startsWith(github.ref, ''refs/tags/'')))' uses: ./.github/mtime_cache @@ -555,7 +555,7 @@ jobs: !./target/*/gn_out !./target/*/*.zip !./target/*/*.tar.gz - key: '19-cargo-target-${{ matrix.os }}-${{ matrix.profile }}-${{ github.sha }}' + key: '18-cargo-target-${{ matrix.os }}-${{ matrix.profile }}-${{ github.sha }}' publish-canary: name: publish canary runs-on: ubuntu-22.04