Skip to content

Commit

Permalink
CI: Expand GHA logic for windows compilers
Browse files Browse the repository at this point in the history
  • Loading branch information
Repiteo committed Sep 22, 2024
1 parent 0a4aedb commit ea56196
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 82 deletions.
96 changes: 50 additions & 46 deletions .github/workflows/runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,53 +6,57 @@ concurrency:
cancel-in-progress: true

jobs:
# First stage: Only static checks, fast and prevent expensive builds from running.

static-checks:
if: '!vars.DISABLE_GODOT_CI'
name: 📊 Static checks
uses: ./.github/workflows/static_checks.yml

# Second stage: Run all the builds and some of the tests.

android-build:
name: 🤖 Android
needs: static-checks
uses: ./.github/workflows/android_builds.yml

ios-build:
name: 🍏 iOS
needs: static-checks
uses: ./.github/workflows/ios_builds.yml

linux-build:
name: 🐧 Linux
needs: static-checks
uses: ./.github/workflows/linux_builds.yml

macos-build:
name: 🍎 macOS
needs: static-checks
uses: ./.github/workflows/macos_builds.yml

windows-build:
name: 🏁 Windows
needs: static-checks
uses: ./.github/workflows/windows_builds.yml

web-build:
name: 🌐 Web
needs: static-checks
uses: ./.github/workflows/web_builds.yml

# Third stage: Run auxiliary tests using build artifacts from previous jobs.

# Can be turned off for PRs that intentionally break compat with godot-cpp,
# until both the upstream PR and the matching godot-cpp changes are merged.
godot-cpp-test:
name: 🪲 Godot CPP
# This can be changed to depend on another platform, if we decide to use it for
# godot-cpp instead. Make sure to move the .github/actions/godot-api-dump step
# appropriately.
needs: linux-build
uses: ./.github/workflows/godot_cpp_test.yml
# # First stage: Only static checks, fast and prevent expensive builds from running.

# static-checks:
# if: '!vars.DISABLE_GODOT_CI'
# name: 📊 Static checks
# uses: ./.github/workflows/static_checks.yml

# # Second stage: Run all the builds and some of the tests.

# android-build:
# name: 🤖 Android
# needs: static-checks
# uses: ./.github/workflows/android_builds.yml

# ios-build:
# name: 🍏 iOS
# needs: static-checks
# uses: ./.github/workflows/ios_builds.yml

# linux-build:
# name: 🐧 Linux
# needs: static-checks
# uses: ./.github/workflows/linux_builds.yml

# macos-build:
# name: 🍎 macOS
# needs: static-checks
# uses: ./.github/workflows/macos_builds.yml

# windows-build:
# name: 🏁 Windows
# needs: static-checks
# uses: ./.github/workflows/windows_builds.yml

# web-build:
# name: 🌐 Web
# needs: static-checks
# uses: ./.github/workflows/web_builds.yml

# # Third stage: Run auxiliary tests using build artifacts from previous jobs.

# # Can be turned off for PRs that intentionally break compat with godot-cpp,
# # until both the upstream PR and the matching godot-cpp changes are merged.
# godot-cpp-test:
# name: 🪲 Godot CPP
# # This can be changed to depend on another platform, if we decide to use it for
# # godot-cpp instead. Make sure to move the .github/actions/godot-api-dump step
# # appropriately.
# needs: linux-build
# uses: ./.github/workflows/godot_cpp_test.yml
62 changes: 27 additions & 35 deletions .github/workflows/windows_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
env:
# Used for the cache key. Add version suffix to force clean build.
GODOT_BASE_BRANCH: master
SCONSFLAGS: verbose=yes warnings=extra werror=yes module_text_server_fb_enabled=yes d3d12=yes strict_checks=yes "angle_libs=${{ github.workspace }}/"
SCONSFLAGS: dev_mode=yes module_text_server_fb_enabled=yes d3d12=yes "angle_libs=${{ github.workspace }}/" debug_symbols=no vsproj_gen_only=no windows_subsystem=console
SCONS_CACHE_MSVC_CONFIG: true

concurrency:
Expand All @@ -18,45 +18,29 @@ jobs:
build-windows:
# Windows 10 with latest image
runs-on: windows-latest
name: ${{ matrix.name }}
name: ${{ matrix.target }}-${{ matrix.compiler }}
strategy:
fail-fast: false
matrix:
include:
- name: Editor (target=editor, tests=yes)
cache-name: windows-editor
target: editor
tests: true
# Skip debug symbols, they're way too big with MSVC.
sconsflags: debug_symbols=no vsproj=yes vsproj_gen_only=no windows_subsystem=console
bin: ./bin/godot.windows.editor.x86_64.exe
artifact: true

