CI: Cache asset downloading

Assets are downloaded from a single server which doesn't have enough bandwidth for 20 concurrent downloads
This commit is contained in:
SirLynix 2024-01-24 12:00:07 +01:00
parent 830e167027
commit 88ae92baa0
6 changed files with 90 additions and 0 deletions

View File

@ -95,10 +95,25 @@ jobs:
path: ${{ env.XMAKE_GLOBALDIR }}/.xmake/packages
key: ${{ steps.restore-depcache.outputs.cache-primary-key }}
# Cache assets downloading
- name: Restore cached assets
id: restore-assets
uses: actions/cache/restore@v3
with:
path: assets
key: assets-${{ hashFiles('assets/examples_version.txt', 'assets/unittests_version.txt') }}
# Build the engine
- name: Build Nazara
run: xmake --yes
- name: Save downloaded assets
if: ${{ !steps.restore-assets.outputs.cache-hit }}
uses: actions/cache/save@v3
with:
path: assets
key: ${{ steps.restore-assets.outputs.cache-primary-key }}
# Run unit tests to generate coverage reports
- name: Run unit tests and generate coverage output (Linux)
if: runner.os == 'Linux'

View File

@ -87,10 +87,25 @@ jobs:
path: ${{ env.XMAKE_GLOBALDIR }}/.xmake/packages
key: ${{ steps.restore-depcache.outputs.cache-primary-key }}
# Cache assets downloading
- name: Restore cached assets
id: restore-assets
uses: actions/cache/restore@v3
with:
path: assets
key: assets-${{ hashFiles('assets/examples_version.txt', 'assets/unittests_version.txt') }}
# Build the engine
- name: Build Nazara
run: xmake --yes
- name: Save downloaded assets
if: ${{ !steps.restore-assets.outputs.cache-hit }}
uses: actions/cache/save@v3
with:
path: assets
key: ${{ steps.restore-assets.outputs.cache-primary-key }}
# Run unit tests
- name: Run unit tests
if: matrix.confs.mode != 'releasedbg'

View File

@ -81,10 +81,25 @@ jobs:
path: ${{ env.XMAKE_GLOBALDIR }}/.xmake/packages
key: ${{ steps.restore-depcache.outputs.cache-primary-key }}
# Cache assets downloading
- name: Restore cached assets
id: restore-assets
uses: actions/cache/restore@v3
with:
path: assets
key: assets-${{ hashFiles('assets/examples_version.txt', 'assets/unittests_version.txt') }}
# Build the engine
- name: Build Nazara
run: xmake --yes
- name: Save downloaded assets
if: ${{ !steps.restore-assets.outputs.cache-hit }}
uses: actions/cache/save@v3
with:
path: assets
key: ${{ steps.restore-assets.outputs.cache-primary-key }}
# Run unit tests
- name: Run unit tests
if: matrix.confs.mode != 'releasedbg'

View File

@ -81,10 +81,25 @@ jobs:
path: ${{ env.XMAKE_GLOBALDIR }}/.xmake/packages
key: ${{ steps.restore-depcache.outputs.cache-primary-key }}
# Cache assets downloading
- name: Restore cached assets
id: restore-assets
uses: actions/cache/restore@v3
with:
path: assets
key: assets-${{ hashFiles('assets/examples_version.txt', 'assets/unittests_version.txt') }}
# Build the engine
- name: Build Nazara
run: xmake --yes
- name: Save downloaded assets
if: ${{ !steps.restore-assets.outputs.cache-hit }}
uses: actions/cache/save@v3
with:
path: assets
key: ${{ steps.restore-assets.outputs.cache-primary-key }}
# Run unit tests
- name: Run unit tests
if: matrix.mode != 'releasedbg'

View File

@ -82,10 +82,25 @@ jobs:
path: ${{ env.XMAKE_GLOBALDIR }}/.xmake/packages
key: ${{ steps.restore-depcache.outputs.cache-primary-key }}
# Cache assets downloading
- name: Restore cached assets
id: restore-assets
uses: actions/cache/restore@v3
with:
path: assets
key: assets-${{ hashFiles('assets/examples_version.txt', 'assets/unittests_version.txt') }}
# Build the engine
- name: Build Nazara
run: xmake --yes
- name: Save downloaded assets
if: ${{ !steps.restore-assets.outputs.cache-hit }}
uses: actions/cache/save@v3
with:
path: assets
key: ${{ steps.restore-assets.outputs.cache-primary-key }}
# Install the result files
- name: Install Nazara
if: ${{ (github.ref == 'refs/heads/main') && github.event_name == 'push' }}

View File

@ -76,10 +76,25 @@ jobs:
path: ${{ env.XMAKE_GLOBALDIR }}/.xmake/packages
key: ${{ steps.restore-depcache.outputs.cache-primary-key }}
# Cache assets downloading
- name: Restore cached assets
id: restore-assets
uses: actions/cache/restore@v3
with:
path: assets
key: assets-${{ hashFiles('assets/examples_version.txt', 'assets/unittests_version.txt') }}
# Build the engine
- name: Build Nazara
run: xmake --yes
- name: Save downloaded assets
if: ${{ !steps.restore-assets.outputs.cache-hit }}
uses: actions/cache/save@v3
with:
path: assets
key: ${{ steps.restore-assets.outputs.cache-primary-key }}
# Run unit tests
- name: Run unit tests
if: matrix.mode != 'releasedbg'