Backported: [CI] Upload build cache before running tests.

- AThousandShips
078210bce1
This commit is contained in:
Relintai 2024-07-20 21:07:55 +02:00
parent af8675ac6b
commit c01fe31aaa
12 changed files with 83 additions and 27 deletions

View File

@ -1,5 +1,5 @@
name: Setup Pandemonium build cache name: Restore Pandemonium build cache
description: Setup Pandemonium build cache. description: Restore Pandemonium 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.PANDEMONIUM_BASE_BRANCH}}-${{github.ref}}-${{github.sha}} key: ${{inputs.cache-name}}-${{env.PANDEMONIUM_BASE_BRANCH}}-${{github.ref}}-${{github.sha}}

View File

@ -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}}

View File

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

View File

@ -32,8 +32,8 @@ jobs:
distribution: temurin distribution: temurin
java-version: 17 java-version: 17
- name: Setup Pandemonium build cache - name: Restore Pandemonium build cache
uses: ./.github/actions/pandemonium-cache uses: ./.github/actions/pandemonium-cache-restore
continue-on-error: true continue-on-error: true
- name: Setup python and scons - name: Setup python and scons
@ -54,6 +54,10 @@ jobs:
platform: android platform: android
target: release_debug target: release_debug
tools: true tools: true
- name: Save Pandemonium build cache
uses: ./.github/actions/pandemonium-cache-save
continue-on-error: true
- name: Generate Pandemonium Editor APK - name: Generate Pandemonium Editor APK
run: | run: |

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 Pandemonium build cache - name: Restore Pandemonium build cache
uses: ./.github/actions/pandemonium-cache uses: ./.github/actions/pandemonium-cache-restore
with: with:
cache-name: ${{ matrix.cache-name }} cache-name: ${{ matrix.cache-name }}
continue-on-error: true continue-on-error: true
@ -61,6 +61,10 @@ jobs:
platform: server platform: server
target: ${{ matrix.target }} target: ${{ matrix.target }}
tools: ${{ matrix.tools }} tools: ${{ matrix.tools }}
- name: Save Pandemonium build cache
uses: ./.github/actions/pandemonium-cache-save
continue-on-error: true
- name: Prepare artifact - name: Prepare artifact
if: ${{ matrix.artifact }} if: ${{ matrix.artifact }}
@ -72,4 +76,4 @@ jobs:
uses: ./.github/actions/upload-artifact uses: ./.github/actions/upload-artifact
if: ${{ matrix.artifact }} if: ${{ matrix.artifact }}
with: with:
name: ${{ matrix.cache-name }} name: ${{ matrix.cache-name }}

View File

@ -19,8 +19,8 @@ jobs:
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Setup Pandemonium build cache - name: Restore Pandemonium build cache
uses: ./.github/actions/pandemonium-cache uses: ./.github/actions/pandemonium-cache-restore
continue-on-error: true continue-on-error: true
- name: Setup python and scons - name: Setup python and scons
@ -33,6 +33,10 @@ jobs:
platform: iphone platform: iphone
target: release target: release
tools: false tools: false
- name: Save Pandemonium build cache
uses: ./.github/actions/pandemonium-cache-save
continue-on-error: true
- name: Upload artifact - name: Upload artifact
uses: ./.github/actions/upload-artifact uses: ./.github/actions/upload-artifact

View File

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

View File

@ -61,8 +61,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 Pandemonium build cache - name: Restore Pandemonium build cache
uses: ./.github/actions/pandemonium-cache uses: ./.github/actions/pandemonium-cache-restore
with: with:
cache-name: ${{ matrix.cache-name }} cache-name: ${{ matrix.cache-name }}
continue-on-error: true continue-on-error: true
@ -78,6 +78,10 @@ jobs:
target: ${{ matrix.target }} target: ${{ matrix.target }}
tools: ${{ matrix.tools }} tools: ${{ matrix.tools }}
- name: Save Pandemonium build cache
uses: ./.github/actions/pandemonium-cache-save
continue-on-error: true
- name: Prepare artifact - name: Prepare artifact
if: ${{ matrix.artifact }} if: ${{ matrix.artifact }}
run: | run: |

View File

@ -32,8 +32,8 @@ jobs:
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Setup Pandemonium build cache - name: Restore Pandemonium build cache
uses: ./.github/actions/pandemonium-cache uses: ./.github/actions/pandemonium-cache-restore
with: with:
cache-name: ${{ matrix.cache-name }} cache-name: ${{ matrix.cache-name }}
continue-on-error: true continue-on-error: true
@ -49,6 +49,10 @@ jobs:
target: ${{ matrix.target }} target: ${{ matrix.target }}
tools: ${{ matrix.tools }} tools: ${{ matrix.tools }}
- name: Save Pandemonium build cache
uses: ./.github/actions/pandemonium-cache-save
continue-on-error: true
- name: Prepare artifact - name: Prepare artifact
run: | run: |
strip bin/pandemonium.* strip bin/pandemonium.*

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 Pandemonium build cache - name: Restore Pandemonium build cache
uses: ./.github/actions/pandemonium-cache uses: ./.github/actions/pandemonium-cache-restore
with: with:
cache-name: ${{ matrix.cache-name }} cache-name: ${{ matrix.cache-name }}
continue-on-error: true continue-on-error: true
@ -68,8 +68,12 @@ jobs:
strip bin/pandemonium_server.* strip bin/pandemonium_server.*
chmod +x 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 - name: Upload artifact
uses: ./.github/actions/upload-artifact uses: ./.github/actions/upload-artifact
if: ${{ matrix.artifact }} if: ${{ matrix.artifact }}
with: with:
name: ${{ matrix.cache-name }} name: ${{ matrix.cache-name }}

View File

@ -36,8 +36,8 @@ jobs:
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Setup Pandemonium build cache - name: Restore Pandemonium build cache
uses: ./.github/actions/pandemonium-cache uses: ./.github/actions/pandemonium-cache-restore
with: with:
cache-name: ${{ matrix.cache-name }} cache-name: ${{ matrix.cache-name }}
continue-on-error: true continue-on-error: true
@ -53,6 +53,10 @@ jobs:
target: ${{ matrix.target }} target: ${{ matrix.target }}
tools: ${{ matrix.tools }} tools: ${{ matrix.tools }}
- name: Save Pandemonium build cache
uses: ./.github/actions/pandemonium-cache-save
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

View File

@ -36,8 +36,8 @@ jobs:
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Setup Pandemonium build cache - name: Restore Pandemonium build cache
uses: ./.github/actions/pandemonium-cache uses: ./.github/actions/pandemonium-cache-restore
with: with:
cache-name: ${{ matrix.cache-name }} cache-name: ${{ matrix.cache-name }}
continue-on-error: true continue-on-error: true
@ -58,6 +58,10 @@ jobs:
target: ${{ matrix.target }} target: ${{ matrix.target }}
tools: ${{ matrix.tools }} tools: ${{ matrix.tools }}
- name: Save Pandemonium build cache
uses: ./.github/actions/pandemonium-cache-save
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