ci: fix ccache effectiveness for Linux and Android builds

- Disable CMake module scanning, which made compilations uncacheable.
- Linux: trailing "." on cache key so one preset's key is not a prefix of
  another's.
- Android: add ccache (action, CCACHE_BASEDIR, gradle compiler launcher).
- Save cache on master only; evict files unused by the job.
This commit is contained in:
Jonathan Steffan committed 2026-11-11 11:19:21 -07:00
1 parent 869b0ce660
commit 70282d57fd
3 files changed
+32 -7

No files matched your search

+27 -6
View File
@@ -45,11 +45,14 @@ jobs:
packages: ccache libvulkan-dev glslang-tools spirv-tools libwayland-dev libxrandr-dev ${{matrix.config.packages}} ${{ startsWith(matrix.config.preset, 'server') && env.SERVER_DEPS || ''}}
- name: ccache
uses: hendrikmuhs/[email protected]3
uses: hendrikmuhs/[email protected]4
with:
key: linux-${{matrix.config.preset}}
job-summary: ""
restore-keys: linux-
# The trailing "." keeps one preset's key from being a prefix of another's
key: linux-${{matrix.config.preset}}.
verbose: 1
job-summary: ''
evict-old-files: job
save: ${{ github.ref == 'refs/heads/master' }}
- uses: actions/cache@v5
with:
@@ -139,10 +142,14 @@ jobs:
packages: librsvg2-bin npm
- name: ccache
uses: hendrikmuhs/[email protected]3
uses: hendrikmuhs/[email protected]4
with:
key: steam-frame
job-summary: ""
verbose: 1
job-summary: ''
evict-old-files: job
save: ${{ github.ref == 'refs/heads/master' }}
restore-keys: steam-frame
- uses: actions/cache@v5
with:
@@ -289,6 +296,16 @@ jobs:
${{github.workspace}}/cmake-fetch/*.tgz
restore-keys: cmake-android-
- name: ccache
uses: hendrikmuhs/[email protected]
with:
# The trailing "." keeps one build type's key from being a prefix of another's
key: android-${{matrix.buildtype}}.
verbose: 1
job-summary: ''
evict-old-files: job
save: ${{ github.ref == 'refs/heads/master' }}
# Gradle distribution and the Android plugin's dependencies.
- uses: actions/cache@v5
with:
@@ -330,6 +347,9 @@ jobs:
echo "$APK_KEYSTORE_BASE64" | base64 --decode --ignore-garbage > ks.keystore
- name: Build
env:
# Paths under the workspace are hashed relative to it
CCACHE_BASEDIR: ${{github.workspace}}
run: |
VERSION=$(git describe --tags --always | sed "s/^v\([0-9]\)/\1/")
if [ ${{ matrix.buildtype }} = 'Oculus' ]
@@ -367,6 +387,7 @@ jobs:
-Pwivrn_app_name="$APPNAME" \
-Pwivrn_compress_glb=ON \
-Pfetchcontent_base_dir=${{github.workspace}}/cmake-fetch \
-Pcompiler_launcher=ccache \
assemble${{ matrix.buildtype }}
- name: Upload build dir
+1
View File
@@ -8,6 +8,7 @@ set(CMAKE_POLICY_DEFAULT_CMP0077 NEW)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_CXX_STANDARD 23)
set(CMAKE_CXX_SCAN_FOR_MODULES OFF)
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
if(ANDROID)
+4 -1
View File
@@ -117,6 +117,8 @@ android {
def compressGlb = project.hasProperty('wivrn_compress_glb') ? wivrn_compress_glb : 'OFF'
def fetchcontentBaseDir = project.hasProperty('fetchcontent_base_dir') ? ['-DFETCHCONTENT_BASE_DIR=' + fetchcontent_base_dir] : []
def compilerLauncher = project.hasProperty('compiler_launcher') ? ['-DCMAKE_C_COMPILER_LAUNCHER=' + compiler_launcher, '-DCMAKE_CXX_COMPILER_LAUNCHER=' + compiler_launcher] : []
def asan = use_asan ? 'ON': 'OFF'
def stl = use_asan ? 'c++_shared' : "c++_static"
@@ -146,7 +148,8 @@ android {
'-DWIVRN_COMPRESS_GLB=' + compressGlb,
'-DWIVRN_ADDRESS_SANITIZER=' + asan,
] +
fetchcontentBaseDir
fetchcontentBaseDir +
compilerLauncher
resValue "string", "app_name", project.hasProperty('wivrn_app_name') ? project.wivrn_app_name : "WiVRn Local"
abiFilters 'arm64-v8a'//, 'x86_64'
}