Merge branch 'github-workflows'

This commit is contained in:
Serhii Snitsaruk 2023-09-13 11:30:38 +02:00
commit 9da55981d1
8 changed files with 77 additions and 64 deletions

View File

@ -105,11 +105,11 @@ jobs:
uses: actions/cache@v3
with:
path: ${{github.workspace}}/.scons_cache/
key: ${{matrix.cache-name}}-${{env.GODOT_BASE_BRANCH}}-${{github.ref}}-${{github.sha}}
key: ${{env.BIN}}-${{inputs.godot-treeish}}-${{inputs.limboai-treeish}}-${{env.LIMBOAI_VERSION}}
restore-keys: |
${{env.BIN}}-${{env.GODOT_BASE_BRANCH}}-${{github.ref}}-${{github.sha}}
${{env.BIN}}-${{env.GODOT_BASE_BRANCH}}-${{github.ref}}
${{env.BIN}}-${{env.GODOT_BASE_BRANCH}}
${{env.BIN}}-${{inputs.godot-treeish}}-${{inputs.limboai-treeish}}-${{env.LIMBOAI_VERSION}}
${{env.BIN}}-${{inputs.godot-treeish}}-${{inputs.limboai-treeish}}
${{env.BIN}}-${{inputs.godot-treeish}}
- name: Compilation
env:

View File

@ -117,11 +117,11 @@ jobs:
uses: actions/cache@v3
with:
path: ${{github.workspace}}/.scons_cache/
key: ${{matrix.cache-name}}-${{env.GODOT_BASE_BRANCH}}-${{github.ref}}-${{github.sha}}
key: ${{env.BIN}}-${{inputs.godot-treeish}}-${{inputs.limboai-treeish}}-${{env.LIMBOAI_VERSION}}
restore-keys: |
${{env.BIN}}-${{env.GODOT_BASE_BRANCH}}-${{github.ref}}-${{github.sha}}
${{env.BIN}}-${{env.GODOT_BASE_BRANCH}}-${{github.ref}}
${{env.BIN}}-${{env.GODOT_BASE_BRANCH}}
${{env.BIN}}-${{inputs.godot-treeish}}-${{inputs.limboai-treeish}}-${{env.LIMBOAI_VERSION}}
${{env.BIN}}-${{inputs.godot-treeish}}-${{inputs.limboai-treeish}}
${{env.BIN}}-${{inputs.godot-treeish}}
- name: Compilation
env:

View File

@ -142,11 +142,11 @@ jobs:
uses: actions/cache@v3
with:
path: ${{github.workspace}}/.scons_cache/
key: ${{matrix.cache-name}}-${{env.GODOT_BASE_BRANCH}}-${{github.ref}}-${{github.sha}}
key: ${{env.BIN}}-${{inputs.godot-treeish}}-${{inputs.limboai-treeish}}-${{env.LIMBOAI_VERSION}}
restore-keys: |
${{env.BIN}}-${{env.GODOT_BASE_BRANCH}}-${{github.ref}}-${{github.sha}}
${{env.BIN}}-${{env.GODOT_BASE_BRANCH}}-${{github.ref}}
${{env.BIN}}-${{env.GODOT_BASE_BRANCH}}
${{env.BIN}}-${{inputs.godot-treeish}}-${{inputs.limboai-treeish}}-${{env.LIMBOAI_VERSION}}
${{env.BIN}}-${{inputs.godot-treeish}}-${{inputs.limboai-treeish}}
${{env.BIN}}-${{inputs.godot-treeish}}
- name: Compilation
env:

View File

@ -160,11 +160,11 @@ jobs:
uses: actions/cache@v3
with:
path: ${{github.workspace}}/.scons_cache/
key: ${{matrix.cache-name}}-${{env.GODOT_BASE_BRANCH}}-${{github.ref}}-${{github.sha}}
key: ${{env.BIN}}-${{inputs.godot-treeish}}-${{inputs.limboai-treeish}}-${{env.LIMBOAI_VERSION}}
restore-keys: |
${{env.BIN}}-${{env.GODOT_BASE_BRANCH}}-${{github.ref}}-${{github.sha}}
${{env.BIN}}-${{env.GODOT_BASE_BRANCH}}-${{github.ref}}
${{env.BIN}}-${{env.GODOT_BASE_BRANCH}}
${{env.BIN}}-${{inputs.godot-treeish}}-${{inputs.limboai-treeish}}-${{env.LIMBOAI_VERSION}}
${{env.BIN}}-${{inputs.godot-treeish}}-${{inputs.limboai-treeish}}
${{env.BIN}}-${{inputs.godot-treeish}}
- name: Compilation
env:

View File

@ -1,73 +1,78 @@
name: 🔧 Test builds
on:
workflow_call:
inputs:
godot-treeish:
description: A tag, branch or commit hash in the Godot repository.
type: string
default: master
limboai-treeish:
description: A tag, branch or commit hash in the LimboAI repository.
type: string
default: master
workflow_dispatch:
inputs:
godot-treeish:
description: A tag, branch or commit hash in the Godot repository.
type: string
default: master
limboai-treeish:
description: A tag, branch or commit hash in the LimboAI repository.
type: string
default: master
push:
branches: [ master ]
paths-ignore:
- "README.md"
- "LICENSE"
- "**/*.png"
- "demo/*"
pull_request:
branches: [ master ]
paths-ignore:
- "README.md"
- "LICENSE"
- "**/*.png"
- "demo/*"
# Global Settings
env:
GODOT_TREEISH: 4.1.1-stable
SCONS_CACHE_MSVC_CONFIG: true
SCONS_CACHE_LIMIT: 4096
SCONSFLAGS: production=yes tests=no verbose=yes warnings=extra werror=yes
SCONSFLAGS: verbose=yes warnings=extra werror=yes
DOTNET_NOLOGO: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
jobs:
linux-test-build:
linux-test-builds:
runs-on: "ubuntu-20.04"
name: ${{ matrix.name }}
strategy:
fail-fast: false
matrix:
include:
- name: 🐧 Editor (x86_64, debug) + Tests
target: editor
arch: x86_64
tests: true
sconsflags: devbuild=yes debug_symbols=yes
- name: 🐧 Editor (x86_64, release)
target: editor
arch: x86_64
build-mono: false
tests: false
sconsflags: production=yes
- name: 🐧 Template (x86_64, release)
target: template_release
arch: x86_64
build-mono: false
tests: false
sconsflags: production=yes
- name: 🐧 Template (x86_64, debug)
target: template_debug
arch: x86_64
build-mono: false
tests: false
sconsflags: production=yes
env:
BIN: godot.linuxbsd.${{matrix.target}}.${{matrix.arch}}${{ matrix.build-mono == true && '.mono' || '' }}
BIN: godot.linuxbsd.${{matrix.target}}.${{matrix.arch}}
steps:
- name: Clone Godot
uses: actions/checkout@v3
with:
repository: godotengine/godot
ref: ${{ inputs.godot-treeish }}
ref: ${{ env.GODOT_TREEISH }}
- name: Clone LimboAI module
uses: actions/checkout@v3
with:
path: modules/limboai
ref: ${{ inputs.limboai-treeish }}
# Inits GODOT_VERSION, LIMBOAI_VERSION and NAME_PREFIX environment variables.
- uses: ./modules/limboai/.github/actions/init-version
@ -98,18 +103,18 @@ jobs:
uses: actions/cache@v3
with:
path: ${{github.workspace}}/.scons_cache/
key: ${{matrix.cache-name}}-${{env.GODOT_BASE_BRANCH}}-${{github.ref}}-${{github.sha}}
key: ${{env.BIN}}-${{env.GODOT_TREEISH}}-${{github.ref}}-${{github.sha}}
restore-keys: |
${{env.BIN}}-${{env.GODOT_BASE_BRANCH}}-${{github.ref}}-${{github.sha}}
${{env.BIN}}-${{env.GODOT_BASE_BRANCH}}-${{github.ref}}
${{env.BIN}}-${{env.GODOT_BASE_BRANCH}}
${{env.BIN}}-${{env.GODOT_TREEISH}}-${{github.ref}}-${{github.sha}}
${{env.BIN}}-${{env.GODOT_TREEISH}}-${{github.ref}}
${{env.BIN}}-${{env.GODOT_TREEISH}}
- 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}} module_mono_enabled=${{matrix.build-mono}} ${{env.SCONSFLAGS}}
scons platform=linuxbsd target=${{matrix.target}} arch=${{matrix.arch}} tests=${{matrix.tests}} ${{matrix.sconsflags}} ${{env.SCONSFLAGS}}
- name: Prepare artifact
env:
@ -129,6 +134,13 @@ jobs:
name: ${{ startsWith(matrix.target, 'template') && env.NAME_TEMPLATES || env.NAME_EDITOR }}
path: out/*
- name: Unit Tests
if: ${{ matrix.tests }}
run: |
./out/${{ env.BIN }} --version
./out/${{ env.BIN }} --help
./out/${{ env.BIN }} --headless --test
windows-dot-net:
runs-on: "windows-latest"
name: ${{ matrix.name }}
@ -140,11 +152,13 @@ jobs:
target: editor
arch: x86_64
build-mono: true
sconsflags: production=yes
- name: 🪟 Template .NET (x86_64, release)
target: template_release
arch: x86_64
build-mono: true
sconsflags: production=yes
env:
BIN: godot.windows.${{matrix.target}}.${{matrix.arch}}${{ matrix.build-mono == true && '.mono' || '' }}
@ -154,13 +168,12 @@ jobs:
uses: actions/checkout@v3
with:
repository: godotengine/godot
ref: ${{ inputs.godot-treeish }}
ref: ${{ env.GODOT_TREEISH }}
- name: Clone LimboAI module
uses: actions/checkout@v3
with:
path: modules/limboai
ref: ${{ inputs.limboai-treeish }}
# Inits GODOT_VERSION, LIMBOAI_VERSION and NAME_PREFIX environment variables.
- uses: ./modules/limboai/.github/actions/init-version
@ -185,17 +198,17 @@ jobs:
uses: actions/cache@v3
with:
path: ${{github.workspace}}/.scons_cache/
key: ${{matrix.cache-name}}-${{env.GODOT_BASE_BRANCH}}-${{github.ref}}-${{github.sha}}
key: ${{env.BIN}}-${{env.GODOT_TREEISH}}-${{github.ref}}-${{github.sha}}
restore-keys: |
${{env.BIN}}-${{env.GODOT_BASE_BRANCH}}-${{github.ref}}-${{github.sha}}
${{env.BIN}}-${{env.GODOT_BASE_BRANCH}}-${{github.ref}}
${{env.BIN}}-${{env.GODOT_BASE_BRANCH}}
${{env.BIN}}-${{env.GODOT_TREEISH}}-${{github.ref}}-${{github.sha}}
${{env.BIN}}-${{env.GODOT_TREEISH}}-${{github.ref}}
${{env.BIN}}-${{env.GODOT_TREEISH}}
- name: Compilation
env:
SCONS_CACHE: ${{github.workspace}}/.scons_cache/
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.target}} arch=${{matrix.arch}} module_mono_enabled=${{matrix.build-mono}} ${{matrix.sconsflags}} ${{env.SCONSFLAGS}}
- name: Generate C# glue
if: matrix.build-mono && matrix.target == 'editor'

View File

@ -94,11 +94,11 @@ jobs:
uses: actions/cache@v3
with:
path: ${{github.workspace}}/.scons_cache/
key: ${{matrix.cache-name}}-${{env.GODOT_BASE_BRANCH}}-${{github.ref}}-${{github.sha}}
key: ${{env.CACHE_NAME}}-${{inputs.godot-treeish}}-${{inputs.limboai-treeish}}-${{env.LIMBOAI_VERSION}}
restore-keys: |
${{env.CACHE_NAME}}-${{env.GODOT_BASE_BRANCH}}-${{github.ref}}-${{github.sha}}
${{env.CACHE_NAME}}-${{env.GODOT_BASE_BRANCH}}-${{github.ref}}
${{env.CACHE_NAME}}-${{env.GODOT_BASE_BRANCH}}
${{env.CACHE_NAME}}-${{inputs.godot-treeish}}-${{inputs.limboai-treeish}}-${{env.LIMBOAI_VERSION}}
${{env.CACHE_NAME}}-${{inputs.godot-treeish}}-${{inputs.limboai-treeish}}
${{env.CACHE_NAME}}-${{inputs.godot-treeish}}
- name: Compilation
env:

View File

@ -137,11 +137,11 @@ jobs:
uses: actions/cache@v3
with:
path: ${{github.workspace}}/.scons_cache/
key: ${{matrix.cache-name}}-${{env.GODOT_BASE_BRANCH}}-${{github.ref}}-${{github.sha}}
key: ${{env.BIN}}-${{inputs.godot-treeish}}-${{inputs.limboai-treeish}}-${{env.LIMBOAI_VERSION}}
restore-keys: |
${{env.BIN}}-${{env.GODOT_BASE_BRANCH}}-${{github.ref}}-${{github.sha}}
${{env.BIN}}-${{env.GODOT_BASE_BRANCH}}-${{github.ref}}
${{env.BIN}}-${{env.GODOT_BASE_BRANCH}}
${{env.BIN}}-${{inputs.godot-treeish}}-${{inputs.limboai-treeish}}-${{env.LIMBOAI_VERSION}}
${{env.BIN}}-${{inputs.godot-treeish}}-${{inputs.limboai-treeish}}
${{env.BIN}}-${{inputs.godot-treeish}}
- name: Compilation
env: