Skip to content

Commit

Permalink
Backported: [CI] Upload build cache before running tests.
Browse files Browse the repository at this point in the history
- AThousandShips
godotengine/godot@078210b
  • Loading branch information
Relintai committed Jul 20, 2024
1 parent af8675a commit c01fe31
Show file tree
Hide file tree
Showing 12 changed files with 83 additions and 27 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Setup Pandemonium build cache
description: Setup Pandemonium build cache.
name: Restore Pandemonium build cache
description: Restore Pandemonium build cache.
inputs:
cache-name:
description: The cache base name (job name by default).
Expand All @@ -10,9 +10,8 @@ inputs:
runs:
using: "composite"
steps:
# Upload cache on completion and check it out now
- name: Load .scons_cache directory
uses: actions/cache@v4
- name: Restore .scons_cache directory
uses: actions/cache/restore@v4
with:
path: ${{inputs.scons-cache}}
key: ${{inputs.cache-name}}-${{env.PANDEMONIUM_BASE_BRANCH}}-${{github.ref}}-${{github.sha}}
Expand Down
17 changes: 17 additions & 0 deletions .github/actions/pandemonium-cache-save/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Save Pandemonium build cache
description: Save Pandemonium 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.PANDEMONIUM_BASE_BRANCH}}-${{github.ref}}-${{github.sha}}
8 changes: 6 additions & 2 deletions .github/workflows/android_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ jobs:
distribution: temurin
java-version: 17

- name: Setup Pandemonium build cache
uses: ./.github/actions/pandemonium-cache
- name: Restore Pandemonium build cache
uses: ./.github/actions/pandemonium-cache-restore
continue-on-error: true

- name: Setup python and scons
Expand All @@ -55,6 +55,10 @@ jobs:
target: release
tools: false

- name: Save Pandemonium build cache
uses: ./.github/actions/pandemonium-cache-save
continue-on-error: true

- name: Generate Pandemonium templates
run: |
cd platform/android/java
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/android_editor_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ jobs:
distribution: temurin
java-version: 17

- name: Setup Pandemonium build cache
uses: ./.github/actions/pandemonium-cache
- name: Restore Pandemonium build cache
uses: ./.github/actions/pandemonium-cache-restore
continue-on-error: true

- name: Setup python and scons
Expand All @@ -54,6 +54,10 @@ jobs:
platform: android
target: release_debug
tools: true

- name: Save Pandemonium build cache
uses: ./.github/actions/pandemonium-cache-save
continue-on-error: true

- name: Generate Pandemonium Editor APK
run: |
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/http_server_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ jobs:
libxinerama-dev libgl1-mesa-dev libglu-dev libasound2-dev libpulse-dev \
libdbus-1-dev libudev-dev libxi-dev libxrandr-dev yasm xvfb wget unzip
- name: Setup Pandemonium build cache
uses: ./.github/actions/pandemonium-cache
- name: Restore Pandemonium build cache
uses: ./.github/actions/pandemonium-cache-restore
with:
cache-name: ${{ matrix.cache-name }}
continue-on-error: true
Expand All @@ -61,6 +61,10 @@ jobs:
platform: server
target: ${{ matrix.target }}
tools: ${{ matrix.tools }}

- name: Save Pandemonium build cache
uses: ./.github/actions/pandemonium-cache-save
continue-on-error: true

- name: Prepare artifact
if: ${{ matrix.artifact }}
Expand All @@ -72,4 +76,4 @@ jobs:
uses: ./.github/actions/upload-artifact
if: ${{ matrix.artifact }}
with:
name: ${{ matrix.cache-name }}
name: ${{ matrix.cache-name }}
8 changes: 6 additions & 2 deletions .github/workflows/ios_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Setup Pandemonium build cache
uses: ./.github/actions/pandemonium-cache
- name: Restore Pandemonium build cache
uses: ./.github/actions/pandemonium-cache-restore
continue-on-error: true

- name: Setup python and scons
Expand All @@ -33,6 +33,10 @@ jobs:
platform: iphone
target: release
tools: false

- name: Save Pandemonium build cache
uses: ./.github/actions/pandemonium-cache-save
continue-on-error: true

- name: Upload artifact
uses: ./.github/actions/upload-artifact
8 changes: 6 additions & 2 deletions .github/workflows/javascript_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ jobs:
run: |
emcc -v
- name: Setup Pandemonium build cache
uses: ./.github/actions/pandemonium-cache
- name: Restore Pandemonium build cache
uses: ./.github/actions/pandemonium-cache-restore
continue-on-error: true

- name: Setup python and scons
Expand All @@ -46,5 +46,9 @@ jobs:
target: release
tools: false

- name: Save Pandemonium build cache
uses: ./.github/actions/pandemonium-cache-save
continue-on-error: true

- name: Upload artifact
uses: ./.github/actions/upload-artifact
8 changes: 6 additions & 2 deletions .github/workflows/linux_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ jobs:
sudo rm -rf /usr/local/lib/android
echo "Disk usage after:" && df -h
- name: Setup Pandemonium build cache
uses: ./.github/actions/pandemonium-cache
- name: Restore Pandemonium build cache
uses: ./.github/actions/pandemonium-cache-restore
with:
cache-name: ${{ matrix.cache-name }}
continue-on-error: true
Expand All @@ -78,6 +78,10 @@ jobs:
target: ${{ matrix.target }}
tools: ${{ matrix.tools }}

- name: Save Pandemonium build cache
uses: ./.github/actions/pandemonium-cache-save
continue-on-error: true

- name: Prepare artifact
if: ${{ matrix.artifact }}
run: |
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/macos_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Setup Pandemonium build cache
uses: ./.github/actions/pandemonium-cache
- name: Restore Pandemonium build cache
uses: ./.github/actions/pandemonium-cache-restore
with:
cache-name: ${{ matrix.cache-name }}
continue-on-error: true
Expand All @@ -49,6 +49,10 @@ jobs:
target: ${{ matrix.target }}
tools: ${{ matrix.tools }}

- name: Save Pandemonium build cache
uses: ./.github/actions/pandemonium-cache-save
continue-on-error: true

- name: Prepare artifact
run: |
strip bin/pandemonium.*
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/server_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ jobs:
libxinerama-dev libgl1-mesa-dev libglu-dev libasound2-dev libpulse-dev \
libdbus-1-dev libudev-dev libxi-dev libxrandr-dev yasm xvfb wget unzip
- name: Setup Pandemonium build cache
uses: ./.github/actions/pandemonium-cache
- name: Restore Pandemonium build cache
uses: ./.github/actions/pandemonium-cache-restore
with:
cache-name: ${{ matrix.cache-name }}
continue-on-error: true
Expand All @@ -68,8 +68,12 @@ jobs:
strip bin/pandemonium_server.*
chmod +x bin/pandemonium_server.*
- name: Save Pandemonium build cache
uses: ./.github/actions/pandemonium-cache-save
continue-on-error: true

- name: Upload artifact
uses: ./.github/actions/upload-artifact
if: ${{ matrix.artifact }}
with:
name: ${{ matrix.cache-name }}
name: ${{ matrix.cache-name }}
8 changes: 6 additions & 2 deletions .github/workflows/windows_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Setup Pandemonium build cache
uses: ./.github/actions/pandemonium-cache
- name: Restore Pandemonium build cache
uses: ./.github/actions/pandemonium-cache-restore
with:
cache-name: ${{ matrix.cache-name }}
continue-on-error: true
Expand All @@ -53,6 +53,10 @@ jobs:
target: ${{ matrix.target }}
tools: ${{ matrix.tools }}

- name: Save Pandemonium build cache
uses: ./.github/actions/pandemonium-cache-save
continue-on-error: true

- name: Prepare artifact
run: |
Remove-Item bin/* -Include *.exp,*.lib,*.pdb -Force
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/windows_x86_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Setup Pandemonium build cache
uses: ./.github/actions/pandemonium-cache
- name: Restore Pandemonium build cache
uses: ./.github/actions/pandemonium-cache-restore
with:
cache-name: ${{ matrix.cache-name }}
continue-on-error: true
Expand All @@ -58,6 +58,10 @@ jobs:
target: ${{ matrix.target }}
tools: ${{ matrix.tools }}

- name: Save Pandemonium build cache
uses: ./.github/actions/pandemonium-cache-save
continue-on-error: true

- name: Prepare artifact
run: |
Remove-Item bin/* -Include *.exp,*.lib,*.pdb -Force
Expand Down

0 comments on commit c01fe31

Please sign in to comment.