[CI] Upload build cache before running tests

pull/1519/head
A Thousand Ships 2024-07-13 16:24:13 +02:00
parent 6d939e6878
commit 76b38de01a
No known key found for this signature in database
GPG Key ID: 2033189A662F8BD7
3 changed files with 29 additions and 7 deletions

View File

@ -1,5 +1,5 @@
name: Setup Godot build cache name: Restore Godot build cache
description: Setup Godot build cache. description: Restore Godot build cache.
inputs: inputs:
cache-name: cache-name:
description: The cache base name (job name by default). description: The cache base name (job name by default).
@ -10,9 +10,8 @@ inputs:
runs: runs:
using: "composite" using: "composite"
steps: steps:
# Upload cache on completion and check it out now - name: Restore .scons_cache directory
- name: Load .scons_cache directory uses: actions/cache/restore@v3
uses: actions/cache@v3
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}}-${{env.GODOT_BASE_BRANCH}}-${{github.ref}}-${{github.sha}}

View File

@ -0,0 +1,17 @@
name: Save Godot build cache
description: Save Godot build cache.
inputs:
cache-name:
description: The cache base name (job name by default).
default: "${{github.job}}"
scons-cache:
description: The SCons cache path.
default: "${{github.workspace}}/.scons-cache/"
runs:
using: "composite"
steps:
- name: Save SCons cache directory
uses: actions/cache/save@v4
with:
path: ${{inputs.scons-cache}}
key: ${{inputs.cache-name}}-${{env.GODOT_BASE_BRANCH}}-${{github.ref}}-${{github.sha}}

View File

@ -99,8 +99,8 @@ jobs:
with: with:
submodules: recursive submodules: recursive
- name: Setup Godot build cache - name: Restore Godot build cache
uses: ./.github/actions/godot-cache uses: ./.github/actions/godot-cache-restore
with: with:
cache-name: ${{ matrix.cache-name }} cache-name: ${{ matrix.cache-name }}
continue-on-error: true continue-on-error: true
@ -153,6 +153,12 @@ jobs:
cd test cd test
scons platform=${{ matrix.platform }} verbose=yes target=template_release ${{ matrix.flags }} scons platform=${{ matrix.platform }} verbose=yes target=template_release ${{ matrix.flags }}
- name: Save Godot build cache
uses: ./.github/actions/godot-cache-save
with:
cache-name: ${{ matrix.cache-name }}
continue-on-error: true
- name: Download latest Godot artifacts - name: Download latest Godot artifacts
uses: dsnopek/action-download-artifact@1322f74e2dac9feed2ee76a32d9ae1ca3b4cf4e9 uses: dsnopek/action-download-artifact@1322f74e2dac9feed2ee76a32d9ae1ca3b4cf4e9
if: ${{ matrix.run-tests && env.GODOT_TEST_VERSION == 'master' }} if: ${{ matrix.run-tests && env.GODOT_TEST_VERSION == 'master' }}