瀏覽代碼

Merge pull request #2960 from Alexander-Wilms/ccache

Enable ccache for CI
Nordsoft91 2 年之前
父節點
當前提交
f54a3c4e6c
共有 2 個文件被更改,包括 22 次插入3 次删除
  1. 16 1
      .github/workflows/github.yml
  2. 6 2
      CMakePresets.json

+ 16 - 1
.github/workflows/github.yml

@@ -158,6 +158,15 @@ jobs:
       env:
         VCMI_BUILD_PLATFORM: x64
 
+    - name: ccache
+      if: startsWith(matrix.preset, 'ios') != true
+      uses: hendrikmuhs/[email protected]
+      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 }}
 

+ 6 - 2
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",