GHA: Add a Windows editor build to test builds

This commit is contained in:
Serhii Snitsaruk 2023-12-29 13:10:26 +01:00
parent 7fc3831384
commit 044de6eea0
3 changed files with 69 additions and 28 deletions

View File

@ -77,6 +77,7 @@ jobs:
with: with:
godot-treeish: ${{ needs.cache-sha.outputs.godot-sha }} godot-treeish: ${{ needs.cache-sha.outputs.godot-sha }}
limboai-treeish: ${{ needs.cache-sha.outputs.limboai-sha }} limboai-treeish: ${{ needs.cache-sha.outputs.limboai-sha }}
test-build: false
web-build: web-build:
name: 🌐 Web name: 🌐 Web

View File

@ -10,6 +10,11 @@ on:
- "**/*.png" - "**/*.png"
- "demo/*" - "demo/*"
- "doc/*" - "doc/*"
inputs:
godot-treeish:
description: A tag, branch or commit hash in the Godot repository.
type: string
default: 4.2.1-stable
pull_request: pull_request:
branches: [ master ] branches: [ master ]
@ -18,10 +23,14 @@ on:
- "LICENSE" - "LICENSE"
- "**/*.png" - "**/*.png"
- "demo/*" - "demo/*"
inputs:
godot-treeish:
description: A tag, branch or commit hash in the Godot repository.
type: string
default: 4.2.1-stable
# Global settings # Global settings
env: env:
GODOT_TREEISH: 4.2-stable
SCONSFLAGS: verbose=yes warnings=extra werror=yes SCONSFLAGS: verbose=yes warnings=extra werror=yes
SCONS_CACHE_LIMIT: 7168 SCONS_CACHE_LIMIT: 7168
DOTNET_NOLOGO: true DOTNET_NOLOGO: true
@ -62,14 +71,14 @@ jobs:
build-mono: false build-mono: false
artifact: true artifact: true
- name: 🐧 Template (x86_64, debug) # - name: 🐧 Template (x86_64, debug)
target: template_debug # target: template_debug
arch: x86_64 # arch: x86_64
production: true # production: true
dev_build: false # dev_build: false
tests: false # tests: false
build-mono: false # build-mono: false
artifact: true # artifact: true
env: env:
BIN: godot.linuxbsd.${{matrix.target}}${{matrix.dev_build == true && '.dev' || ''}}.${{matrix.arch}}${{matrix.build-mono == true && '.mono' || ''}} BIN: godot.linuxbsd.${{matrix.target}}${{matrix.dev_build == true && '.dev' || ''}}.${{matrix.arch}}${{matrix.build-mono == true && '.mono' || ''}}
@ -79,7 +88,7 @@ jobs:
uses: actions/checkout@v4 uses: actions/checkout@v4
with: with:
repository: godotengine/godot repository: godotengine/godot
ref: ${{ env.GODOT_TREEISH }} ref: ${{ inputs.godot-treeish }}
- name: Clone LimboAI module - name: Clone LimboAI module
uses: actions/checkout@v4 uses: actions/checkout@v4
@ -115,11 +124,11 @@ jobs:
uses: actions/cache@v3 uses: actions/cache@v3
with: with:
path: ${{github.workspace}}/.scons_cache/ path: ${{github.workspace}}/.scons_cache/
key: ${{env.BIN}}-${{env.GODOT_TREEISH}}-${{github.ref}}-${{github.sha}} key: ${{env.BIN}}-${{inputs.godot-treeish}}-${{github.ref}}-${{github.sha}}
restore-keys: | restore-keys: |
${{env.BIN}}-${{env.GODOT_TREEISH}}-${{github.ref}}-${{github.sha}} ${{env.BIN}}-${{inputs.godot-treeish}}-${{github.ref}}-${{github.sha}}
${{env.BIN}}-${{env.GODOT_TREEISH}}-${{github.ref}} ${{env.BIN}}-${{inputs.godot-treeish}}-${{github.ref}}
${{env.BIN}}-${{env.GODOT_TREEISH}} ${{env.BIN}}-${{inputs.godot-treeish}}
continue-on-error: true continue-on-error: true
- name: Set up Python 3.x - name: Set up Python 3.x
@ -192,3 +201,11 @@ jobs:
with: with:
name: ${{ startsWith(matrix.target, 'template') && env.NAME_TEMPLATES || env.NAME_EDITOR }} name: ${{ startsWith(matrix.target, 'template') && env.NAME_TEMPLATES || env.NAME_EDITOR }}
path: out/* path: out/*
windows-test-build:
name: 🪟 Windows test build
uses: ./.github/workflows/windows.yml
with:
godot-treeish: ${{ inputs.godot-treeish }}
limboai-treeish: ${{ github.sha }}
test-build: true

View File

@ -10,6 +10,10 @@ on:
description: A tag, branch or commit hash in the LimboAI repository. description: A tag, branch or commit hash in the LimboAI repository.
type: string type: string
default: master default: master
test-build:
description: Is this a test build? In other words, should we only build a classical editor?
type: boolean
default: false
workflow_dispatch: workflow_dispatch:
inputs: inputs:
@ -21,6 +25,10 @@ on:
description: A tag, branch or commit hash in the LimboAI repository. description: A tag, branch or commit hash in the LimboAI repository.
type: string type: string
default: master default: master
test-build:
description: Is this a test build? In other words, should we only build a classical editor?
type: boolean
default: false
# Global Settings # Global Settings
env: env:
@ -33,73 +41,88 @@ env:
jobs: jobs:
windows-builds: windows-builds:
runs-on: "windows-latest" runs-on: "windows-latest"
name: ${{ matrix.name }} name: ${{ matrix.opts.name }}
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
include: opts:
- name: Editor (x86_64, release) - name: Editor (x86_64, release)
target: editor target: editor
arch: x86_64 arch: x86_64
build-mono: false build-mono: false
should-build: true
- name: Template (x86_64, release) - name: Template (x86_64, release)
target: template_release target: template_release
arch: x86_64 arch: x86_64
build-mono: false build-mono: false
should-build: ${{ !inputs.test-build }}
- name: Template (x86_64, debug) - name: Template (x86_64, debug)
target: template_debug target: template_debug
arch: x86_64 arch: x86_64
build-mono: false build-mono: false
should-build: ${{ !inputs.test-build }}
# - name: Editor (x86_32, release) # - name: Editor (x86_32, release)
# target: editor # target: editor
# arch: x86_32 # arch: x86_32
# build-mono: false # build-mono: false
# should-build: ${{ !inputs.test-build }}
- name: Template (x86_32, release) - name: Template (x86_32, release)
target: template_release target: template_release
arch: x86_32 arch: x86_32
build-mono: false build-mono: false
should-build: ${{ !inputs.test-build }}
- name: Template (x86_32, debug) - name: Template (x86_32, debug)
target: template_debug target: template_debug
arch: x86_32 arch: x86_32
build-mono: false build-mono: false
should-build: ${{ !inputs.test-build }}
- name: Editor .NET (x86_64, release) - name: Editor .NET (x86_64, release)
target: editor target: editor
arch: x86_64 arch: x86_64
build-mono: true build-mono: true
should-build: ${{ !inputs.test-build }}
- name: Template .NET (x86_64, release) - name: Template .NET (x86_64, release)
target: template_release target: template_release
arch: x86_64 arch: x86_64
build-mono: true build-mono: true
should-build: ${{ !inputs.test-build }}
- name: Template .NET (x86_64, debug) - name: Template .NET (x86_64, debug)
target: template_debug target: template_debug
arch: x86_64 arch: x86_64
build-mono: true build-mono: true
should-build: ${{ !inputs.test-build }}
# - name: Editor .NET (x86_32, release) # - name: Editor .NET (x86_32, release)
# target: editor # target: editor
# arch: x86_32 # arch: x86_32
# build-mono: true # build-mono: true
# should-build: ${{ !inputs.test-build }}
- name: Template .NET (x86_32, release) - name: Template .NET (x86_32, release)
target: template_release target: template_release
arch: x86_32 arch: x86_32
build-mono: true build-mono: true
should-build: ${{ !inputs.test-build }}
- name: Template .NET (x86_32, debug) - name: Template .NET (x86_32, debug)
target: template_debug target: template_debug
arch: x86_32 arch: x86_32
build-mono: true build-mono: true
should-build: ${{ !inputs.test-build }}
exclude:
- { opts: {should-build: false }}
env: env:
BIN: godot.windows.${{matrix.target}}.${{matrix.arch}}${{ matrix.build-mono == true && '.mono' || '' }} BIN: godot.windows.${{matrix.opts.target}}.${{matrix.opts.arch}}${{ matrix.opts.build-mono == true && '.mono' || '' }}
steps: steps:
- name: Clone Godot - name: Clone Godot
@ -147,17 +170,17 @@ jobs:
env: env:
SCONS_CACHE: ${{github.workspace}}/.scons_cache/ SCONS_CACHE: ${{github.workspace}}/.scons_cache/
run: | run: |
scons -j2 platform=windows target=${{matrix.target}} arch=${{matrix.arch}} module_mono_enabled=${{matrix.build-mono}} ${{env.SCONSFLAGS}} scons -j2 platform=windows target=${{matrix.opts.target}} arch=${{matrix.opts.arch}} module_mono_enabled=${{matrix.opts.build-mono}} ${{env.SCONSFLAGS}}
- name: Generate C# glue - name: Generate C# glue
if: matrix.build-mono && matrix.target == 'editor' if: matrix.opts.build-mono && matrix.opts.target == 'editor'
env: env:
GODOT_VERSION_STATUS: limboai GODOT_VERSION_STATUS: limboai
run: | 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 - name: Build .NET solutions
if: matrix.build-mono && matrix.target == 'editor' if: matrix.opts.build-mono && matrix.opts.target == 'editor'
env: env:
GODOT_VERSION_STATUS: limboai GODOT_VERSION_STATUS: limboai
run: | run: |
@ -166,7 +189,7 @@ jobs:
- name: Prepare artifact - name: Prepare artifact
shell: bash shell: bash
env: env:
OUTDIR: ${{ startsWith(matrix.target, 'template') && 'out/templates' || 'out/' }} OUTDIR: ${{ startsWith(matrix.opts.target, 'template') && 'out/templates' || 'out/' }}
run: | run: |
rm -f bin/*.{exp,lib,pdb} rm -f bin/*.{exp,lib,pdb}
mkdir -p ${{env.OUTDIR}} mkdir -p ${{env.OUTDIR}}
@ -174,21 +197,21 @@ jobs:
ls -R out/ ls -R out/
- name: Rename templates - name: Rename templates
if: startsWith(matrix.target, 'template') if: startsWith(matrix.opts.target, 'template')
shell: bash shell: bash
env: env:
BUILD_TYPE: ${{ endsWith(matrix.target, 'release') && 'release' || 'debug' }} BUILD_TYPE: ${{ endsWith(matrix.opts.target, 'release') && 'release' || 'debug' }}
run: | run: |
mv out/templates/${BIN}.exe out/templates/windows_${BUILD_TYPE}_${{matrix.arch}}.exe mv out/templates/${BIN}.exe out/templates/windows_${BUILD_TYPE}_${{matrix.opts.arch}}.exe
mv out/templates/${BIN}.console.exe out/templates/windows_${BUILD_TYPE}_${{matrix.arch}}_console.exe mv out/templates/${BIN}.console.exe out/templates/windows_${BUILD_TYPE}_${{matrix.opts.arch}}_console.exe
echo "${GODOT_VERSION}.limboai+${LIMBOAI_VERSION}" > out/templates/version.txt echo "${GODOT_VERSION}.limboai+${LIMBOAI_VERSION}" > out/templates/version.txt
ls -R out/ ls -R out/
- name: Upload artifact - name: Upload artifact
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
env: env:
NAME_EDITOR: ${{env.NAME_PREFIX}}.${{matrix.target}}.windows.${{matrix.arch}}${{ matrix.build-mono == true && '.mono' || '' }} NAME_EDITOR: ${{env.NAME_PREFIX}}.${{matrix.opts.target}}.windows.${{matrix.opts.arch}}${{ matrix.opts.build-mono == true && '.mono' || '' }}
NAME_TEMPLATES: ${{env.NAME_PREFIX}}.export-templates${{ matrix.build-mono == true && '.mono' || '' }} NAME_TEMPLATES: ${{env.NAME_PREFIX}}.export-templates${{ matrix.opts.build-mono == true && '.mono' || '' }}
with: with:
name: ${{ startsWith(matrix.target, 'template') && env.NAME_TEMPLATES || env.NAME_EDITOR }} name: ${{ startsWith(matrix.opts.target, 'template') && env.NAME_TEMPLATES || env.NAME_EDITOR }}
path: out/* path: out/*