- name: Editor w/ clang-cl (target=editor, tests=yes, use_llvm=yes)
cache-name: windows-editor-clang
target: editor
tests: true
sconsflags: debug_symbols=no windows_subsystem=console use_llvm=yes
bin: ./bin/godot.windows.editor.x86_64.llvm.exe

- name: Template (target=template_release, tests=yes)
cache-name: windows-template
target: template_release
tests: true
sconsflags: debug_symbols=no
bin: ./bin/godot.windows.template_release.x86_64.console.exe
artifact: true
target: [editor, template_release]
compiler: [msvc, gcc, clang]

steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive

- name: Create Environment Variables
run: |
echo "CACHE_NAME=windows-${{ matrix.target }}-${{ matrix.compiler }}" >> $env:GITHUB_ENV
# TODO: concatenate variable beforehand
echo "BIN=./bin/godot.windows.${{ matrix.target }}.x86_64${{ matrix.compiler == 'clang' && '.llvm' || '' }}.exe" >> $env:GITHUB_ENV
- name: Restore Godot build cache
uses: ./.github/actions/godot-cache-restore
with:
cache-name: ${{ matrix.cache-name }}
cache-name: ${{ env.CACHE_NAME }}
continue-on-error: true

- name: Setup Python and SCons
Expand All @@ -77,36 +61,44 @@ jobs:
run: Expand-Archive -Force angle/angle.zip ${{ github.workspace }}/

- name: Setup MSVC problem matcher
if: matrix.compiler == 'msvc'
uses: ammaraskar/msvc-problem-matcher@master

- name: Setup GCC problem matcher
if: matrix.compiler != 'msvc'
uses: ammaraskar/gcc-problem-matcher@master

- name: Compilation
uses: ./.github/actions/godot-build
with:
sconsflags: ${{ env.SCONSFLAGS }} ${{ matrix.sconsflags }}
sconsflags: >-
${{ env.SCONSFLAGS }}
${{ matrix.sconsflags }}
vsproj=${{ matrix.compiler == 'msvc' && matrix.target == 'editor' }}
use_mingw=${{ matrix.compiler == 'gcc' }}
use_llvm=${{ matrix.compiler == 'clang' }}
platform: windows
target: ${{ matrix.target }}
tests: ${{ matrix.tests }}

- name: Save Godot build cache
uses: ./.github/actions/godot-cache-save
with:
cache-name: ${{ matrix.cache-name }}
cache-name: ${{ env.CACHE_NAME }}
continue-on-error: true

- name: Prepare artifact
if: ${{ matrix.artifact }}
run: |
Remove-Item bin/* -Include *.exp,*.lib,*.pdb -Force
- name: Upload artifact
if: ${{ matrix.artifact }}
uses: ./.github/actions/upload-artifact
with:
name: ${{ matrix.cache-name }}
name: ${{ env.CACHE_NAME }}

- name: Unit tests
if: matrix.tests
run: |
${{ matrix.bin }} --version
${{ matrix.bin }} --help
${{ matrix.bin }} --test --force-colors
${{ env.BIN }} --version
${{ env.BIN }} --help
${{ env.BIN }} --test --force-colors
2 changes: 2 additions & 0 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -858,6 +858,8 @@ else: # GCC, Clang
common_warnings += ["-Wno-type-limits"]
if cc_version_major >= 12: # False positives in our error macros, see GH-58747.
common_warnings += ["-Wno-return-type"]
if cc_version_major < 13: # `region` & `endregion` not recognized as valid pragmas.
common_warnings += ["-Wno-unknown-pragmas"]
elif methods.using_clang(env) or methods.using_emcc(env):
common_warnings += ["-Wshadow-field-in-constructor", "-Wshadow-uncaptured-local"]
# We often implement `operator<` for structs of pointers as a requirement
Expand Down
2 changes: 1 addition & 1 deletion platform/windows/detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ def configure_msvc(env: "SConsEnvironment", vcvars_msvc_config):
env.AppendUnique(CPPDEFINES=["R128_STDC_ONLY"])
env.extra_suffix = ".llvm" + env.extra_suffix

env["MAXLINELENGTH"] = 8192 # Windows Vista and beyond, so always applicable.
# env["MAXLINELENGTH"] = 8192 # Windows Vista and beyond, so always applicable.

if env["silence_msvc"] and not env.GetOption("clean"):
from tempfile import mkstemp
Expand Down

0 comments on commit ea56196

Please sign in to comment.