From 1605d48a185d5f91b5b55efca11777673c8bb165 Mon Sep 17 00:00:00 2001 From: momo5502 Date: Thu, 29 May 2025 11:33:02 +0200 Subject: [PATCH] Better sccache --- .github/workflows/build.yml | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ea58039b..9dea71b4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -52,14 +52,6 @@ jobs: sudo update-alternatives --set cc /usr/bin/clang-${{ env.LLVM_VERSION }} sudo update-alternatives --set c++ /usr/bin/clang++-${{ env.LLVM_VERSION }} - - name: Run sccache-cache - uses: mozilla-actions/sccache-action@v0.0.9 - - - name: Setup Environment Variables - shell: bash - run: | - echo "SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV - - name: CMake Build run: cmake --preset=release -DMOMO_ENABLE_CLANG_TIDY=On && cmake --build --preset=release @@ -94,14 +86,6 @@ jobs: - name: Enable Developer Command Prompt uses: ilammy/msvc-dev-cmd@v1.13.0 - - name: Run sccache-cache - uses: mozilla-actions/sccache-action@v0.0.9 - - - name: Setup Environment Variables - shell: bash - run: | - echo "SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV - - name: CMake Build run: cmake --preset=release && cmake --build --preset=release -t dump-apiset @@ -274,10 +258,22 @@ jobs: - name: Run sccache-cache uses: mozilla-actions/sccache-action@v0.0.9 - - name: Setup Environment Variables + - name: Initialize sccache environnement shell: bash run: | - echo "SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV + echo SCCACHE_CACHE=$(sccache --show-stats | grep Local | cut -d '"' -f2) >> $GITHUB_ENV + sccache --stop-server || true + + - name: Recover sccache cache + uses: actions/cache@v3 + with: + path: ${{env.SCCACHE_CACHE}} + key: sccache-cache-${{runner.os}} + + - name: Start sccache + shell: bash + working-directory: ${{github.workspace}} + run: sccache --start-server - name: Setup Android Environment Variables shell: bash @@ -304,6 +300,11 @@ jobs: path: "build/${{matrix.preset}}/**/CTestTestfile.cmake" retention-days: 1 + - name: Cleanup sccache + working-directory: ${{github.workspace}} + shell: bash + run: sccache --stop-server + test: name: Test runs-on: ${{ matrix.runner }}