Merge pull request #94470 from AThousandShips/cache_improve_3_x

[3.x] [CI] Upload build cache before running tests
This commit is contained in:
Rémi Verschelde 2024-07-17 15:23:24 +02:00 committed by GitHub
commit 863ab17e9c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 71 additions and 19 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@v4
uses: actions/cache@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}}-${{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

@ -33,8 +33,8 @@ jobs:
distribution: temurin distribution: temurin
java-version: 17 java-version: 17
- name: Setup Godot build cache - name: Restore Godot build cache
uses: ./.github/actions/godot-cache uses: ./.github/actions/godot-cache-restore
continue-on-error: true continue-on-error: true
- name: Setup python and scons - name: Setup python and scons
@ -56,6 +56,10 @@ jobs:
target: release target: release
tools: false tools: false
- name: Save Godot build cache
uses: ./.github/actions/godot-cache-save
continue-on-error: true
- name: Generate Godot templates - name: Generate Godot templates
run: | run: |
cd platform/android/java cd platform/android/java

View file

@ -20,8 +20,8 @@ jobs:
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Setup Godot build cache - name: Restore Godot build cache
uses: ./.github/actions/godot-cache uses: ./.github/actions/godot-cache-restore
continue-on-error: true continue-on-error: true
- name: Setup python and scons - name: Setup python and scons
@ -35,5 +35,9 @@ jobs:
target: release target: release
tools: false tools: false
- name: Save Godot build cache
uses: ./.github/actions/godot-cache-save
continue-on-error: true
- name: Upload artifact - name: Upload artifact
uses: ./.github/actions/upload-artifact uses: ./.github/actions/upload-artifact

View file

@ -33,8 +33,8 @@ jobs:
run: | run: |
emcc -v emcc -v
- name: Setup Godot build cache - name: Restore Godot build cache
uses: ./.github/actions/godot-cache uses: ./.github/actions/godot-cache-restore
continue-on-error: true continue-on-error: true
- name: Setup python and scons - name: Setup python and scons
@ -48,5 +48,9 @@ jobs:
target: release target: release
tools: false tools: false
- name: Save Godot build cache
uses: ./.github/actions/godot-cache-save
continue-on-error: true
- name: Upload artifact - name: Upload artifact
uses: ./.github/actions/upload-artifact uses: ./.github/actions/upload-artifact

View file

@ -78,8 +78,8 @@ jobs:
sudo rm -rf /usr/local/lib/android sudo rm -rf /usr/local/lib/android
echo "Disk usage after:" && df -h echo "Disk usage after:" && df -h
- 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
@ -98,6 +98,12 @@ jobs:
target: ${{ matrix.target }} target: ${{ matrix.target }}
tools: ${{ matrix.tools }} tools: ${{ matrix.tools }}
- name: Save Godot build cache
uses: ./.github/actions/godot-cache-save
with:
cache-name: ${{ matrix.cache-name }}
continue-on-error: true
# Generate mono glue # Generate mono glue
- name: Generate Mono glue code - name: Generate Mono glue code
if: ${{ matrix.build-mono }} if: ${{ matrix.build-mono }}

View file

@ -34,8 +34,8 @@ jobs:
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- 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
@ -51,6 +51,12 @@ jobs:
target: ${{ matrix.target }} target: ${{ matrix.target }}
tools: ${{ matrix.tools }} tools: ${{ matrix.tools }}
- name: Save Godot build cache
uses: ./.github/actions/godot-cache-save
with:
cache-name: ${{ matrix.cache-name }}
continue-on-error: true
- name: Prepare artifact - name: Prepare artifact
run: | run: |
strip bin/godot.* strip bin/godot.*

View file

@ -45,8 +45,8 @@ jobs:
libxinerama-dev libgl1-mesa-dev libglu-dev libasound2-dev libpulse-dev \ libxinerama-dev libgl1-mesa-dev libglu-dev libasound2-dev libpulse-dev \
libdbus-1-dev libudev-dev libxi-dev libxrandr-dev yasm xvfb wget unzip libdbus-1-dev libudev-dev libxi-dev libxrandr-dev yasm xvfb wget unzip
- 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
@ -61,3 +61,9 @@ jobs:
platform: server platform: server
target: ${{ matrix.target }} target: ${{ matrix.target }}
tools: ${{ matrix.tools }} tools: ${{ matrix.tools }}
- name: Save Godot build cache
uses: ./.github/actions/godot-cache-save
with:
cache-name: ${{ matrix.cache-name }}
continue-on-error: true

View file

@ -37,8 +37,8 @@ jobs:
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- 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
@ -57,6 +57,12 @@ jobs:
target: ${{ matrix.target }} target: ${{ matrix.target }}
tools: ${{ matrix.tools }} tools: ${{ matrix.tools }}
- name: Save Godot build cache
uses: ./.github/actions/godot-cache-save
with:
cache-name: ${{ matrix.cache-name }}
continue-on-error: true
- name: Prepare artifact - name: Prepare artifact
run: | run: |
Remove-Item bin/* -Include *.exp,*.lib,*.pdb -Force Remove-Item bin/* -Include *.exp,*.lib,*.pdb -Force