GitHub Actions: Separate ccache cache based on ide major version

This way master, which now is version 7 won't interfere with 6.0 branch
which will have version 6.

When branches share the same cache the ccache hit rate is now ~40%,
which is too low.

Reduce the ccache size so that the 5GB would host multiple branch
versions.

Change-Id: If29c917fb47f4e1fdab4b4257af8b0625f6f219e
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This commit is contained in:
Cristian Adam
2021-11-20 14:00:56 +01:00
parent 1a6e6825e6
commit d177a20bb8

View File

@@ -364,13 +364,20 @@ jobs:
string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC) string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC)
message("::set-output name=timestamp::${current_date}") message("::set-output name=timestamp::${current_date}")
file(TO_CMAKE_PATH "$ENV{GITHUB_WORKSPACE}" github_workspace)
include(${github_workspace}/cmake/QtCreatorIDEBranding.cmake)
string(REPLACE "." ";" IDE_VERSION_LIST ${IDE_VERSION_DISPLAY})
list(GET IDE_VERSION_LIST 0 IDE_VERSION_MAJOR)
message("::set-output name=ide_major_version::${IDE_VERSION_MAJOR}")
- name: ccache cache files - name: ccache cache files
uses: actions/cache@v1.1.0 uses: actions/cache@v1.1.0
with: with:
path: .ccache path: .ccache
key: ${{ matrix.config.name }}-ccache-${{ steps.ccache_cache_timestamp.outputs.timestamp }} key: ${{ matrix.config.name }}-ccache-${{ steps.ccache_cache_timestamp.outputs.ide_major_version }}-${{ steps.ccache_cache_timestamp.outputs.timestamp }}
restore-keys: | restore-keys: |
${{ matrix.config.name }}-ccache- ${{ matrix.config.name }}-ccache-${{ steps.ccache_cache_timestamp.outputs.ide_major_version }}
- name: Install system libs - name: Install system libs
shell: cmake -P {0} shell: cmake -P {0}
@@ -415,10 +422,10 @@ jobs:
set(ENV{CCACHE_DIR} "${ccache_basedir}/.ccache") set(ENV{CCACHE_DIR} "${ccache_basedir}/.ccache")
set(ENV{CCACHE_SLOPPINESS} "pch_defines,time_macros") set(ENV{CCACHE_SLOPPINESS} "pch_defines,time_macros")
set(ENV{CCACHE_COMPRESS} "true") set(ENV{CCACHE_COMPRESS} "true")
set(ENV{CCACHE_COMPRESSLEVEL} "6") set(ENV{CCACHE_COMPRESSLEVEL} "9")
set(ENV{CCACHE_MAXSIZE} "800M") set(ENV{CCACHE_MAXSIZE} "400M")
if ("${{ matrix.config.cxx }}" STREQUAL "cl") if ("${{ matrix.config.cxx }}" STREQUAL "cl")
set(ENV{CCACHE_MAXSIZE} "1200M") set(ENV{CCACHE_MAXSIZE} "600M")
endif() endif()
execute_process( execute_process(
@@ -491,10 +498,10 @@ jobs:
set(ENV{CCACHE_DIR} "${ccache_basedir}/.ccache") set(ENV{CCACHE_DIR} "${ccache_basedir}/.ccache")
set(ENV{CCACHE_SLOPPINESS} "pch_defines,time_macros") set(ENV{CCACHE_SLOPPINESS} "pch_defines,time_macros")
set(ENV{CCACHE_COMPRESS} "true") set(ENV{CCACHE_COMPRESS} "true")
set(ENV{CCACHE_COMPRESSLEVEL} "6") set(ENV{CCACHE_COMPRESSLEVEL} "9")
set(ENV{CCACHE_MAXSIZE} "800M") set(ENV{CCACHE_MAXSIZE} "400M")
if ("${{ matrix.config.cxx }}" STREQUAL "cl") if ("${{ matrix.config.cxx }}" STREQUAL "cl")
set(ENV{CCACHE_MAXSIZE} "1200M") set(ENV{CCACHE_MAXSIZE} "600M")
endif() endif()
execute_process(COMMAND ccache -s) execute_process(COMMAND ccache -s)