GHA: New "Test builds" workflow

Rewritten to be able to run all unit tests.
This commit is contained in:
Serhii Snitsaruk 2023-09-15 10:49:33 +02:00
parent 46e45c6cfb
commit f7380db6a2
2 changed files with 47 additions and 108 deletions

View File

@ -1,4 +1,4 @@
name: 🔗 All Builds
name: 🔗 All builds
on:
workflow_dispatch:
inputs:

View File

@ -1,4 +1,4 @@
name: 🔧 Test Builds
name: 🔎 Test builds
on:
workflow_dispatch:
@ -18,12 +18,11 @@ on:
- "**/*.png"
- "demo/*"
# Global Settings
# Global settings
env:
GODOT_TREEISH: 4.1.1-stable
SCONS_CACHE_MSVC_CONFIG: true
SCONS_CACHE_LIMIT: 7168
SCONSFLAGS: verbose=yes warnings=extra werror=yes
SCONS_CACHE_LIMIT: 7168
DOTNET_NOLOGO: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
@ -35,12 +34,14 @@ jobs:
fail-fast: false
matrix:
include:
- name: 🐧 Editor (x86_64, debug) + Tests
- name: 🐧 Unit tests
target: editor
arch: x86_64
production: false
dev_build: true
tests: true
build-mono: false
artifact: false
- name: 🐧 Editor (x86_64, release)
target: editor
@ -48,6 +49,8 @@ jobs:
production: true
dev_build: false
tests: false
build-mono: false
artifact: true
- name: 🐧 Template (x86_64, release)
target: template_release
@ -55,6 +58,8 @@ jobs:
production: true
dev_build: false
tests: false
build-mono: false
artifact: true
- name: 🐧 Template (x86_64, debug)
target: template_debug
@ -62,9 +67,11 @@ jobs:
production: true
dev_build: false
tests: false
build-mono: false
artifact: true
env:
BIN: godot.linuxbsd.${{matrix.target}}${{ matrix.dev_build == true && '.dev' || '' }}.${{matrix.arch}}
BIN: godot.linuxbsd.${{matrix.target}}${{matrix.dev_build == true && '.dev' || ''}}.${{matrix.arch}}${{matrix.build-mono == true && '.mono' || ''}}
steps:
- name: Clone Godot
@ -114,81 +121,6 @@ jobs:
${{env.BIN}}-${{env.GODOT_TREEISH}}
continue-on-error: true
- name: Compilation
env:
SCONS_CACHE: ${{github.workspace}}/.scons_cache/
run: |
PATH=${GITHUB_WORKSPACE}/buildroot/bin:$PATH
scons platform=linuxbsd target=${{matrix.target}} arch=${{matrix.arch}} production=${{matrix.production}} dev_build=${{matrix.dev_build}} tests=${{matrix.tests}} ${{env.SCONSFLAGS}}
ls -l bin/
- name: Strip binaries
if: matrix.dev_build == false
run: strip ./bin/godot.*
- name: Prepare artifact
env:
OUTDIR: ${{ startsWith(matrix.target, 'template') && 'out/templates' || 'out/' }}
run: |
chmod +x ./bin/godot.*
mkdir -p ${{env.OUTDIR}}
mv ./bin/godot.* ${{env.OUTDIR}}
- name: Upload artifact
uses: actions/upload-artifact@v3
env:
NAME_EDITOR: ${{env.NAME_PREFIX}}.${{matrix.target}}${{matrix.dev_build == true && '.dev' || ''}}.linux.${{matrix.arch}}${{matrix.build-mono == true && '.mono' || ''}}
NAME_TEMPLATES: ${{env.NAME_PREFIX}}.export-templates${{ matrix.build-mono == true && '.mono' || '' }}
with:
name: ${{ startsWith(matrix.target, 'template') && env.NAME_TEMPLATES || env.NAME_EDITOR }}
path: out/*
- name: Unit Tests
if: ${{ matrix.tests }}
run: |
echo "Disk usage before tests:" && df -h
ls out/
./out/${{ env.BIN }} --version
./out/${{ env.BIN }} --help
./out/${{ env.BIN }} --headless --test --test-case="*[LimboAI]*"
windows-dot-net:
runs-on: "windows-latest"
name: ${{ matrix.name }}
strategy:
fail-fast: false
matrix:
include:
- name: 🪟 Editor .NET (x86_64, release)
target: editor
arch: x86_64
production: true
build-mono: true
- name: 🪟 Template .NET (x86_64, release)
target: template_release
arch: x86_64
production: true
build-mono: true
env:
BIN: godot.windows.${{matrix.target}}.${{matrix.arch}}${{ matrix.build-mono == true && '.mono' || '' }}
steps:
- name: Clone Godot
uses: actions/checkout@v3
with:
repository: godotengine/godot
ref: ${{ env.GODOT_TREEISH }}
- name: Clone LimboAI module
uses: actions/checkout@v3
with:
path: modules/limboai
# Inits GODOT_VERSION, LIMBOAI_VERSION and NAME_PREFIX environment variables.
- uses: ./modules/limboai/.github/actions/init-version
- name: Set up Python 3.x
uses: actions/setup-python@v4
with:
@ -202,52 +134,59 @@ jobs:
python --version
scons --version
- name: Set up MSVC problem matcher
uses: ammaraskar/msvc-problem-matcher@master
- name: Set up scons cache
uses: actions/cache@v3
- name: Set up .NET SDK
if: matrix.build-mono
uses: actions/setup-dotnet@v2
with:
path: ${{github.workspace}}/.scons_cache/
key: ${{env.BIN}}-${{env.GODOT_TREEISH}}-${{github.ref}}-${{github.sha}}
restore-keys: |
${{env.BIN}}-${{env.GODOT_TREEISH}}-${{github.ref}}-${{github.sha}}
${{env.BIN}}-${{env.GODOT_TREEISH}}-${{github.ref}}
${{env.BIN}}-${{env.GODOT_TREEISH}}
dotnet-version: '6.0.x'
- name: Setup GCC problem matcher
uses: ammaraskar/gcc-problem-matcher@master
- name: Compilation
env:
SCONS_CACHE: ${{github.workspace}}/.scons_cache/
run: |
scons -j2 platform=windows target=${{matrix.target}} arch=${{matrix.arch}} production=${{matrix.production}} module_mono_enabled=${{matrix.build-mono}} ${{env.SCONSFLAGS}}
PATH=${GITHUB_WORKSPACE}/buildroot/bin:$PATH
scons platform=linuxbsd target=${{matrix.target}} arch=${{matrix.arch}} production=${{matrix.production}} dev_build=${{matrix.dev_build}} tests=${{matrix.tests}} ${{env.SCONSFLAGS}}
ls -l bin/
- name: Generate C# glue
if: matrix.build-mono && matrix.target == 'editor'
env:
GODOT_VERSION_STATUS: limboai
if: matrix.build-mono
run: |
./bin/${{ env.BIN }} --headless --generate-mono-glue ./modules/mono/glue || true
bin/${{ env.BIN }} --headless --generate-mono-glue ./modules/mono/glue || true
- name: Build .NET solutions
if: matrix.build-mono && matrix.target == 'editor'
env:
GODOT_VERSION_STATUS: limboai
if: matrix.build-mono
run: |
python ./modules/mono/build_scripts/build_assemblies.py --godot-output-dir=./bin --godot-platform=windows
./modules/mono/build_scripts/build_assemblies.py --godot-output-dir=./bin --godot-platform=linuxbsd
# Execute unit tests for the editor
- name: Unit tests
if: matrix.tests
run: |
bin/${{ env.BIN }} --version
bin/${{ env.BIN }} --help
bin/${{ env.BIN }} --test --headless
- name: Strip binaries
if: matrix.dev_build == false
run: strip ./bin/godot.*
- name: Prepare artifact
shell: bash
if: matrix.artifact
env:
OUTDIR: ${{ startsWith(matrix.target, 'template') && 'out/templates' || 'out/' }}
run: |
rm -f bin/*.{exp,lib,pdb}
mkdir -p out/templates/
mv bin/* ${{env.OUTDIR}}
chmod +x ./bin/godot.*
mkdir -p ${{env.OUTDIR}}
mv ./bin/godot.* ${{env.OUTDIR}}
- name: Upload artifact
if: matrix.artifact
uses: actions/upload-artifact@v3
env:
NAME_EDITOR: ${{env.NAME_PREFIX}}.${{matrix.target}}${{matrix.dev_build == true && '.dev' || ''}}.windows.${{matrix.arch}}${{matrix.build-mono == true && '.mono' || ''}}
NAME_EDITOR: ${{env.NAME_PREFIX}}.${{matrix.target}}${{matrix.dev_build == true && '.dev' || ''}}.linux.${{matrix.arch}}${{matrix.build-mono == true && '.mono' || ''}}
NAME_TEMPLATES: ${{env.NAME_PREFIX}}.export-templates${{matrix.build-mono == true && '.mono' || ''}}
with:
name: ${{ startsWith(matrix.target, 'template') && env.NAME_TEMPLATES || env.NAME_EDITOR }}