mirror of
https://github.com/godotengine/godot.git
synced 2025-10-20 00:13:30 +00:00
Merge pull request #100457 from Repiteo/ci/cache-persistence
CI: Ensure default branch cache persists
This commit is contained in:
commit
937fccf24d
8 changed files with 35 additions and 29 deletions
50
.github/actions/godot-cache-restore/action.yml
vendored
50
.github/actions/godot-cache-restore/action.yml
vendored
|
@ -11,24 +11,42 @@ inputs:
|
||||||
runs:
|
runs:
|
||||||
using: composite
|
using: composite
|
||||||
steps:
|
steps:
|
||||||
|
# Because all branches can refer to the repository's default branch's cache, we want it to
|
||||||
|
# persist as the de-facto fallback. However, it easily expunges in a matter of hours if
|
||||||
|
# nothing explicitly calls to it, so we work around that by ensuring it's *always* pinged
|
||||||
|
# prior to any cache operations.
|
||||||
|
- name: Ping main cache
|
||||||
|
uses: actions/cache/restore@v4
|
||||||
|
id: cache-ping
|
||||||
|
with:
|
||||||
|
path: ${{ inputs.scons-cache }}
|
||||||
|
key: " " # Dummy key; we have to rely on the fallback value.
|
||||||
|
restore-keys: ${{ inputs.cache-name }}|${{ github.event.repository.default_branch }}
|
||||||
|
lookup-only: true
|
||||||
|
|
||||||
|
# Fallback access isn't logged, so register an explicit cache-hit if found.
|
||||||
|
- name: Ping main cache (exact)
|
||||||
|
if: steps.cache-ping.outputs.cache-matched-key
|
||||||
|
uses: actions/cache/restore@v4
|
||||||
|
with:
|
||||||
|
path: ${{ inputs.scons-cache }}
|
||||||
|
key: ${{ steps.cache-ping.outputs.cache-matched-key }}
|
||||||
|
lookup-only: true
|
||||||
|
|
||||||
|
# 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".
|
||||||
|
#
|
||||||
|
# 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.
|
||||||
- name: Restore SCons cache directory
|
- name: Restore SCons cache directory
|
||||||
uses: actions/cache/restore@v4
|
uses: actions/cache/restore@v4
|
||||||
with:
|
with:
|
||||||
path: ${{ inputs.scons-cache }}
|
path: ${{ inputs.scons-cache }}
|
||||||
key: ${{ inputs.cache-name }}-${{ env.GODOT_BASE_BRANCH }}-${{ github.ref }}-${{ github.sha }}
|
key: ${{ inputs.cache-name }}|${{ github.ref_name }}|${{ github.sha }}
|
||||||
|
|
||||||
# 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-refs/heads/master-6588a4a29af1621086feac0117d5d4d37af957fd".
|
|
||||||
#
|
|
||||||
# We check these prefixes in this order:
|
|
||||||
#
|
|
||||||
# 1. The exact match, including the base branch, the commit reference, and the SHA hash of the commit.
|
|
||||||
# 2. A partial match for the same base branch and the same commit reference.
|
|
||||||
# 3. A partial match for the same base branch and the base branch commit reference.
|
|
||||||
# 4. A partial match for the same base branch only (not ideal, matches any PR with the same base branch).
|
|
||||||
|
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ inputs.cache-name }}-${{ env.GODOT_BASE_BRANCH }}-${{ github.ref }}
|
${{ inputs.cache-name }}|${{ github.ref_name }}
|
||||||
${{ inputs.cache-name }}-${{ env.GODOT_BASE_BRANCH }}-refs/heads/${{ env.GODOT_BASE_BRANCH }}
|
${{ inputs.cache-name }}|${{ github.event.repository.default_branch }}
|
||||||
${{ inputs.cache-name }}-${{ env.GODOT_BASE_BRANCH }}
|
|
||||||
|
|
2
.github/actions/godot-cache-save/action.yml
vendored
2
.github/actions/godot-cache-save/action.yml
vendored
|
@ -15,4 +15,4 @@ runs:
|
||||||
uses: actions/cache/save@v4
|
uses: actions/cache/save@v4
|
||||||
with:
|
with:
|
||||||
path: ${{ inputs.scons-cache }}
|
path: ${{ inputs.scons-cache }}
|
||||||
key: ${{ inputs.cache-name }}-${{ env.GODOT_BASE_BRANCH }}-${{ github.ref }}-${{ github.sha }}
|
key: ${{ inputs.cache-name }}|${{ github.ref_name }}|${{ github.sha }}
|
||||||
|
|
2
.github/workflows/android_builds.yml
vendored
2
.github/workflows/android_builds.yml
vendored
|
@ -4,8 +4,6 @@ on:
|
||||||
|
|
||||||
# Global Settings
|
# Global Settings
|
||||||
env:
|
env:
|
||||||
# Used for the cache key. Add version suffix to force clean build.
|
|
||||||
GODOT_BASE_BRANCH: master
|
|
||||||
SCONSFLAGS: verbose=yes warnings=extra werror=yes debug_symbols=no module_text_server_fb_enabled=yes strict_checks=yes
|
SCONSFLAGS: verbose=yes warnings=extra werror=yes debug_symbols=no module_text_server_fb_enabled=yes strict_checks=yes
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
2
.github/workflows/ios_builds.yml
vendored
2
.github/workflows/ios_builds.yml
vendored
|
@ -4,8 +4,6 @@ on:
|
||||||
|
|
||||||
# Global Settings
|
# Global Settings
|
||||||
env:
|
env:
|
||||||
# Used for the cache key. Add version suffix to force clean build.
|
|
||||||
GODOT_BASE_BRANCH: master
|
|
||||||
SCONSFLAGS: verbose=yes warnings=extra werror=yes debug_symbols=no module_text_server_fb_enabled=yes strict_checks=yes
|
SCONSFLAGS: verbose=yes warnings=extra werror=yes debug_symbols=no module_text_server_fb_enabled=yes strict_checks=yes
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
2
.github/workflows/linux_builds.yml
vendored
2
.github/workflows/linux_builds.yml
vendored
|
@ -4,8 +4,6 @@ on:
|
||||||
|
|
||||||
# Global Settings
|
# Global Settings
|
||||||
env:
|
env:
|
||||||
# Used for the cache key. Add version suffix to force clean build.
|
|
||||||
GODOT_BASE_BRANCH: master
|
|
||||||
GODOT_CPP_BRANCH: 4.4
|
GODOT_CPP_BRANCH: 4.4
|
||||||
SCONSFLAGS: verbose=yes warnings=extra werror=yes module_text_server_fb_enabled=yes strict_checks=yes
|
SCONSFLAGS: verbose=yes warnings=extra werror=yes module_text_server_fb_enabled=yes strict_checks=yes
|
||||||
DOTNET_NOLOGO: true
|
DOTNET_NOLOGO: true
|
||||||
|
|
2
.github/workflows/macos_builds.yml
vendored
2
.github/workflows/macos_builds.yml
vendored
|
@ -4,8 +4,6 @@ on:
|
||||||
|
|
||||||
# Global Settings
|
# Global Settings
|
||||||
env:
|
env:
|
||||||
# Used for the cache key. Add version suffix to force clean build.
|
|
||||||
GODOT_BASE_BRANCH: master
|
|
||||||
SCONSFLAGS: verbose=yes warnings=extra werror=yes module_text_server_fb_enabled=yes strict_checks=yes
|
SCONSFLAGS: verbose=yes warnings=extra werror=yes module_text_server_fb_enabled=yes strict_checks=yes
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
2
.github/workflows/web_builds.yml
vendored
2
.github/workflows/web_builds.yml
vendored
|
@ -4,8 +4,6 @@ on:
|
||||||
|
|
||||||
# Global Settings
|
# Global Settings
|
||||||
env:
|
env:
|
||||||
# Used for the cache key. Add version suffix to force clean build.
|
|
||||||
GODOT_BASE_BRANCH: master
|
|
||||||
SCONSFLAGS: verbose=yes warnings=extra werror=yes debug_symbols=no use_closure_compiler=yes strict_checks=yes
|
SCONSFLAGS: verbose=yes warnings=extra werror=yes debug_symbols=no use_closure_compiler=yes strict_checks=yes
|
||||||
EM_VERSION: 3.1.64
|
EM_VERSION: 3.1.64
|
||||||
|
|
||||||
|
|
2
.github/workflows/windows_builds.yml
vendored
2
.github/workflows/windows_builds.yml
vendored
|
@ -5,8 +5,6 @@ on:
|
||||||
# Global Settings
|
# Global Settings
|
||||||
# SCONS_CACHE for windows must be set in the build environment
|
# SCONS_CACHE for windows must be set in the build environment
|
||||||
env:
|
env:
|
||||||
# Used for the cache key. Add version suffix to force clean build.
|
|
||||||
GODOT_BASE_BRANCH: master
|
|
||||||
SCONSFLAGS: verbose=yes warnings=extra werror=yes module_text_server_fb_enabled=yes d3d12=yes strict_checks=yes "angle_libs=${{ github.workspace }}/"
|
SCONSFLAGS: verbose=yes warnings=extra werror=yes module_text_server_fb_enabled=yes d3d12=yes strict_checks=yes "angle_libs=${{ github.workspace }}/"
|
||||||
SCONS_CACHE_MSVC_CONFIG: true
|
SCONS_CACHE_MSVC_CONFIG: true
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue