From 8d6c90bce8e7ed338c5c174963be7c98fc482e3d Mon Sep 17 00:00:00 2001 From: Bruno Alexandre Rosa <1791393+brunoalr@users.noreply.github.com> Date: Sun, 18 May 2025 18:15:30 -0300 Subject: [PATCH] ci: use ccache on macos --- .github/workflows/desktop-build.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.github/workflows/desktop-build.yml b/.github/workflows/desktop-build.yml index f5d3f86eb..81e8875b8 100644 --- a/.github/workflows/desktop-build.yml +++ b/.github/workflows/desktop-build.yml @@ -235,6 +235,7 @@ jobs: runs-on: ${{matrix.os}} continue-on-error: ${{matrix.allow-failure == 'yes'}} env: + CACHE: /tmp/${{matrix.os}}-${{matrix.type}}-cache # ${{runner.temp}} does not work? DEVELOPER_DIR: /Applications/Xcode_${{matrix.xcode}}.app/Contents/Developer CMAKE_GENERATOR: 'Ninja' @@ -253,6 +254,16 @@ jobs: brew update brew install protobuf qt --force-bottle + - name: Restore compiler cache (ccache) + id: ccache_restore + uses: actions/cache/restore@v4 + env: + BRANCH_NAME: ${{ github.head_ref || github.ref_name }} + with: + path: ${{env.CACHE}} + key: ccache-${{matrix.os}}-${{matrix.type}}-${{env.BRANCH_NAME}} + restore-keys: ccache-${{matrix.os}}-${{matrix.type}}- + - name: Build & Sign on Xcode ${{matrix.xcode}} shell: bash id: build @@ -323,6 +334,13 @@ jobs: xcrun stapler staple ${{steps.build.outputs.path}} fi + - name: Save compiler cache (ccache) + if: github.ref == 'refs/heads/master' + uses: actions/cache/save@v4 + with: + path: ${{env.CACHE}} + key: ${{ steps.ccache_restore.outputs.cache-primary-key }} + - name: Upload artifact if: matrix.make_package uses: actions/upload-artifact@v4