mirror of
https://github.com/godotengine/godot.git
synced 2026-01-06 10:11:57 +03:00
SCons: Improve cache purging logic
• Implement caching via SCons arguments, rather than environment variables
This commit is contained in:
10
.github/actions/godot-build/action.yml
vendored
10
.github/actions/godot-build/action.yml
vendored
@@ -18,12 +18,12 @@ inputs:
|
||||
required: false
|
||||
scons-cache:
|
||||
description: The SCons cache path.
|
||||
default: ${{ github.workspace }}/.scons-cache/
|
||||
default: ${{ github.workspace }}/.scons_cache/
|
||||
scons-cache-limit:
|
||||
description: The SCons cache size limit.
|
||||
# actions/cache has 10 GiB limit, and GitHub runners have a 14 GiB disk.
|
||||
# Limit to 7 GiB to avoid having the extracted cache fill the disk.
|
||||
default: 7168
|
||||
default: 7
|
||||
|
||||
runs:
|
||||
using: composite
|
||||
@@ -32,10 +32,8 @@ runs:
|
||||
shell: sh
|
||||
env:
|
||||
SCONSFLAGS: ${{ inputs.sconsflags }}
|
||||
SCONS_CACHE: ${{ inputs.scons-cache }}
|
||||
SCONS_CACHE_LIMIT: ${{ inputs.scons-cache-limit }}
|
||||
run: |
|
||||
echo "Building with flags:" platform=${{ inputs.platform }} target=${{ inputs.target }} tests=${{ inputs.tests }} ${{ env.SCONSFLAGS }}
|
||||
echo "Building with flags:" platform=${{ inputs.platform }} target=${{ inputs.target }} tests=${{ inputs.tests }} ${{ env.SCONSFLAGS }} "cache_path=${{ inputs.scons-cache }}" cache_limit=${{ inputs.scons-cache-limit }}
|
||||
|
||||
if [ "${{ inputs.target }}" != "editor" ]; then
|
||||
# Ensure we don't include editor code in export template builds.
|
||||
@@ -49,5 +47,5 @@ runs:
|
||||
export BUILD_NAME="gh"
|
||||
fi
|
||||
|
||||
scons platform=${{ inputs.platform }} target=${{ inputs.target }} tests=${{ inputs.tests }} ${{ env.SCONSFLAGS }}
|
||||
scons platform=${{ inputs.platform }} target=${{ inputs.target }} tests=${{ inputs.tests }} ${{ env.SCONSFLAGS }} "cache_path=${{ inputs.scons-cache }}" cache_limit=${{ inputs.scons-cache-limit }}
|
||||
ls -l bin/
|
||||
|
||||
@@ -6,7 +6,7 @@ inputs:
|
||||
default: ${{ github.job }}
|
||||
scons-cache:
|
||||
description: The SCons cache path.
|
||||
default: ${{ github.workspace }}/.scons-cache/
|
||||
default: ${{ github.workspace }}/.scons_cache/
|
||||
|
||||
runs:
|
||||
using: composite
|
||||
@@ -29,7 +29,6 @@ runs:
|
||||
# 4. A partial match for the same base branch only (not ideal, matches any PR with the same base branch).
|
||||
|
||||
restore-keys: |
|
||||
${{ inputs.cache-name }}-${{ env.GODOT_BASE_BRANCH }}-${{ github.ref }}-${{ github.sha }}
|
||||
${{ inputs.cache-name }}-${{ env.GODOT_BASE_BRANCH }}-${{ github.ref }}
|
||||
${{ inputs.cache-name }}-${{ env.GODOT_BASE_BRANCH }}-refs/heads/${{ env.GODOT_BASE_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
@@ -6,7 +6,7 @@ inputs:
|
||||
default: ${{ github.job }}
|
||||
scons-cache:
|
||||
description: The SCons cache path.
|
||||
default: ${{ github.workspace }}/.scons-cache/
|
||||
default: ${{ github.workspace }}/.scons_cache/
|
||||
|
||||
runs:
|
||||
using: composite
|
||||
|
||||
3
.github/workflows/godot_cpp_test.yml
vendored
3
.github/workflows/godot_cpp_test.yml
vendored
@@ -52,9 +52,6 @@ jobs:
|
||||
# continue-on-error: true
|
||||
|
||||
- name: Build godot-cpp test extension
|
||||
env: # Keep synced with godot-build.
|
||||
SCONS_CACHE: ${{ github.workspace }}/.scons-cache/
|
||||
SCONS_CACHE_LIMIT: 7168
|
||||
run: scons --directory=./godot-cpp/test target=template_debug dev_build=yes verbose=yes
|
||||
|
||||
# - name: Save Godot build cache
|
||||
|
||||
Reference in New Issue
Block a user