From ffc9c60f73c4eadd909c39f49a5bd9fd6ce62ddd Mon Sep 17 00:00:00 2001 From: Dennis Klein Date: Sun, 31 May 2026 20:58:22 +0200 Subject: [PATCH] ci: cache fairmq compilation with ccache FairMQ's own sources (library, examples, tests) were recompiled from scratch in every matrix job on every push. - add hendrikmuhs/ccache-action to build, sanitizers and static-analysis jobs - set CMAKE_C/CXX_COMPILER_LAUNCHER=ccache so cmake routes through it - key the cache per (job, env, gcc) since ccache hashes the compiler --- .github/workflows/ci.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c0878cba..bebcf6cd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,6 +36,12 @@ jobs: gcc: ${{ matrix.gcc }} env: ${{ matrix.env }} + - name: ccache + uses: hendrikmuhs/ccache-action@v1 + with: + key: ${{ github.job }}-${{ matrix.env }}-gcc${{ matrix.gcc }} + max-size: 500M + - name: Configure and Build uses: threeal/cmake-action@v2 with: @@ -44,6 +50,8 @@ jobs: CMAKE_BUILD_TYPE=RelWithDebInfo CMAKE_INSTALL_PREFIX=${{ github.workspace }}/install BUILD_TESTING=ON + CMAKE_C_COMPILER_LAUNCHER=ccache + CMAKE_CXX_COMPILER_LAUNCHER=ccache - name: Test uses: threeal/ctest-action@v1 @@ -83,6 +91,12 @@ jobs: with: gcc: '14' + - name: ccache + uses: hendrikmuhs/ccache-action@v1 + with: + key: ${{ github.job }}-${{ matrix.sanitizer.name }} + max-size: 500M + - name: Configure and Build uses: threeal/cmake-action@v2 with: @@ -92,6 +106,8 @@ jobs: options: | CMAKE_BUILD_TYPE=Debug BUILD_TESTING=ON + CMAKE_C_COMPILER_LAUNCHER=ccache + CMAKE_CXX_COMPILER_LAUNCHER=ccache ${{ matrix.sanitizer.options }} - name: Test @@ -116,6 +132,12 @@ jobs: with: gcc: '14' + - name: ccache + uses: hendrikmuhs/ccache-action@v1 + with: + key: ${{ github.job }} + max-size: 500M + - name: Configure and Build uses: threeal/cmake-action@v2 with: @@ -124,6 +146,8 @@ jobs: CMAKE_BUILD_TYPE=Debug BUILD_TESTING=ON RUN_STATIC_ANALYSIS=ON + CMAKE_C_COMPILER_LAUNCHER=ccache + CMAKE_CXX_COMPILER_LAUNCHER=ccache - name: Check for warnings run: |