From 357b5f9ed868e96b42d5ddd2e6db319bdfff693a Mon Sep 17 00:00:00 2001 From: Sebastian Ullrich Date: Thu, 3 Jul 2025 22:55:14 +0200 Subject: [PATCH] chore: CI: restore cache in `update-stage0` (#9179) Avoid rebuilding stage 0 all the time --- .github/workflows/build-template.yml | 4 ++-- .github/workflows/update-stage0.yml | 12 ++++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-template.yml b/.github/workflows/build-template.yml index 23145f971b..39e6760e64 100644 --- a/.github/workflows/build-template.yml +++ b/.github/workflows/build-template.yml @@ -97,11 +97,11 @@ jobs: sudo apt-get update sudo apt-get install -y gcc-multilib g++-multilib ccache libuv1-dev:i386 pkgconf:i386 if: matrix.cmultilib - - name: Cache + - name: Restore Cache id: restore-cache uses: actions/cache/restore@v4 with: - # NOTE: must be in sync with `save` below + # NOTE: must be in sync with `save` below and with `restore-cache` in `update-stage0.yml` path: | .ccache ${{ matrix.name == 'Linux Lake' && false && 'build/stage1/**/*.trace diff --git a/.github/workflows/update-stage0.yml b/.github/workflows/update-stage0.yml index 95473d085e..5d72debe66 100644 --- a/.github/workflows/update-stage0.yml +++ b/.github/workflows/update-stage0.yml @@ -52,6 +52,18 @@ jobs: run: | echo "NPROC=$(nproc 2>/dev/null || sysctl -n hw.logicalcpu 2>/dev/null || echo 4)" >> $GITHUB_ENV shell: 'nix develop -c bash -euxo pipefail {0}' + - name: Restore Cache + if: env.should_update_stage0 == 'yes' + uses: actions/cache/restore@v4 + with: + # NOTE: must be in sync with `restore-cache` in `build-template.yml` + # TODO: actually switch to USE_LAKE once it caches more; for now it just caches more often than any other build type so let's use its cache + path: | + .ccache + key: Linux Lake-build-v3-${{ github.sha }} + # fall back to (latest) previous cache + restore-keys: | + Linux Lake-build-v3 - if: env.should_update_stage0 == 'yes' run: cmake --preset release shell: 'nix develop -c bash -euxo pipefail {0}'