name: 🏁 Windows Builds on: workflow_call: workflow_dispatch: # Global Settings env: SCONS_FLAGS: >- dev_mode=yes module_text_server_fb_enabled=yes debug_symbols=no SCONS_CACHE_MSVC_CONFIG: true PYTHONIOENCODING: utf8 jobs: build-windows: # Windows 10 with latest image runs-on: windows-latest name: ${{ matrix.name }} timeout-minutes: 120 strategy: fail-fast: false matrix: include: - name: Editor (target=editor) cache-name: windows-editor target: editor scons-flags: >- windows_subsystem=console vsproj=yes vsproj_gen_only=no bin: ./bin/godot.windows.editor.x86_64.exe compiler: msvc - name: Editor w/ clang-cl (target=editor, use_llvm=yes) cache-name: windows-editor-clang target: editor scons-flags: >- windows_subsystem=console use_llvm=yes bin: ./bin/godot.windows.editor.x86_64.llvm.exe compiler: clang - name: Template (target=template_release) cache-name: windows-template target: template_release bin: ./bin/godot.windows.template_release.x86_64.console.exe compiler: msvc - name: Template w/ GCC (target=template_release, use_mingw=yes) cache-name: windows-template-gcc # MinGW takes MUCH longer to compile; save time by only targeting Template. target: template_release scons-flags: use_mingw=yes bin: ./bin/godot.windows.template_release.x86_64.console.exe compiler: gcc steps: - name: Checkout uses: actions/checkout@v6 with: submodules: recursive - name: Restore Godot build cache uses: ./.github/actions/godot-cache-restore with: cache-name: ${{ matrix.cache-name }} continue-on-error: true - name: Setup Python and SCons uses: ./.github/actions/godot-deps - name: Download Direct3D 12 SDK components shell: sh id: d3d12-sdk run: | if python ./misc/scripts/install_d3d12_sdk_windows.py; then echo "D3D12_ENABLED=yes" >> "$GITHUB_OUTPUT" else echo "::warning::Windows: Direct3D 12 SDK installation failed, building without Direct3D 12 support." echo "D3D12_ENABLED=no" >> "$GITHUB_OUTPUT" fi continue-on-error: true - name: Download pre-built ANGLE shell: sh id: angle-sdk run: | if python ./misc/scripts/install_angle.py; then echo "ANGLE_ENABLED=yes" >> "$GITHUB_OUTPUT" else echo "::warning::ANGLE SDK installation failed, building without ANGLE support." echo "ANGLE_ENABLED=no" >> "$GITHUB_OUTPUT" fi - name: Download WinRT components shell: sh run: python ./misc/scripts/install_winrt.py continue-on-error: true - name: Download pre-built AccessKit shell: sh id: accesskit-sdk run: | if python ./misc/scripts/install_accesskit.py; then echo "ACCESSKIT_ENABLED=yes" >> "$GITHUB_OUTPUT" else echo "::warning::AccessKit SDK installation failed, building without AccessKit support." echo "ACCESSKIT_ENABLED=no" >> "$GITHUB_OUTPUT" fi - name: Compilation uses: ./.github/actions/godot-build with: scons-flags: ${{ env.SCONS_FLAGS }} ${{ matrix.scons-flags }} d3d12=${{ steps.d3d12-sdk.outputs.D3D12_ENABLED }} accesskit=${{ steps.accesskit-sdk.outputs.ACCESSKIT_ENABLED }} angle=${{ steps.angle-sdk.outputs.ANGLE_ENABLED }} platform: windows target: ${{ matrix.target }} - name: Save Godot build cache uses: ./.github/actions/godot-cache-save with: cache-name: ${{ matrix.cache-name }} continue-on-error: true - name: Prepare artifact if: matrix.compiler == 'msvc' run: | Remove-Item bin/* -Include *.exp,*.lib,*.pdb -Force - name: Upload artifact if: matrix.compiler == 'msvc' uses: ./.github/actions/upload-artifact with: name: ${{ matrix.cache-name }} - name: Unit tests run: | ${{ matrix.bin }} --version ${{ matrix.bin }} --help ${{ matrix.bin }} --test --force-colors