summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDimitrios Apostolou <jimis@qt.io>2020-09-28 16:42:51 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-01-26 12:35:46 +0000
commitab279af23ca3a82d9da47bd9482c0f76579f93e4 (patch)
tree7b77fd4d7b3de0a11e484f5062e9850fa7438302
parent236302c44d6392bb0a9c7d32d7ff1c03dd42fdb9 (diff)
Github Actions: ccache updates
+ Specify the ccache cache directory to avoid the defaults, because ccache >= 4.0 puts the cache directory in system-dependent paths + Adjust sloppiness to increase cache hit ratio + print compression stats but don't err if `-x` flag is missing (only available only on ccache >= 4.0) + Print ccache config for debugging purposes + Enable ccache compression and limit size Regarding the last point, ccache < v4.0 optionally compresses using the zlib algorithm, but ccache >= v4.0 uses zstd and compression is enabled by default. By forcing compression to true, all platforms will need similar size cache. We have to limit it because the default (5GB) fills up the cache artifacts size that Github Actions offers. Change-Id: Iea72d08b223c611ee4a4443625647a1f01809b08 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 7ff1123711ea86a3be0654ac6b7648b92b337a7a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--.github/workflows/ninja-build.yml14
1 files changed, 12 insertions, 2 deletions
diff --git a/.github/workflows/ninja-build.yml b/.github/workflows/ninja-build.yml
index 22ac8ae6ff..66c15f2860 100644
--- a/.github/workflows/ninja-build.yml
+++ b/.github/workflows/ninja-build.yml
@@ -64,7 +64,7 @@ jobs:
id: ccache
uses: actions/cache@v2
with:
- path: ~/.ccache
+ path: ${{ runner.temp }}/ccache
# "github.run_id" is unique, which causes the cache to always get
# saved at the end of a successful run.
key: ccache-${{ matrix.os }}-${{ github.ref }}-${{ github.run_id }}
@@ -81,6 +81,12 @@ jobs:
if: matrix.deps != ''
- name: install compiler tools
run: ${{ matrix.install_cmd }} ${{ matrix.tools }} ${{ matrix.install_cmd_postfix }}
+ - name: configure ccache
+ run: |
+ ccache --set-config sloppiness=file_macro,time_macros
+ ccache --set-config cache_dir='${{ runner.temp }}'/ccache
+ ccache --set-config compression=true
+ ccache --set-config max_size=1G
- name: print versions and environment
run: |
gcc --version | head -1
@@ -88,6 +94,7 @@ jobs:
echo Ninja `ninja --version`
{ ninja --help || true ; } 2>&1 | grep "run N jobs in parallel"
ccache --version | head -1
+ ccache --show-config || echo 'Old ccache version does not support --show-config'
echo Environment:
printenv
@@ -105,4 +112,7 @@ jobs:
- name: various stats
# Print ccache utilization statistics, then reset them.
- run: ccache -s && ccache -z
+ run: |
+ ccache -s
+ ccache -x 2>/dev/null || true
+ ccache -z