From 3deb0a8019e607411bdb94ef45f5bb6e2b2ec218 Mon Sep 17 00:00:00 2001 From: bitsandfoxes Date: Sun, 25 Oct 2026 07:19:53 +0100 Subject: [PATCH 1/7] Key the IntegrationTest Library cache on its inputs instead of the run id --- .github/workflows/ci.yml | 2 +- .github/workflows/test-build-android.yml | 2 +- .github/workflows/test-build-ios.yml | 2 +- .github/workflows/test-build-linux.yml | 7 ++++--- .github/workflows/test-build-macos.yml | 7 ++++--- .github/workflows/test-build-windows-mono.yml | 7 ++++--- .github/workflows/test-build-windows-x86.yml | 7 ++++--- .github/workflows/test-build-windows.yml | 7 ++++--- 8 files changed, 23 insertions(+), 18 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 54f8e98ae..84edd5fd6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -191,7 +191,7 @@ jobs: uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 with: path: samples/IntegrationTest/Library - key: it-library-ubuntu-${{ matrix.unity-version }}-${{ github.run_id }} + key: it-library-ubuntu-${{ matrix.unity-version }}-${{ hashFiles('samples/IntegrationTest/ProjectSettings/ProjectVersion.txt', 'samples/IntegrationTest/Packages/manifest.json', 'test/Scripts.Integration.Test/**') }} restore-keys: | it-library-ubuntu-${{ matrix.unity-version }}- diff --git a/.github/workflows/test-build-android.yml b/.github/workflows/test-build-android.yml index 4c3dce1a2..98588b3a9 100644 --- a/.github/workflows/test-build-android.yml +++ b/.github/workflows/test-build-android.yml @@ -56,7 +56,7 @@ jobs: uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 with: path: samples/IntegrationTest/Library - key: it-library-ubuntu-${{ env.UNITY_VERSION }}-${{ github.run_id }} + key: it-library-ubuntu-${{ env.UNITY_VERSION }}-${{ hashFiles('samples/IntegrationTest/ProjectSettings/ProjectVersion.txt', 'samples/IntegrationTest/Packages/manifest.json', 'test/Scripts.Integration.Test/**') }} restore-keys: | it-library-ubuntu-${{ env.UNITY_VERSION }}- diff --git a/.github/workflows/test-build-ios.yml b/.github/workflows/test-build-ios.yml index 0c19205ff..a6b528e39 100644 --- a/.github/workflows/test-build-ios.yml +++ b/.github/workflows/test-build-ios.yml @@ -62,7 +62,7 @@ jobs: uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 with: path: samples/IntegrationTest/Library - key: it-library-ubuntu-${{ env.UNITY_VERSION }}-${{ github.run_id }} + key: it-library-ubuntu-${{ env.UNITY_VERSION }}-${{ hashFiles('samples/IntegrationTest/ProjectSettings/ProjectVersion.txt', 'samples/IntegrationTest/Packages/manifest.json', 'test/Scripts.Integration.Test/**') }} restore-keys: | it-library-ubuntu-${{ env.UNITY_VERSION }}- diff --git a/.github/workflows/test-build-linux.yml b/.github/workflows/test-build-linux.yml index 2488d1414..a89f567b6 100644 --- a/.github/workflows/test-build-linux.yml +++ b/.github/workflows/test-build-linux.yml @@ -64,10 +64,11 @@ jobs: run: tar -xvzf test-project.tar.gz - name: Restore Unity Library cache + id: cache-library uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 with: path: samples/IntegrationTest/Library - key: it-library-ubuntu-${{ env.UNITY_VERSION }}-${{ github.run_id }} + key: it-library-ubuntu-${{ env.UNITY_VERSION }}-${{ hashFiles('samples/IntegrationTest/ProjectSettings/ProjectVersion.txt', 'samples/IntegrationTest/Packages/manifest.json', 'test/Scripts.Integration.Test/**') }} restore-keys: | it-library-ubuntu-${{ env.UNITY_VERSION }}- @@ -176,11 +177,11 @@ jobs: retention-days: 14 - name: Save Unity Library cache - if: github.ref == 'refs/heads/main' + if: github.ref == 'refs/heads/main' && steps.cache-library.outputs.cache-hit != 'true' uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 with: path: samples/IntegrationTest/Library - key: it-library-ubuntu-${{ env.UNITY_VERSION }}-${{ github.run_id }} + key: ${{ steps.cache-library.outputs.cache-primary-key }} - name: Docker diagnostics on failure if: ${{ failure() }} diff --git a/.github/workflows/test-build-macos.yml b/.github/workflows/test-build-macos.yml index 1677c14ea..62c25610d 100644 --- a/.github/workflows/test-build-macos.yml +++ b/.github/workflows/test-build-macos.yml @@ -43,10 +43,11 @@ jobs: run: tar -xvzf test-project.tar.gz - name: Restore Unity Library cache + id: cache-library uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 with: path: samples/IntegrationTest/Library - key: it-library-macos-${{ env.UNITY_VERSION }}-${{ github.run_id }} + key: it-library-macos-${{ env.UNITY_VERSION }}-${{ hashFiles('samples/IntegrationTest/ProjectSettings/ProjectVersion.txt', 'samples/IntegrationTest/Packages/manifest.json', 'test/Scripts.Integration.Test/**') }} restore-keys: | it-library-macos-${{ env.UNITY_VERSION }}- @@ -159,11 +160,11 @@ jobs: retention-days: 14 - name: Save Unity Library cache - if: github.ref == 'refs/heads/main' + if: github.ref == 'refs/heads/main' && steps.cache-library.outputs.cache-hit != 'true' uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 with: path: samples/IntegrationTest/Library - key: it-library-macos-${{ env.UNITY_VERSION }}-${{ github.run_id }} + key: ${{ steps.cache-library.outputs.cache-primary-key }} - name: Upload IntegrationTest project on failure if: ${{ failure() }} diff --git a/.github/workflows/test-build-windows-mono.yml b/.github/workflows/test-build-windows-mono.yml index 84b4f48b4..2e60a05fc 100644 --- a/.github/workflows/test-build-windows-mono.yml +++ b/.github/workflows/test-build-windows-mono.yml @@ -43,10 +43,11 @@ jobs: run: tar -xvzf test-project.tar.gz - name: Restore Unity Library cache + id: cache-library uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 with: path: samples/IntegrationTest/Library - key: it-library-windows-mono-${{ env.UNITY_VERSION }}-${{ github.run_id }} + key: it-library-windows-mono-${{ env.UNITY_VERSION }}-${{ hashFiles('samples/IntegrationTest/ProjectSettings/ProjectVersion.txt', 'samples/IntegrationTest/Packages/manifest.json', 'test/Scripts.Integration.Test/**') }} restore-keys: | it-library-windows-mono-${{ env.UNITY_VERSION }}- @@ -99,11 +100,11 @@ jobs: retention-days: 14 - name: Save Unity Library cache - if: github.ref == 'refs/heads/main' + if: github.ref == 'refs/heads/main' && steps.cache-library.outputs.cache-hit != 'true' uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 with: path: samples/IntegrationTest/Library - key: it-library-windows-mono-${{ env.UNITY_VERSION }}-${{ github.run_id }} + key: ${{ steps.cache-library.outputs.cache-primary-key }} - name: Upload IntegrationTest project on failure if: ${{ failure() }} diff --git a/.github/workflows/test-build-windows-x86.yml b/.github/workflows/test-build-windows-x86.yml index 0479f343c..1a2356108 100644 --- a/.github/workflows/test-build-windows-x86.yml +++ b/.github/workflows/test-build-windows-x86.yml @@ -43,10 +43,11 @@ jobs: run: tar -xvzf test-project.tar.gz - name: Restore Unity Library cache + id: cache-library uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 with: path: samples/IntegrationTest/Library - key: it-library-windows-x86-${{ env.UNITY_VERSION }}-${{ github.run_id }} + key: it-library-windows-x86-${{ env.UNITY_VERSION }}-${{ hashFiles('samples/IntegrationTest/ProjectSettings/ProjectVersion.txt', 'samples/IntegrationTest/Packages/manifest.json', 'test/Scripts.Integration.Test/**') }} restore-keys: | it-library-windows-x86-${{ env.UNITY_VERSION }}- @@ -111,11 +112,11 @@ jobs: retention-days: 14 - name: Save Unity Library cache - if: github.ref == 'refs/heads/main' + if: github.ref == 'refs/heads/main' && steps.cache-library.outputs.cache-hit != 'true' uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 with: path: samples/IntegrationTest/Library - key: it-library-windows-x86-${{ env.UNITY_VERSION }}-${{ github.run_id }} + key: ${{ steps.cache-library.outputs.cache-primary-key }} - name: Upload IntegrationTest project on failure if: ${{ failure() }} diff --git a/.github/workflows/test-build-windows.yml b/.github/workflows/test-build-windows.yml index cf5f748c9..9ac6b344b 100644 --- a/.github/workflows/test-build-windows.yml +++ b/.github/workflows/test-build-windows.yml @@ -43,10 +43,11 @@ jobs: run: tar -xvzf test-project.tar.gz - name: Restore Unity Library cache + id: cache-library uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 with: path: samples/IntegrationTest/Library - key: it-library-windows-${{ env.UNITY_VERSION }}-${{ github.run_id }} + key: it-library-windows-${{ env.UNITY_VERSION }}-${{ hashFiles('samples/IntegrationTest/ProjectSettings/ProjectVersion.txt', 'samples/IntegrationTest/Packages/manifest.json', 'test/Scripts.Integration.Test/**') }} restore-keys: | it-library-windows-${{ env.UNITY_VERSION }}- @@ -159,11 +160,11 @@ jobs: retention-days: 14 - name: Save Unity Library cache - if: github.ref == 'refs/heads/main' + if: github.ref == 'refs/heads/main' && steps.cache-library.outputs.cache-hit != 'true' uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 with: path: samples/IntegrationTest/Library - key: it-library-windows-${{ env.UNITY_VERSION }}-${{ github.run_id }} + key: ${{ steps.cache-library.outputs.cache-primary-key }} - name: Upload IntegrationTest project on failure if: ${{ failure() }} From 522a7d70a5743b2bccd9de38bece290dbc3f9aab Mon Sep 17 00:00:00 2001 From: bitsandfoxes Date: Sun, 25 Oct 2026 07:19:53 +0100 Subject: [PATCH 2/7] Include the full Unity version in the build-without-Sentry cache keys --- .github/workflows/ci.yml | 4 ++-- .github/workflows/test-build-android.yml | 4 ++-- .github/workflows/test-build-ios.yml | 4 ++-- .github/workflows/test-build-linux.yml | 4 ++-- .github/workflows/test-build-macos.yml | 4 ++-- .github/workflows/test-build-windows.yml | 4 ++-- .github/workflows/test-compile-ios.yml | 4 ++-- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 84edd5fd6..eee0b2693 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -200,7 +200,7 @@ jobs: uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 with: path: samples/IntegrationTest/Build-NoSentry - key: build-nosentry-${{ matrix.build_platform }}-${{ matrix.unity-version }} + key: build-nosentry-${{ matrix.build_platform }}-${{ matrix.unity-version }}-${{ hashFiles('samples/IntegrationTest/ProjectSettings/ProjectVersion.txt') }} - name: Build without Sentry SDK if: steps.cache-build-nosentry.outputs.cache-hit != 'true' @@ -213,7 +213,7 @@ jobs: uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 with: path: samples/IntegrationTest/Build-NoSentry - key: build-nosentry-${{ matrix.build_platform }}-${{ matrix.unity-version }} + key: ${{ steps.cache-build-nosentry.outputs.cache-primary-key }} - name: Download UPM package uses: ./.github/actions/wait-for-artifact diff --git a/.github/workflows/test-build-android.yml b/.github/workflows/test-build-android.yml index 98588b3a9..08eff7133 100644 --- a/.github/workflows/test-build-android.yml +++ b/.github/workflows/test-build-android.yml @@ -65,7 +65,7 @@ jobs: uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 with: path: samples/IntegrationTest/Build-NoSentry - key: build-nosentry-Android-${{ inputs.unity-version }} + key: build-nosentry-Android-${{ inputs.unity-version }}-${{ hashFiles('samples/IntegrationTest/ProjectSettings/ProjectVersion.txt') }} - name: Build without Sentry SDK if: steps.cache-build-nosentry.outputs.cache-hit != 'true' @@ -76,7 +76,7 @@ jobs: uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 with: path: samples/IntegrationTest/Build-NoSentry - key: build-nosentry-Android-${{ inputs.unity-version }} + key: ${{ steps.cache-build-nosentry.outputs.cache-primary-key }} - name: Download UPM package uses: ./.github/actions/wait-for-artifact diff --git a/.github/workflows/test-build-ios.yml b/.github/workflows/test-build-ios.yml index a6b528e39..637123e0d 100644 --- a/.github/workflows/test-build-ios.yml +++ b/.github/workflows/test-build-ios.yml @@ -71,7 +71,7 @@ jobs: uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 with: path: samples/IntegrationTest/Build-NoSentry - key: build-nosentry-iOS-${{ inputs.unity-version }} + key: build-nosentry-iOS-${{ inputs.unity-version }}-${{ hashFiles('samples/IntegrationTest/ProjectSettings/ProjectVersion.txt') }} - name: Build without Sentry SDK if: steps.cache-build-nosentry.outputs.cache-hit != 'true' @@ -82,7 +82,7 @@ jobs: uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 with: path: samples/IntegrationTest/Build-NoSentry - key: build-nosentry-iOS-${{ inputs.unity-version }} + key: ${{ steps.cache-build-nosentry.outputs.cache-primary-key }} - name: Create archive for build without Sentry shell: bash diff --git a/.github/workflows/test-build-linux.yml b/.github/workflows/test-build-linux.yml index a89f567b6..766c67e27 100644 --- a/.github/workflows/test-build-linux.yml +++ b/.github/workflows/test-build-linux.yml @@ -77,7 +77,7 @@ jobs: uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 with: path: samples/IntegrationTest/Build-NoSentry - key: build-nosentry-Linux-${{ inputs.unity-version }} + key: build-nosentry-Linux-${{ inputs.unity-version }}-${{ hashFiles('samples/IntegrationTest/ProjectSettings/ProjectVersion.txt') }} - name: Build without Sentry SDK if: steps.cache-build-nosentry.outputs.cache-hit != 'true' @@ -88,7 +88,7 @@ jobs: uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 with: path: samples/IntegrationTest/Build-NoSentry - key: build-nosentry-Linux-${{ inputs.unity-version }} + key: ${{ steps.cache-build-nosentry.outputs.cache-primary-key }} - name: Download UPM package uses: ./.github/actions/wait-for-artifact diff --git a/.github/workflows/test-build-macos.yml b/.github/workflows/test-build-macos.yml index 62c25610d..6b0564a85 100644 --- a/.github/workflows/test-build-macos.yml +++ b/.github/workflows/test-build-macos.yml @@ -56,7 +56,7 @@ jobs: uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 with: path: samples/IntegrationTest/Build-NoSentry - key: build-nosentry-MacOS-${{ inputs.unity-version }} + key: build-nosentry-MacOS-${{ inputs.unity-version }}-${{ hashFiles('samples/IntegrationTest/ProjectSettings/ProjectVersion.txt') }} - name: Build without Sentry SDK if: steps.cache-build-nosentry.outputs.cache-hit != 'true' @@ -67,7 +67,7 @@ jobs: uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 with: path: samples/IntegrationTest/Build-NoSentry - key: build-nosentry-MacOS-${{ inputs.unity-version }} + key: ${{ steps.cache-build-nosentry.outputs.cache-primary-key }} - name: Download UPM package uses: ./.github/actions/wait-for-artifact diff --git a/.github/workflows/test-build-windows.yml b/.github/workflows/test-build-windows.yml index 9ac6b344b..b748d86de 100644 --- a/.github/workflows/test-build-windows.yml +++ b/.github/workflows/test-build-windows.yml @@ -56,7 +56,7 @@ jobs: uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 with: path: samples/IntegrationTest/Build-NoSentry - key: build-nosentry-Windows-${{ inputs.unity-version }} + key: build-nosentry-Windows-${{ inputs.unity-version }}-${{ hashFiles('samples/IntegrationTest/ProjectSettings/ProjectVersion.txt') }} - name: Build without Sentry SDK if: steps.cache-build-nosentry.outputs.cache-hit != 'true' @@ -67,7 +67,7 @@ jobs: uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 with: path: samples/IntegrationTest/Build-NoSentry - key: build-nosentry-Windows-${{ inputs.unity-version }} + key: ${{ steps.cache-build-nosentry.outputs.cache-primary-key }} - name: Download UPM package uses: ./.github/actions/wait-for-artifact diff --git a/.github/workflows/test-compile-ios.yml b/.github/workflows/test-compile-ios.yml index 3fa80582d..eb42e978e 100644 --- a/.github/workflows/test-compile-ios.yml +++ b/.github/workflows/test-compile-ios.yml @@ -31,7 +31,7 @@ jobs: uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 with: path: IntegrationTest-NoSentry.app - key: build-nosentry-iOS-compiled-${{ inputs.unity-version }} + key: build-nosentry-iOS-compiled-${{ inputs.unity-version }}-${{ hashFiles('scripts/unity-versions.json') }} - name: Download build without Sentry (for size comparison) if: ${{ inputs.init-type == 'runtime' && steps.cache-compiled-nosentry.outputs.cache-hit != 'true' }} @@ -62,7 +62,7 @@ jobs: uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 with: path: IntegrationTest-NoSentry.app - key: build-nosentry-iOS-compiled-${{ inputs.unity-version }} + key: ${{ steps.cache-compiled-nosentry.outputs.cache-primary-key }} - name: Download app project uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 From 53e04913c1ffcea33f6b4276129b46c593a82825 Mon Sep 17 00:00:00 2001 From: bitsandfoxes Date: Sun, 25 Oct 2026 07:19:53 +0100 Subject: [PATCH 3/7] Drop the never-hit IntegrationTest project cache --- .github/workflows/test-create.yml | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/.github/workflows/test-create.yml b/.github/workflows/test-create.yml index 067df280d..0fb666ec9 100644 --- a/.github/workflows/test-create.yml +++ b/.github/workflows/test-create.yml @@ -33,33 +33,15 @@ jobs: username: ${{ env.GITHUB_ACTOR }} password: ${{ secrets.GITHUB_TOKEN }} - - name: Restore IntegrationTest Project cache - id: cache-project - uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 - with: - path: samples/IntegrationTest - key: IntegrationTest-Project-${{ env.UNITY_VERSION }}-${{ hashFiles('test/Scripts.Integration.Test/**') }}-v1 - restore-keys: | - IntegrationTest-Project-${{ env.UNITY_VERSION }}- - - name: Start the Unity docker container - if: steps.cache-project.outputs.cache-hit != 'true' run: ./scripts/ci-docker.sh "$UNITY_VERSION" 'base' "$UNITY_LICENSE_SERVER_CONFIG" shell: bash env: UNITY_LICENSE_SERVER_CONFIG: ${{ secrets.UNITY_LICENSE_SERVER_CONFIG }} - name: Create new Project - if: steps.cache-project.outputs.cache-hit != 'true' run: ./test/Scripts.Integration.Test/create-project.ps1 -UnityPath "$env:UNITY_PATH" - - name: Save IntegrationTest Project cache - if: github.ref == 'refs/heads/main' && steps.cache-project.outputs.cache-hit != 'true' - uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 - with: - path: samples/IntegrationTest - key: IntegrationTest-Project-${{ env.UNITY_VERSION }}-${{ hashFiles('test/Scripts.Integration.Test/**') }}-v1 - # We create tar explicitly because upload-artifact is slow for many files. - name: Create archive run: tar -cvzf test-project.tar.gz samples/IntegrationTest From 10b82937b92b4735dca1e8bcea7bd632a8c09820 Mon Sep 17 00:00:00 2001 From: bitsandfoxes Date: Sun, 25 Oct 2026 07:19:53 +0100 Subject: [PATCH 4/7] Skip the submodule checkout on a native SDK cache hit --- .github/workflows/sdk.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/sdk.yml b/.github/workflows/sdk.yml index d565d5539..ca2ddbd66 100644 --- a/.github/workflows/sdk.yml +++ b/.github/workflows/sdk.yml @@ -42,9 +42,6 @@ jobs: env: SUBMODULES: ${{ steps.env.outputs.submodules }} - - name: Update submobules - run: git submodule update --init --recursive ${{ steps.env.outputs.submodules }} - - run: | if [[ "${{ env.TARGET }}" == "Cocoa" ]]; then cp -r package-dev/Plugins/iOS sdk-static/ || echo "never mind, no iOS files checked in..." @@ -65,6 +62,10 @@ jobs: package-dev/Plugins key: sdk=${{ env.TARGET }}-${{ hashFiles('submodules-status', 'package/package.json', 'Directory.Build.targets', 'build/native-sdks.targets', 'sdk-static/**', 'scripts/build-cocoa-sdk.ps1', 'scripts/build-native-ndk-local.ps1') }} + - name: Update submodules + if: steps.cache.outputs.cache-hit != 'true' + run: git submodule update --init --recursive ${{ steps.env.outputs.submodules }} + - name: Installing Linux Dependencies if: ${{ (env.TARGET == 'Linux' || env.TARGET == 'LinuxNative') && steps.cache.outputs.cache-hit != 'true' }} shell: bash From c699705d6ad92200d675511f264d8806ad841e3f Mon Sep 17 00:00:00 2001 From: bitsandfoxes Date: Sun, 25 Oct 2026 07:22:31 +0100 Subject: [PATCH 5/7] Key the compiled iOS baseline on its own Unity version only --- .github/workflows/test-compile-ios.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-compile-ios.yml b/.github/workflows/test-compile-ios.yml index eb42e978e..d6368ecc3 100644 --- a/.github/workflows/test-compile-ios.yml +++ b/.github/workflows/test-compile-ios.yml @@ -25,13 +25,19 @@ jobs: - name: Checkout uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - name: Resolve Unity version + if: ${{ inputs.init-type == 'runtime' }} + id: unity + shell: bash + run: echo "version=$(jq -r --arg v "$UNITY_VERSION" '.[$v].version' scripts/unity-versions.json)" >> "$GITHUB_OUTPUT" + - name: Restore cached compiled iOS build without Sentry if: ${{ inputs.init-type == 'runtime' }} id: cache-compiled-nosentry uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 with: path: IntegrationTest-NoSentry.app - key: build-nosentry-iOS-compiled-${{ inputs.unity-version }}-${{ hashFiles('scripts/unity-versions.json') }} + key: build-nosentry-iOS-compiled-${{ steps.unity.outputs.version }} - name: Download build without Sentry (for size comparison) if: ${{ inputs.init-type == 'runtime' && steps.cache-compiled-nosentry.outputs.cache-hit != 'true' }} From ee1e0e7a691f7b269010f73d98b5a6b4e6e14567 Mon Sep 17 00:00:00 2001 From: bitsandfoxes Date: Sun, 25 Oct 2026 12:16:47 +0100 Subject: [PATCH 6/7] Save the unity-of-bugs Library cache on main only --- .github/workflows/build.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1412b9590..457777864 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -50,8 +50,9 @@ jobs: $v = (Get-Content scripts/unity-versions.json -Raw | ConvertFrom-Json).'${{ env.UNITY_VERSION }}'.version "unityVersion=$v" >> $env:GITHUB_OUTPUT - - name: Cache Unity Library - uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 + - name: Restore Unity Library cache + id: cache-library + uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 with: path: samples/unity-of-bugs/Library key: Library-unity-of-bugs-${{ steps.env.outputs.unityVersion }}-v1 @@ -190,3 +191,10 @@ jobs: with: name: Test results (editmode) - ${{ env.UNITY_VERSION }} path: artifacts/test/editmode + + - name: Save Unity Library cache + if: github.ref == 'refs/heads/main' && steps.cache-library.outputs.cache-hit != 'true' + uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 + with: + path: samples/unity-of-bugs/Library + key: ${{ steps.cache-library.outputs.cache-primary-key }} From c0dc82227c095be8b88f990a9fb4eca4d6591025 Mon Sep 17 00:00:00 2001 From: bitsandfoxes Date: Sun, 25 Oct 2026 12:21:36 +0100 Subject: [PATCH 7/7] Key the IntegrationTest Library cache only on the files copied into the project --- .github/workflows/ci.yml | 2 +- .github/workflows/test-build-android.yml | 2 +- .github/workflows/test-build-ios.yml | 2 +- .github/workflows/test-build-linux.yml | 2 +- .github/workflows/test-build-macos.yml | 2 +- .github/workflows/test-build-windows-mono.yml | 2 +- .github/workflows/test-build-windows-x86.yml | 2 +- .github/workflows/test-build-windows.yml | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index eee0b2693..ffe88fe82 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -191,7 +191,7 @@ jobs: uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 with: path: samples/IntegrationTest/Library - key: it-library-ubuntu-${{ matrix.unity-version }}-${{ hashFiles('samples/IntegrationTest/ProjectSettings/ProjectVersion.txt', 'samples/IntegrationTest/Packages/manifest.json', 'test/Scripts.Integration.Test/**') }} + key: it-library-ubuntu-${{ matrix.unity-version }}-${{ hashFiles('samples/IntegrationTest/ProjectSettings/ProjectVersion.txt', 'samples/IntegrationTest/Packages/manifest.json', 'test/Scripts.Integration.Test/Editor/**', 'test/Scripts.Integration.Test/Scenes/**', 'test/Scripts.Integration.Test/Scripts/**', 'test/Scripts.Integration.Test/DependencyConflictPackage/**', 'test/Scripts.Integration.Test/create-project.ps1', 'test/Scripts.Integration.Test/add-sentry.ps1') }} restore-keys: | it-library-ubuntu-${{ matrix.unity-version }}- diff --git a/.github/workflows/test-build-android.yml b/.github/workflows/test-build-android.yml index 08eff7133..e9bdada9e 100644 --- a/.github/workflows/test-build-android.yml +++ b/.github/workflows/test-build-android.yml @@ -56,7 +56,7 @@ jobs: uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 with: path: samples/IntegrationTest/Library - key: it-library-ubuntu-${{ env.UNITY_VERSION }}-${{ hashFiles('samples/IntegrationTest/ProjectSettings/ProjectVersion.txt', 'samples/IntegrationTest/Packages/manifest.json', 'test/Scripts.Integration.Test/**') }} + key: it-library-ubuntu-${{ env.UNITY_VERSION }}-${{ hashFiles('samples/IntegrationTest/ProjectSettings/ProjectVersion.txt', 'samples/IntegrationTest/Packages/manifest.json', 'test/Scripts.Integration.Test/Editor/**', 'test/Scripts.Integration.Test/Scenes/**', 'test/Scripts.Integration.Test/Scripts/**', 'test/Scripts.Integration.Test/DependencyConflictPackage/**', 'test/Scripts.Integration.Test/create-project.ps1', 'test/Scripts.Integration.Test/add-sentry.ps1') }} restore-keys: | it-library-ubuntu-${{ env.UNITY_VERSION }}- diff --git a/.github/workflows/test-build-ios.yml b/.github/workflows/test-build-ios.yml index 637123e0d..4fcc7b886 100644 --- a/.github/workflows/test-build-ios.yml +++ b/.github/workflows/test-build-ios.yml @@ -62,7 +62,7 @@ jobs: uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 with: path: samples/IntegrationTest/Library - key: it-library-ubuntu-${{ env.UNITY_VERSION }}-${{ hashFiles('samples/IntegrationTest/ProjectSettings/ProjectVersion.txt', 'samples/IntegrationTest/Packages/manifest.json', 'test/Scripts.Integration.Test/**') }} + key: it-library-ubuntu-${{ env.UNITY_VERSION }}-${{ hashFiles('samples/IntegrationTest/ProjectSettings/ProjectVersion.txt', 'samples/IntegrationTest/Packages/manifest.json', 'test/Scripts.Integration.Test/Editor/**', 'test/Scripts.Integration.Test/Scenes/**', 'test/Scripts.Integration.Test/Scripts/**', 'test/Scripts.Integration.Test/DependencyConflictPackage/**', 'test/Scripts.Integration.Test/create-project.ps1', 'test/Scripts.Integration.Test/add-sentry.ps1') }} restore-keys: | it-library-ubuntu-${{ env.UNITY_VERSION }}- diff --git a/.github/workflows/test-build-linux.yml b/.github/workflows/test-build-linux.yml index 766c67e27..375642a54 100644 --- a/.github/workflows/test-build-linux.yml +++ b/.github/workflows/test-build-linux.yml @@ -68,7 +68,7 @@ jobs: uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 with: path: samples/IntegrationTest/Library - key: it-library-ubuntu-${{ env.UNITY_VERSION }}-${{ hashFiles('samples/IntegrationTest/ProjectSettings/ProjectVersion.txt', 'samples/IntegrationTest/Packages/manifest.json', 'test/Scripts.Integration.Test/**') }} + key: it-library-ubuntu-${{ env.UNITY_VERSION }}-${{ hashFiles('samples/IntegrationTest/ProjectSettings/ProjectVersion.txt', 'samples/IntegrationTest/Packages/manifest.json', 'test/Scripts.Integration.Test/Editor/**', 'test/Scripts.Integration.Test/Scenes/**', 'test/Scripts.Integration.Test/Scripts/**', 'test/Scripts.Integration.Test/DependencyConflictPackage/**', 'test/Scripts.Integration.Test/create-project.ps1', 'test/Scripts.Integration.Test/add-sentry.ps1') }} restore-keys: | it-library-ubuntu-${{ env.UNITY_VERSION }}- diff --git a/.github/workflows/test-build-macos.yml b/.github/workflows/test-build-macos.yml index 6b0564a85..bdb61a6d3 100644 --- a/.github/workflows/test-build-macos.yml +++ b/.github/workflows/test-build-macos.yml @@ -47,7 +47,7 @@ jobs: uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 with: path: samples/IntegrationTest/Library - key: it-library-macos-${{ env.UNITY_VERSION }}-${{ hashFiles('samples/IntegrationTest/ProjectSettings/ProjectVersion.txt', 'samples/IntegrationTest/Packages/manifest.json', 'test/Scripts.Integration.Test/**') }} + key: it-library-macos-${{ env.UNITY_VERSION }}-${{ hashFiles('samples/IntegrationTest/ProjectSettings/ProjectVersion.txt', 'samples/IntegrationTest/Packages/manifest.json', 'test/Scripts.Integration.Test/Editor/**', 'test/Scripts.Integration.Test/Scenes/**', 'test/Scripts.Integration.Test/Scripts/**', 'test/Scripts.Integration.Test/DependencyConflictPackage/**', 'test/Scripts.Integration.Test/create-project.ps1', 'test/Scripts.Integration.Test/add-sentry.ps1') }} restore-keys: | it-library-macos-${{ env.UNITY_VERSION }}- diff --git a/.github/workflows/test-build-windows-mono.yml b/.github/workflows/test-build-windows-mono.yml index 2e60a05fc..dd7bdb763 100644 --- a/.github/workflows/test-build-windows-mono.yml +++ b/.github/workflows/test-build-windows-mono.yml @@ -47,7 +47,7 @@ jobs: uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 with: path: samples/IntegrationTest/Library - key: it-library-windows-mono-${{ env.UNITY_VERSION }}-${{ hashFiles('samples/IntegrationTest/ProjectSettings/ProjectVersion.txt', 'samples/IntegrationTest/Packages/manifest.json', 'test/Scripts.Integration.Test/**') }} + key: it-library-windows-mono-${{ env.UNITY_VERSION }}-${{ hashFiles('samples/IntegrationTest/ProjectSettings/ProjectVersion.txt', 'samples/IntegrationTest/Packages/manifest.json', 'test/Scripts.Integration.Test/Editor/**', 'test/Scripts.Integration.Test/Scenes/**', 'test/Scripts.Integration.Test/Scripts/**', 'test/Scripts.Integration.Test/DependencyConflictPackage/**', 'test/Scripts.Integration.Test/create-project.ps1', 'test/Scripts.Integration.Test/add-sentry.ps1') }} restore-keys: | it-library-windows-mono-${{ env.UNITY_VERSION }}- diff --git a/.github/workflows/test-build-windows-x86.yml b/.github/workflows/test-build-windows-x86.yml index 1a2356108..fe59f7125 100644 --- a/.github/workflows/test-build-windows-x86.yml +++ b/.github/workflows/test-build-windows-x86.yml @@ -47,7 +47,7 @@ jobs: uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 with: path: samples/IntegrationTest/Library - key: it-library-windows-x86-${{ env.UNITY_VERSION }}-${{ hashFiles('samples/IntegrationTest/ProjectSettings/ProjectVersion.txt', 'samples/IntegrationTest/Packages/manifest.json', 'test/Scripts.Integration.Test/**') }} + key: it-library-windows-x86-${{ env.UNITY_VERSION }}-${{ hashFiles('samples/IntegrationTest/ProjectSettings/ProjectVersion.txt', 'samples/IntegrationTest/Packages/manifest.json', 'test/Scripts.Integration.Test/Editor/**', 'test/Scripts.Integration.Test/Scenes/**', 'test/Scripts.Integration.Test/Scripts/**', 'test/Scripts.Integration.Test/DependencyConflictPackage/**', 'test/Scripts.Integration.Test/create-project.ps1', 'test/Scripts.Integration.Test/add-sentry.ps1') }} restore-keys: | it-library-windows-x86-${{ env.UNITY_VERSION }}- diff --git a/.github/workflows/test-build-windows.yml b/.github/workflows/test-build-windows.yml index b748d86de..ccaea085e 100644 --- a/.github/workflows/test-build-windows.yml +++ b/.github/workflows/test-build-windows.yml @@ -47,7 +47,7 @@ jobs: uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 with: path: samples/IntegrationTest/Library - key: it-library-windows-${{ env.UNITY_VERSION }}-${{ hashFiles('samples/IntegrationTest/ProjectSettings/ProjectVersion.txt', 'samples/IntegrationTest/Packages/manifest.json', 'test/Scripts.Integration.Test/**') }} + key: it-library-windows-${{ env.UNITY_VERSION }}-${{ hashFiles('samples/IntegrationTest/ProjectSettings/ProjectVersion.txt', 'samples/IntegrationTest/Packages/manifest.json', 'test/Scripts.Integration.Test/Editor/**', 'test/Scripts.Integration.Test/Scenes/**', 'test/Scripts.Integration.Test/Scripts/**', 'test/Scripts.Integration.Test/DependencyConflictPackage/**', 'test/Scripts.Integration.Test/create-project.ps1', 'test/Scripts.Integration.Test/add-sentry.ps1') }} restore-keys: | it-library-windows-${{ env.UNITY_VERSION }}-