diff --git a/.github/actions/godot-cache-restore/action.yml b/.github/actions/godot-cache-restore/action.yml index 0b3687fb99cf..de92df36088a 100644 --- a/.github/actions/godot-cache-restore/action.yml +++ b/.github/actions/godot-cache-restore/action.yml @@ -36,17 +36,15 @@ runs: # We try to match an existing cache to restore from it. Each potential key is checked against # all existing caches as a prefix. E.g. 'linux-template-minimal' would match any cache that # starts with "linux-template-minimal", such as - # "linux-template-minimal|master|6588a4a29af1621086feac0117d5d4d37af957fd". + # "linux-template-minimal|master". # # We check these prefixes in this order: - # 1. An exact match for the base branch, reference name, and SHA hash. - # 2. A partial match for the same cache name and reference name. - # 3. A partial match for the same cache name and default branch name. + # 1. An exact match for the same cache name and reference name. + # 2. A partial match for the same cache name and default branch name. - name: Restore SCons cache directory uses: actions/cache/restore@v4 with: path: ${{ inputs.scons-cache }} - key: ${{ inputs.cache-name }}|${{ github.ref_name }}|${{ github.sha }} + key: ${{ inputs.cache-name }}|${{ github.ref_name }} restore-keys: | - ${{ inputs.cache-name }}|${{ github.ref_name }} ${{ inputs.cache-name }}|${{ github.event.repository.default_branch }} diff --git a/.github/actions/godot-cache-save/action.yml b/.github/actions/godot-cache-save/action.yml index 6ec735a18f81..43f263f5e83b 100644 --- a/.github/actions/godot-cache-save/action.yml +++ b/.github/actions/godot-cache-save/action.yml @@ -15,4 +15,4 @@ runs: uses: actions/cache/save@v4 with: path: ${{ inputs.scons-cache }} - key: ${{ inputs.cache-name }}|${{ github.ref_name }}|${{ github.sha }} + key: ${{ inputs.cache-name }}|${{ github.ref_name }} diff --git a/.github/workflows/android_builds.yml b/.github/workflows/android_builds.yml index a489bc1393c6..e7fad9ebc217 100644 --- a/.github/workflows/android_builds.yml +++ b/.github/workflows/android_builds.yml @@ -48,12 +48,6 @@ jobs: distribution: temurin java-version: 17 - - name: Restore Godot build cache - uses: ./.github/actions/godot-cache-restore - with: - cache-name: ${{ matrix.cache-name }} - continue-on-error: true - - name: Setup Python and SCons uses: ./.github/actions/godot-deps @@ -68,6 +62,12 @@ jobs: - name: Extract pre-built Android Swappy Frame Pacing Library run: 7za x -y swappy/godot-swappy.7z -o${{github.workspace}}/thirdparty/swappy-frame-pacing + - name: Restore Godot build cache + uses: ./.github/actions/godot-cache-restore + with: + cache-name: ${{ matrix.cache-name }} + continue-on-error: true + - name: Compilation uses: ./.github/actions/godot-build with: @@ -78,6 +78,7 @@ jobs: scons-cache-limit: ${{ matrix.cache-limit }} - name: Save Godot build cache + if: always() uses: ./.github/actions/godot-cache-save with: cache-name: ${{ matrix.cache-name }} diff --git a/.github/workflows/ios_builds.yml b/.github/workflows/ios_builds.yml index 3e79df4fcb9c..513dcf877ae4 100644 --- a/.github/workflows/ios_builds.yml +++ b/.github/workflows/ios_builds.yml @@ -18,13 +18,13 @@ jobs: with: submodules: recursive + - name: Setup Python and SCons + uses: ./.github/actions/godot-deps + - name: Restore Godot build cache uses: ./.github/actions/godot-cache-restore continue-on-error: true - - name: Setup Python and SCons - uses: ./.github/actions/godot-deps - - name: Compilation (arm64) uses: ./.github/actions/godot-build with: @@ -35,6 +35,7 @@ jobs: scons-cache-limit: 1 - name: Save Godot build cache + if: always() uses: ./.github/actions/godot-cache-save continue-on-error: true diff --git a/.github/workflows/linux_builds.yml b/.github/workflows/linux_builds.yml index 4479fe989e82..4c511aabfc93 100644 --- a/.github/workflows/linux_builds.yml +++ b/.github/workflows/linux_builds.yml @@ -128,12 +128,6 @@ jobs: sudo rm -rf /usr/local/lib/android echo "Disk usage after:" && df -h - - name: Restore Godot build cache - uses: ./.github/actions/godot-cache-restore - with: - cache-name: ${{ matrix.cache-name }} - continue-on-error: true - - name: Setup Python and SCons if: "!matrix.legacy-scons" uses: ./.github/actions/godot-deps @@ -158,6 +152,12 @@ jobs: # Targeting the oldest version we want to support to ensure it still builds. dotnet-version: 8.0.100 + - name: Restore Godot build cache + uses: ./.github/actions/godot-cache-restore + with: + cache-name: ${{ matrix.cache-name }} + continue-on-error: true + - name: Compilation uses: ./.github/actions/godot-build with: @@ -176,6 +176,7 @@ jobs: godot-cpp-branch: ${{ env.GODOT_CPP_BRANCH }} - name: Save Godot build cache + if: always() uses: ./.github/actions/godot-cache-save with: cache-name: ${{ matrix.cache-name }} diff --git a/.github/workflows/macos_builds.yml b/.github/workflows/macos_builds.yml index 272639f77588..e40132a4e326 100644 --- a/.github/workflows/macos_builds.yml +++ b/.github/workflows/macos_builds.yml @@ -36,15 +36,16 @@ jobs: with: submodules: recursive + - name: Setup Python and SCons + uses: ./.github/actions/godot-deps + - name: Restore Godot build cache uses: ./.github/actions/godot-cache-restore with: cache-name: ${{ matrix.cache-name }} continue-on-error: true - - name: Setup Python and SCons - uses: ./.github/actions/godot-deps - + # This also gets cached. - name: Setup Vulkan SDK run: | sh misc/scripts/install_vulkan_sdk_macos.sh @@ -68,6 +69,7 @@ jobs: scons-cache-limit: ${{ matrix.cache-limit }} - name: Save Godot build cache + if: always() uses: ./.github/actions/godot-cache-save with: cache-name: ${{ matrix.cache-name }} diff --git a/.github/workflows/web_builds.yml b/.github/workflows/web_builds.yml index 2a3451307d8f..df4c4ab56ee5 100644 --- a/.github/workflows/web_builds.yml +++ b/.github/workflows/web_builds.yml @@ -46,15 +46,15 @@ jobs: run: | emcc -v + - name: Setup Python and SCons + uses: ./.github/actions/godot-deps + - name: Restore Godot build cache uses: ./.github/actions/godot-cache-restore with: cache-name: ${{ matrix.cache-name }} continue-on-error: true - - name: Setup Python and SCons - uses: ./.github/actions/godot-deps - - name: Compilation uses: ./.github/actions/godot-build with: @@ -65,6 +65,7 @@ jobs: scons-cache-limit: 0.5 - name: Save Godot build cache + if: always() uses: ./.github/actions/godot-cache-save with: cache-name: ${{ matrix.cache-name }} diff --git a/.github/workflows/windows_builds.yml b/.github/workflows/windows_builds.yml index 6395ffb96e89..c702b20a0b65 100644 --- a/.github/workflows/windows_builds.yml +++ b/.github/workflows/windows_builds.yml @@ -62,12 +62,6 @@ jobs: with: submodules: recursive - - name: Restore Godot build cache - uses: ./.github/actions/godot-cache-restore - with: - cache-name: ${{ matrix.cache-name }} - continue-on-error: true - - name: Setup Python and SCons uses: ./.github/actions/godot-deps @@ -85,6 +79,12 @@ jobs: - name: Extract pre-built ANGLE static libraries run: Expand-Archive -Force angle/angle.zip ${{ github.workspace }}/ + - name: Restore Godot build cache + uses: ./.github/actions/godot-cache-restore + with: + cache-name: ${{ matrix.cache-name }} + continue-on-error: true + - name: Compilation uses: ./.github/actions/godot-build with: @@ -95,6 +95,7 @@ jobs: scons-cache-limit: ${{ matrix.cache-limit }} - name: Save Godot build cache + if: always() uses: ./.github/actions/godot-cache-save with: cache-name: ${{ matrix.cache-name }}