From be17ed1b62a3a2807ec7e203c2e655d5a3944972 Mon Sep 17 00:00:00 2001 From: Alexander Wilms Date: Fri, 29 Sep 2023 23:55:12 +0200 Subject: [PATCH] Enable ccache for CI --- .github/workflows/github.yml | 17 ++++++++++++++++- CMakePresets.json | 8 ++++++-- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/.github/workflows/github.yml b/.github/workflows/github.yml index eecb0f737..4319c74e2 100644 --- a/.github/workflows/github.yml +++ b/.github/workflows/github.yml @@ -158,6 +158,15 @@ jobs: env: VCMI_BUILD_PLATFORM: x64 + - name: ccache + if: startsWith(matrix.preset, 'ios') != true + uses: hendrikmuhs/ccache-action@v1.2 + with: + key: ${{ matrix.preset }} + # actual cache takes up less space, at most ~1 GB + max-size: "5G" + verbose: 2 + - uses: actions/setup-python@v4 if: "${{ matrix.conan_profile != '' }}" with: @@ -193,7 +202,13 @@ jobs: env: PULL_REQUEST: ${{ github.event.pull_request.number }} - - name: CMake Preset + - name: CMake Preset with ccache + if: startsWith(matrix.preset, 'ios') != true + run: | + cmake -DCMAKE_CXX_COMPILER_LAUNCHER=ccache --preset ${{ matrix.preset }} + + - name: CMake Preset without ccache + if: startsWith(matrix.preset, 'ios') run: | cmake --preset ${{ matrix.preset }} diff --git a/CMakePresets.json b/CMakePresets.json index 39c752e94..ce2781c07 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -25,7 +25,8 @@ "CMAKE_BUILD_TYPE": "RelWithDebInfo", "ENABLE_TEST": "OFF", "ENABLE_STRICT_COMPILATION": "ON", - "ENABLE_GITVERSION": "$env{VCMI_PACKAGE_GITVERSION}" + "ENABLE_GITVERSION": "$env{VCMI_PACKAGE_GITVERSION}", + "ENABLE_PCH" : "OFF" } }, { @@ -217,7 +218,10 @@ "inherits": [ "base-ios-release", "ios-device-conan" - ] + ], + "cacheVariables": { + "ENABLE_PCH" : "ON" + } }, { "name": "ios-release-legacy",