Create separate job to import assets

Uses upload-artifact to share them with other jobs but deletes them when
done.
This commit is contained in:
Leroy Hopson 2023-01-26 07:39:06 +13:00
parent 2ba480b4da
commit 26aa4765d1
No known key found for this signature in database
GPG key ID: D2747312A6DB51AA
2 changed files with 40 additions and 3 deletions

View file

@ -1,7 +1,14 @@
name: Import assets name: Import assets
inputs:
godot-version:
required: true
runs: runs:
using: "composite" using: "composite"
steps: steps:
- name: Setup Godot
uses: lihop/setup-godot@4aad9daa7dd81c11329c4b54fdc26dbd39eea7d6
with:
version: ${{ inputs.godot-version }}
- name: Import assets - name: Import assets
shell: bash shell: bash
run: | run: |

View file

@ -6,6 +6,25 @@ on:
- cron: 0 11 * * * - cron: 0 11 * * *
jobs: jobs:
import_assets:
name: 'Import Assets'
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-22.04 ]
steps:
- uses: actions/checkout@v3
- name: Import assets
uses: ./.github/actions/import-assets
with:
godot-version: v4.0-beta14
- name: Upload imports
uses: actions/upload-artifact@v3
with:
name: imports-${{ matrix.os }}
path: .godot/
build_docker: build_docker:
name: 'Build Docker' name: 'Build Docker'
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
@ -212,7 +231,7 @@ jobs:
test: test:
name: 'Test' name: 'Test'
needs: [ build_docker ] #, build_native ] needs: [ import_assets, build_docker ] #, build_native ]
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
strategy: strategy:
fail-fast: false fail-fast: false
@ -240,14 +259,25 @@ jobs:
with: with:
name: libgodot-xterm-debug name: libgodot-xterm-debug
path: addons/godot_xterm/native/bin path: addons/godot_xterm/native/bin
- name: Import assets - name: Download imports
uses: ./.github/actions/import-assets uses: actions/download-artifact@v3
with:
name: imports-${{ matrix.os }}
path: .godot
- name: Run tests - name: Run tests
run: godot -s addons/gut/gut_cmdln.gd -gconfig=test/.gutconfig.ci.json run: godot -s addons/gut/gut_cmdln.gd -gconfig=test/.gutconfig.ci.json
- name: Run unix tests - name: Run unix tests
if: ${{ matrix.os != 'windows-2022' }} if: ${{ matrix.os != 'windows-2022' }}
run: godot -s addons/gut/gut_cmdln.gd -gconfig=test/.gutconfig.unix.json run: godot -s addons/gut/gut_cmdln.gd -gconfig=test/.gutconfig.unix.json
delete_imports:
name: 'Delete Imports'
needs: [ test ]
runs-on: ubuntu-22.04
steps:
- uses: geekyeggo/delete-artifact@v2
with:
name: imports-*
# Git archive should only include addons/godot_xterm directory. # Git archive should only include addons/godot_xterm directory.
check-archive: check-archive: