container

This commit is contained in:
Serhii Snitsaruk 2024-11-30 20:13:55 +01:00
parent c1073b4cec
commit 7cc76d95cb
No known key found for this signature in database
GPG Key ID: A965EF8799FFEC2D
1 changed files with 60 additions and 29 deletions

View File

@ -5,7 +5,7 @@ on:
godot-ref:
description: A tag, branch or commit hash in the Godot repository.
type: string
default: master
default: 4.3
limboai-ref:
description: A tag, branch or commit hash in the LimboAI repository.
type: string
@ -20,7 +20,7 @@ on:
godot-ref:
description: A tag, branch or commit hash in the Godot repository.
type: string
default: master
default: 4.3
limboai-ref:
description: A tag, branch or commit hash in the LimboAI repository.
type: string
@ -32,11 +32,9 @@ on:
# Global Settings
env:
SCONS_CACHE_MSVC_CONFIG: true
BUILD_IMAGE_VERSION: 4.3-f40
SCONS_CACHE_LIMIT: 4096
SCONSFLAGS: production=yes use_mingw=yes verbose=yes warnings=no progress=no
DOTNET_NOLOGO: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
jobs:
windows-builds:
@ -51,6 +49,7 @@ jobs:
- name: Editor (x86_64, release)
target: editor
arch: x86_64
scons-flags: editor=yes
llvm: false
dotnet: false
should-build: true
@ -106,6 +105,7 @@ jobs:
arch: arm64
llvm: true
dotnet: false
scons-flags: mingw_prefix=/root/llvm-mingw
should-build: ${{ !inputs.test-build }}
- name: Template (arm64, debug)
@ -113,6 +113,7 @@ jobs:
arch: arm64
llvm: true
dotnet: false
scons-flags: mingw_prefix=/root/llvm-mingw
should-build: ${{ !inputs.test-build }}
# * .NET x86_64
@ -122,7 +123,7 @@ jobs:
arch: x86_64
llvm: false
dotnet: true
should-build: ${{ !inputs.test-build }}
should-build: true
- name: Template .NET (x86_64, release)
target: template_release
@ -175,6 +176,7 @@ jobs:
arch: arm64
llvm: true
dotnet: true
scons-flags: mingw_prefix=/root/llvm-mingw
should-build: ${{ !inputs.test-build }}
- name: Template .NET (arm64, debug)
@ -182,6 +184,7 @@ jobs:
arch: arm64
llvm: true
dotnet: true
scons-flags: mingw_prefix=/root/llvm-mingw
should-build: ${{ !inputs.test-build }}
exclude:
@ -206,32 +209,60 @@ jobs:
# Inits GODOT_VERSION, LIMBOAI_VERSION and NAME_PREFIX environment variables.
- uses: ./modules/limboai/.github/actions/init-version
- name: Set up Linux toolchain
uses: ./modules/limboai/.github/actions/setup-linux-toolchain
with:
arch: ${{matrix.opts.arch}}
# - name: Set up Linux toolchain
# uses: ./modules/limboai/.github/actions/setup-linux-toolchain
# with:
# arch: ${{matrix.opts.arch}}
- name: Set up MinGW
uses: ./modules/limboai/.github/actions/setup-mingw-ubuntu
with:
arch: ${{matrix.opts.arch}}
# - name: Set up MinGW
# uses: ./modules/limboai/.github/actions/setup-mingw-ubuntu
# with:
# arch: ${{matrix.opts.arch}}
- name: Set up scons cache
uses: actions/cache@v4
with:
path: ${{github.workspace}}/.scons_cache/
key: ${{env.BIN}}-${{inputs.godot-ref}}-${{inputs.limboai-ref}}-${{env.LIMBOAI_VERSION}}
# restore-keys: |
# ${{env.BIN}}-${{inputs.godot-ref}}-${{inputs.limboai-ref}}-${{env.LIMBOAI_VERSION}}
# ${{env.BIN}}-${{inputs.godot-ref}}-${{inputs.limboai-ref}}
# ${{env.BIN}}-${{inputs.godot-ref}}
# - name: Set up scons cache
# uses: actions/cache@v4
# with:
# path: ${{github.workspace}}/.scons_cache/
# key: ${{env.BIN}}-${{inputs.godot-ref}}-${{inputs.limboai-ref}}-${{env.LIMBOAI_VERSION}}
# restore-keys: |
# ${{env.BIN}}-${{inputs.godot-ref}}-${{inputs.limboai-ref}}-${{env.LIMBOAI_VERSION}}
# ${{env.BIN}}-${{inputs.godot-ref}}-${{inputs.limboai-ref}}
# ${{env.BIN}}-${{inputs.godot-ref}}
- name: Compilation
env:
SCONS_CACHE: ${{github.workspace}}/.scons_cache/
# - name: Compilation
# env:
# SCONS_CACHE: ${{github.workspace}}/.scons_cache/
# run: |
# PATH=${GITHUB_WORKSPACE}/buildroot/bin:$PATH
# scons platform=windows target=${{matrix.opts.target}} arch=${{matrix.opts.arch}} use_llvm=${{matrix.opts.llvm}} module_mono_enabled=${{matrix.opts.dotnet}} ${{env.SCONSFLAGS}}
- name: Pull build container
run: |
PATH=${GITHUB_WORKSPACE}/buildroot/bin:$PATH
scons platform=windows target=${{matrix.opts.target}} arch=${{matrix.opts.arch}} use_llvm=${{matrix.opts.llvm}} module_mono_enabled=${{matrix.opts.dotnet}} ${{env.SCONSFLAGS}}
podman pull ghcr.io/limbonaut/godot-windows:${{env.BUILD_IMAGE_VERSION}}
- name: Build using container
shell: bash
run: |
scons_command="scons \
platform=windows \
target=${{matrix.opts.target}} \
arch=${{matrix.opts.arch}} \
use_llvm=${{matrix.opts.llvm}} \
module_mono_enabled=${{matrix.opts.dotnet}} \
${{env.SCONSFLAGS}} \
${{matrix.opts.scons-flags}} \
"
podman_run="podman run -it --rm \
--env GODOT_VERSION_STATUS=${GODOT_VERSION_STATUS} \
--env NUM_CORES=$(nproc --all) \
--env SCONS_CACHE_LIMIT=${SCONS_CACHE_LIMIT} \
--env DOTNET_NOLOGO=true \
--env DOTNET_CLI_TELEMETRY_OPTOUT=true \
-v ${GITHUB_WORKSPACE}/:/build/ \
-w /build godot-windows:${{env.BUILD_IMAGE_VERSION}} bash -c \
"
echo "Running ${podman_run} \"${scons_command}\""
${podman_run} "${scons_command}"
- name: Prepare artifact
shell: bash
@ -273,7 +304,7 @@ jobs:
arch: x86_64
llvm: false
dotnet: true
should-build: ${{ !inputs.test-build }}
should-build: true
exclude:
- { opts: { should-build: false } }