From 547e5715af813686e50587af2f2e62ae26dbe1ea Mon Sep 17 00:00:00 2001 From: Bruno Alexandre Rosa <1791393+brunoalr@users.noreply.github.com> Date: Mon, 2 Mar 2026 23:21:51 -0300 Subject: [PATCH] ci: remove stale ccache (#57) --- .github/workflows/desktop-build.yml | 30 ++++++++++++++++++++++------- cockatrice/src/main.cpp | 2 ++ 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/.github/workflows/desktop-build.yml b/.github/workflows/desktop-build.yml index e95898097..566c86cea 100644 --- a/.github/workflows/desktop-build.yml +++ b/.github/workflows/desktop-build.yml @@ -4,7 +4,7 @@ permissions: contents: write id-token: write attestations: write - actions: write # needed for ccache action to be able to delete gha caches + actions: write on: push: @@ -41,7 +41,7 @@ on: # Cancel earlier, unfinished runs of this workflow on the same branch (unless on master) concurrency: group: "${{ github.workflow }} @ ${{ github.ref_name }}" - cancel-in-progress: ${{ github.ref_name != 'master' }} + cancel-in-progress: true jobs: configure: @@ -171,7 +171,9 @@ jobs: with: path: ${{env.CACHE}} key: ccache-${{matrix.distro}}${{matrix.version}}-${{env.BRANCH_NAME}} - restore-keys: ccache-${{matrix.distro}}${{matrix.version}}- + restore-keys: | + ccache-${{matrix.distro}}${{matrix.version}}-${{env.BRANCH_NAME}}- + ccache-${{matrix.distro}}${{matrix.version}}-master- - name: Build ${{matrix.distro}} ${{matrix.version}} Docker image shell: bash @@ -202,6 +204,13 @@ jobs: --ccache "$CCACHE_SIZE" $NO_CLIENT .ci/name_build.sh + - name: Delete stale ccache + if: github.ref == 'refs/heads/master' + env: + GH_TOKEN: ${{github.token}} + run: | + gh cache delete "${{ steps.ccache_restore.outputs.cache-primary-key }}" || true + - name: Save compiler cache (ccache) if: github.ref == 'refs/heads/master' uses: actions/cache/save@v5 @@ -356,7 +365,9 @@ jobs: with: path: ${{env.CCACHE_DIR}} key: ccache-${{matrix.runner}}-${{matrix.soc}}-${{matrix.type}}-${{env.BRANCH_NAME}} - restore-keys: ccache-${{matrix.runner}}-${{matrix.soc}}-${{matrix.type}}- + restore-keys: | + ccache-${{matrix.runner}}-${{matrix.soc}}-${{matrix.type}}-${{env.BRANCH_NAME}}- + ccache-${{matrix.runner}}-${{matrix.soc}}-${{matrix.type}}-master- - name: Install aqtinstall if: matrix.os == 'macOS' @@ -443,14 +454,19 @@ jobs: TARGET_MACOS_VERSION: ${{ matrix.override_target }} run: .ci/compile.sh --server --test --vcpkg + - name: Delete stale ccache + if: github.ref == 'refs/heads/master' && matrix.use_ccache == 1 + env: + GH_TOKEN: ${{github.token}} + run: | + gh cache delete "${{ steps.ccache_restore.outputs.cache-primary-key }}" || true + - name: Save compiler cache (ccache) if: github.ref == 'refs/heads/master' && matrix.use_ccache == 1 uses: actions/cache/save@v5 - env: - BRANCH_NAME: ${{ github.head_ref || github.ref_name }} with: path: ${{env.CCACHE_DIR}} - key: ccache-${{matrix.runner}}-${{matrix.soc}}-${{matrix.type}}-${{env.BRANCH_NAME}} + key: ${{ steps.ccache_restore.outputs.cache-primary-key }} - name: Sign app bundle if: matrix.os == 'macOS' && matrix.make_package && (github.ref == 'refs/heads/master' || needs.configure.outputs.tag != null) diff --git a/cockatrice/src/main.cpp b/cockatrice/src/main.cpp index 7092a3fd7..02b06147e 100644 --- a/cockatrice/src/main.cpp +++ b/cockatrice/src/main.cpp @@ -214,6 +214,7 @@ int main(int argc, char *argv[]) #endif #ifdef Q_OS_MAC + translationPath = qApp->applicationDirPath() + "/../Resources/translations"; #elif defined(Q_OS_WIN) translationPath = qApp->applicationDirPath() + "/translations"; @@ -237,6 +238,7 @@ int main(int argc, char *argv[]) } rng = new RNG_SFMT; + const auto bla = 42; themeManager = new ThemeManager; soundEngine = new SoundEngine;