Merge branch 'github-workflows'

This commit is contained in:
Serhii Snitsaruk 2023-09-14 13:54:44 +02:00
commit 22f2529b08
3 changed files with 48 additions and 17 deletions

View File

@ -177,6 +177,15 @@ jobs:
chmod +x ./bin/godot.*
mkdir -p ${{env.OUTDIR}}
mv ./bin/godot.* ${{env.OUTDIR}}
ls -R out/
- name: Rename templates
if: startsWith(matrix.target, 'template')
env:
BUILD_TYPE: ${{ endsWith(matrix.target, 'release') && 'release' || 'debug' }}
run: |
mv out/templates/${BIN} out/templates/linux_${BUILD_TYPE}.${{matrix.arch}}
ls -R out/
- name: Upload artifact
uses: actions/upload-artifact@v3

View File

@ -1,4 +1,4 @@
name: 🔧 Test builds
name: 🔧 Test Builds
on:
workflow_dispatch:
@ -22,7 +22,7 @@ on:
env:
GODOT_TREEISH: 4.1.1-stable
SCONS_CACHE_MSVC_CONFIG: true
SCONS_CACHE_LIMIT: 4096
SCONS_CACHE_LIMIT: 7168
SCONSFLAGS: verbose=yes warnings=extra werror=yes
DOTNET_NOLOGO: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
@ -38,29 +38,33 @@ jobs:
- name: 🐧 Editor (x86_64, debug) + Tests
target: editor
arch: x86_64
production: false
dev_build: true
tests: true
sconsflags: devbuild=yes debug_symbols=yes
- name: 🐧 Editor (x86_64, release)
target: editor
arch: x86_64
production: true
dev_build: false
tests: false
sconsflags: production=yes
- name: 🐧 Template (x86_64, release)
target: template_release
arch: x86_64
production: true
dev_build: false
tests: false
sconsflags: production=yes
- name: 🐧 Template (x86_64, debug)
target: template_debug
arch: x86_64
production: true
dev_build: false
tests: false
sconsflags: production=yes
env:
BIN: godot.linuxbsd.${{matrix.target}}.${{matrix.arch}}
BIN: godot.linuxbsd.${{matrix.target}}${{ matrix.dev_build == true && '.dev' || '' }}.${{matrix.arch}}
steps:
- name: Clone Godot
@ -108,19 +112,24 @@ jobs:
${{env.BIN}}-${{env.GODOT_TREEISH}}-${{github.ref}}-${{github.sha}}
${{env.BIN}}-${{env.GODOT_TREEISH}}-${{github.ref}}
${{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}} tests=${{matrix.tests}} ${{matrix.sconsflags}} ${{env.SCONSFLAGS}}
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: |
strip ./bin/godot.*
chmod +x ./bin/godot.*
mkdir -p ${{env.OUTDIR}}
mv ./bin/godot.* ${{env.OUTDIR}}
@ -128,7 +137,7 @@ jobs:
- name: Upload artifact
uses: actions/upload-artifact@v3
env:
NAME_EDITOR: ${{env.NAME_PREFIX}}.${{matrix.target}}.linux.${{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 }}
@ -137,9 +146,11 @@ jobs:
- 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
./out/${{ env.BIN }} --headless --test --test-case="*[LimboAI]*"
windows-dot-net:
runs-on: "windows-latest"
@ -151,14 +162,14 @@ jobs:
- name: 🪟 Editor .NET (x86_64, release)
target: editor
arch: x86_64
production: true
build-mono: true
sconsflags: production=yes
- name: 🪟 Template .NET (x86_64, release)
target: template_release
arch: x86_64
production: true
build-mono: true
sconsflags: production=yes
env:
BIN: godot.windows.${{matrix.target}}.${{matrix.arch}}${{ matrix.build-mono == true && '.mono' || '' }}
@ -208,7 +219,7 @@ jobs:
env:
SCONS_CACHE: ${{github.workspace}}/.scons_cache/
run: |
scons -j2 platform=windows target=${{matrix.target}} arch=${{matrix.arch}} module_mono_enabled=${{matrix.build-mono}} ${{matrix.sconsflags}} ${{env.SCONSFLAGS}}
scons -j2 platform=windows target=${{matrix.target}} arch=${{matrix.arch}} production=${{matrix.production}} module_mono_enabled=${{matrix.build-mono}} ${{env.SCONSFLAGS}}
- name: Generate C# glue
if: matrix.build-mono && matrix.target == 'editor'
@ -236,7 +247,7 @@ jobs:
- name: Upload artifact
uses: actions/upload-artifact@v3
env:
NAME_EDITOR: ${{env.NAME_PREFIX}}.${{matrix.target}}.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 }}

View File

@ -90,7 +90,7 @@ jobs:
- name: Template .NET (x86_32, release)
target: template_release
arch: x86_64
arch: x86_32
build-mono: true
- name: Template .NET (x86_32, debug)
@ -169,8 +169,19 @@ jobs:
OUTDIR: ${{ startsWith(matrix.target, 'template') && 'out/templates' || 'out/' }}
run: |
rm -f bin/*.{exp,lib,pdb}
mkdir -p out/templates/
mkdir -p ${{env.OUTDIR}}
mv bin/* ${{env.OUTDIR}}
ls -R out/
- name: Rename templates
if: startsWith(matrix.target, 'template')
shell: bash
env:
BUILD_TYPE: ${{ endsWith(matrix.target, 'release') && 'release' || 'debug' }}
run: |
mv out/templates/${BIN}.exe out/templates/windows_${BUILD_TYPE}_${{matrix.arch}}.exe
mv out/templates/${BIN}.console.exe out/templates/windows_${BUILD_TYPE}_${{matrix.arch}}_console.exe
ls -R out/
- name: Upload artifact
uses: actions/upload-artifact@v3