diff options
| author | kraibse <33869366+kraibse@users.noreply.github.com> | 2026-10-31 12:32:25 +0100 |
|---|---|---|
| committer | kraibse <33869366+kraibse@users.noreply.github.com> | 2026-10-31 13:27:45 +0100 |
| commit | cb506729ecfbbb5c5aa25dad578de809eb3371a5 (patch) | |
| tree | e96d609383e0b145ba09f15d9f6d669889623f7b /.github/workflows/release-binaries.yml | |
| parent | 62914241a27bc2c269a96977ead9971737b458ad (diff) | |
ci: enhance caching for build processes with ccache and sccache suggested in #43
Diffstat (limited to '.github/workflows/release-binaries.yml')
| -rw-r--r-- | .github/workflows/release-binaries.yml | 44 |
1 files changed, 40 insertions, 4 deletions
diff --git a/.github/workflows/release-binaries.yml b/.github/workflows/release-binaries.yml index 6ba5350b8c..4cdc691528 100644 --- a/.github/workflows/release-binaries.yml +++ b/.github/workflows/release-binaries.yml @@ -29,6 +29,10 @@ jobs: build: name: ${{ matrix.platform }} binary runs-on: ${{ matrix.runner }} + env: + CCACHE_DIR: ${{ github.workspace }}/.ccache + CCACHE_MAXSIZE: 1500M + SCCACHE_DIR: ${{ github.workspace }}/.sccache strategy: fail-fast: false matrix: @@ -65,7 +69,7 @@ jobs: libswscale-dev pkg-config zlib1g-dev libva-dev libvdpau-dev \ spirv-tools spirv-headers libusb-1.0-0-dev \ libboost-dev libboost-fiber-dev libboost-context-dev \ - libopus-dev libasound2-dev + libopus-dev libasound2-dev ccache - name: Install Qt on Linux if: startsWith(matrix.platform, 'linux') @@ -122,6 +126,18 @@ jobs: modules: qtcharts cache: true + # MSVC is not something ccache handles well, so that job uses sccache. The other jobs use + # ccache, which CMake enables through USE_CCACHE (externals/cmake-modules/UseCcache.cmake). + - name: Install sccache on Windows + if: matrix.platform == 'windows-x86_64' + shell: pwsh + run: | + $zip = Join-Path $env:RUNNER_TEMP 'sccache.zip' + Invoke-WebRequest -OutFile $zip https://github.com/mozilla/sccache/releases/download/v0.19.0/sccache-v0.19.0-x86_64-pc-windows-msvc.zip + Expand-Archive $zip -DestinationPath (Join-Path $env:RUNNER_TEMP 'sccache') + $bin = (Get-ChildItem -Recurse -Filter sccache.exe (Join-Path $env:RUNNER_TEMP 'sccache')).DirectoryName + $bin | Out-File -Append -Encoding utf8 $env:GITHUB_PATH + - name: Install Vulkan SDK on Windows if: matrix.platform == 'windows-x86_64' shell: pwsh @@ -148,7 +164,7 @@ jobs: openssl:p boost:p fmt:p lz4:p nlohmann-json:p zlib:p zstd:p libiconv:p vulkan-memory-allocator:p vulkan-devel:p glslang:p enet:p opus:p libusb:p unordered_dense:p jbigkit:p xz:p libdeflate:p bzip2:p - lerc:p graphite2:p libwebp:p libtiff:p brotli:p + lerc:p graphite2:p libwebp:p libtiff:p brotli:p ccache:p - name: Cache CPM downloads uses: actions/cache@v4 @@ -158,6 +174,18 @@ jobs: restore-keys: | cpm-${{ runner.os }}- + # The sha in the key makes every run save a fresh cache (actions/cache never saves over an + # exact hit), and restore-keys seeds it from the newest one of the same platform. + - name: Cache compiler objects + uses: actions/cache@v4 + with: + path: | + .ccache + .sccache + key: objects-${{ matrix.platform }}-${{ github.sha }} + restore-keys: | + objects-${{ matrix.platform }}- + - name: Configure Linux if: startsWith(matrix.platform, 'linux') shell: bash @@ -177,6 +205,7 @@ jobs: -DVulkanUtilityLibraries_FORCE_BUNDLED=ON -DENABLE_UPDATE_CHECKER=OFF -DUSE_DISCORD_PRESENCE=OFF + -DUSE_CCACHE=ON ) if [ '${{ matrix.pgo }}' = 'true' ]; then # Same flags Eden's CI passes for its clang PGO build. @@ -207,6 +236,8 @@ jobs: -DYUZU_USE_BUNDLED_SDL3=ON -DENABLE_UPDATE_CHECKER=OFF -DUSE_DISCORD_PRESENCE=OFF + -DCMAKE_C_COMPILER_LAUNCHER=sccache + -DCMAKE_CXX_COMPILER_LAUNCHER=sccache # MinGW build: system Qt and libraries from MSYS2, clang plus Eden's PGO profile. The profile # path is converted to its Windows form because clang runs with the MSYS mount underneath. @@ -231,6 +262,7 @@ jobs: -DVulkanUtilityLibraries_FORCE_BUNDLED=ON \ -DENABLE_UPDATE_CHECKER=OFF \ -DUSE_DISCORD_PRESENCE=OFF \ + -DUSE_CCACHE=ON \ -DCMAKE_C_COMPILER=clang \ -DCMAKE_CXX_COMPILER=clang++ \ -DCMAKE_EXE_LINKER_FLAGS=-fuse-ld=lld \ @@ -240,12 +272,16 @@ jobs: - name: Build if: ${{ ! matrix.mingw }} shell: bash - run: cmake --build build/release --target yuzu yuzu-cmd --parallel + run: | + cmake --build build/release --target yuzu yuzu-cmd --parallel + if command -v ccache > /dev/null; then ccache --show-stats; else sccache --show-stats; fi - name: Build MinGW PGO if: matrix.mingw shell: msys2 {0} - run: cmake --build build/release --target yuzu yuzu-cmd --parallel + run: | + cmake --build build/release --target yuzu yuzu-cmd --parallel + ccache --show-stats # A self-contained AppImage: linuxdeploy bundles every library the two programs need except # the base system ones (glibc, X11/Wayland client libraries, the GPU driver and Vulkan loader), |
