CI: Cache cmake fetchcontent downloads

This commit is contained in:
Patrick Nicolas
2025-11-16 14:55:01 +01:00
parent f5f917dfe0
commit fd514bda6a
2 changed files with 31 additions and 4 deletions
+27 -2
View File
@@ -31,6 +31,14 @@ jobs:
with:
create-symlink: true
- uses: actions/cache@v4
with:
key: cmake-server-${{matrix.cmake_preset}}
path: |
${{github.workspace}}/cmake-fetch/*-subbuild/*-populate-prefix/src/*.tar.*
${{github.workspace}}/cmake-fetch/*-subbuild/*-populate-prefix/src/*.zip
restore-keys: cmake-server-
- name: Install dependencies
run: >
sudo apt-get update && sudo apt-get install libvulkan-dev libcjson-dev libx264-dev libavcodec-dev libavutil-dev libswscale-dev libavfilter-dev libbsd-dev libavahi-client-dev libavahi-glib-dev libeigen3-dev glslang-tools libudev-dev libwayland-dev libx11-xcb-dev libxrandr-dev libxcb-randr0-dev libgl-dev libglx-dev mesa-common-dev libgl1-mesa-dev libglu1-mesa-dev libsystemd-dev libva-dev nlohmann-json3-dev libpulse-dev xz-utils libpipewire-0.3-dev libcli11-dev libboost-all-dev librsvg2-bin libssl-dev libnotify-dev librsvg2-dev libarchive-dev
@@ -48,12 +56,13 @@ jobs:
cmake -B ${{github.workspace}}/build
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
-DCMAKE_INSTALL_PREFIX=/usr
-DFETCHCONTENT_BASE_DIR=${{github.workspace}}/cmake-fetch
--preset ${{ matrix.cmake_preset }}
- name: Package build dependencies
if: ${{ matrix.cmake_preset == 'server' }}
# For easier packaging, build dependencies are made available as a separate archive
run: (cd ${{github.workspace}}/build/_deps/ ; tar --create --xz *-src) > ${{github.workspace}}/server-build-deps.tar.xz
run: (cd ${{github.workspace}}/cmake-fetch ; tar --create --xz *-src) > ${{github.workspace}}/server-build-deps.tar.xz
- name: Build
# Build your program with the given configuration
@@ -273,6 +282,14 @@ jobs:
distribution: 'temurin'
cache: gradle
- uses: actions/cache@v4
with:
key: cmake-android-${{matrix.buildtype}}
path: |
${{github.workspace}}/cmake-fetch/*-subbuild/*-populate-prefix/src/*.tar.*
${{github.workspace}}/cmake-fetch/*-subbuild/*-populate-prefix/src/*.zip
restore-keys: cmake-android-
- name: Install dependencies
run: |
sudo apt-get update && sudo apt-get install glslang-tools librsvg2-bin gettext
@@ -340,7 +357,15 @@ jobs:
echo Using stylesheet $CSS and name $APPNAME
chmod +x gradlew
./gradlew -Pwivrn_version=$VERSION -Pwivrn_versionCode=$VERSION_CODE -Psuffix=$SUFFIX -Pwivrn_css=$CSS -Pwivrn_app_name="$APPNAME" -Pwivrn_compress_glb=ON assemble${{ matrix.hmd }}${{ matrix.buildtype }}
./gradlew \
-Pwivrn_version=$VERSION \
-Pwivrn_versionCode=$VERSION_CODE \
-Psuffix=$SUFFIX \
-Pwivrn_css=$CSS \
-Pwivrn_app_name="$APPNAME" \
-Pwivrn_compress_glb=ON \
-Pfetchcontent_base_dir=${{github.workspace}}/cmake-fetch \
assemble${{ matrix.hmd }}${{ matrix.buildtype }}
- name: Upload build dir
uses: actions/upload-artifact@v4