Run vsvarsall in build pipeline instead of from SCons #402
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build and Test | |
| on: [push, pull_request] | |
| defaults: | |
| run: | |
| shell: bash | |
| env: | |
| SCONS_CACHE: ${{ github.workspace }}/.scons-cache | |
| SCONS_VERSION: 4.9.1 | |
| jobs: | |
| build_linux: | |
| name: ${{ matrix.platform }} (${{ matrix.arch }}, ${{ matrix.target }}, ${{ matrix.luajit && 'luajit' || 'lua' }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| target: [template_debug, template_release] | |
| arch: [x86_64, x86_32, arm64, arm32] | |
| platform: [linux, android] | |
| luajit: [false, true] | |
| include: | |
| - platform: linux | |
| arch: x86_32 | |
| packages: [g++-multilib] | |
| - platform: android | |
| arch: x86_32 | |
| packages: [g++-multilib] | |
| - platform: android | |
| arch: arm32 | |
| packages: [g++-multilib] | |
| exclude: | |
| - platform: linux | |
| arch: arm64 | |
| - platform: linux | |
| arch: arm32 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| - name: Setup godot-cpp | |
| uses: ./lib/godot-cpp/.github/actions/setup-godot-cpp | |
| with: | |
| platform: ${{ matrix.platform }} | |
| scons-version: $SCONS_VERSION | |
| - name: Setup dependencies | |
| if: ${{ join(matrix.packages, ' ') != '' }} | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install ${{ join(matrix.packages, ' ') }} | |
| - name: Cache SCons files | |
| uses: actions/cache@v4 | |
| with: | |
| path: .scons-cache/ | |
| key: ${{ matrix.platform }}-${{ matrix.arch }}-${{ matrix.target }}-${{ matrix.luajit && 'luajit' || 'lua' }}-${{ hashfiles('.gitmodules', 'src/**') }} | |
| restore-keys: | | |
| ${{ matrix.platform }}-${{ matrix.arch }}-${{ matrix.target }}-${{ matrix.luajit && 'luajit' || 'lua' }}- | |
| - name: Build artifact | |
| run: | | |
| scons platform=${{ matrix.platform }} arch=${{ matrix.arch }} target=${{ matrix.target }} luajit=${{ matrix.luajit }} | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.platform }}-${{ matrix.arch }}-${{ matrix.target }}-${{ matrix.luajit && 'luajit' || 'lua' }} | |
| path: | | |
| addons/lua-gdextension/build/libluagdextension.* | |
| build_windows: | |
| name: ${{ matrix.platform }} (${{ matrix.arch }}, ${{ matrix.target }}, ${{ matrix.luajit && 'luajit' || 'lua' }}) | |
| runs-on: windows-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| target: [template_debug, template_release] | |
| arch: [x86_64, x86_32, arm64] | |
| platform: [windows] | |
| luajit: [false, true] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| - name: Setup godot-cpp | |
| uses: ./lib/godot-cpp/.github/actions/setup-godot-cpp | |
| with: | |
| platform: ${{ matrix.platform }} | |
| scons-version: $SCONS_VERSION | |
| windows-compiler: msvc | |
| - name: Setup MSVC cross-compilation | |
| if: ${{ matrix.arch == 'arm64' }} | |
| uses: TheMrMilchmann/setup-msvc-dev@v3 | |
| with: | |
| arch: x64_arm64 | |
| - name: Cache SCons files | |
| uses: actions/cache@v4 | |
| with: | |
| path: .scons-cache/ | |
| key: ${{ matrix.platform }}-${{ matrix.arch }}-${{ matrix.target }}-${{ matrix.luajit && 'luajit' || 'lua' }}-${{ hashfiles('.gitmodules', 'src/**') }} | |
| restore-keys: | | |
| ${{ matrix.platform }}-${{ matrix.arch }}-${{ matrix.target }}-${{ matrix.luajit && 'luajit' || 'lua' }}- | |
| - name: Build artifact | |
| run: | | |
| scons platform=${{ matrix.platform }} arch=${{ matrix.arch }} target=${{ matrix.target }} luajit=${{ matrix.luajit }} | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.platform }}-${{ matrix.arch }}-${{ matrix.target }}-${{ matrix.luajit && 'luajit' || 'lua' }} | |
| path: | | |
| addons/lua-gdextension/build/libluagdextension.* | |
| build_web: | |
| name: web (wasm32, ${{ matrix.target }}, ${{ matrix.threads && 'threads' || 'nothreads' }}, ${{ matrix.luajit && 'luajit' || 'lua' }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| target: [template_debug, template_release] | |
| threads: [true, false] | |
| luajit: [false, true] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| - name: Setup godot-cpp | |
| uses: ./lib/godot-cpp/.github/actions/setup-godot-cpp | |
| with: | |
| platform: web | |
| scons-version: $SCONS_VERSION | |
| - name: Cache SCons files | |
| uses: actions/cache@v4 | |
| with: | |
| path: .scons-cache/ | |
| key: web-wasm32-${{ matrix.target }}-${{ matrix.threads && 'threads' || 'nothreads' }}-${{ matrix.luajit && 'luajit' || 'lua' }}-${{ hashfiles('.gitmodules', 'src/**') }} | |
| restore-keys: | | |
| web-wasm32-${{ matrix.target }}-${{ matrix.threads && 'threads' || 'nothreads' }}-${{ matrix.luajit && 'luajit' || 'lua' }}- | |
| - name: Build artifact | |
| run: | | |
| scons platform=web arch=wasm32 target=${{ matrix.target }} threads=${{ matrix.threads }} luajit=${{ matrix.luajit }} | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: web-wasm32-${{ matrix.target }}-${{ matrix.threads && 'threads' || 'nothreads' }}-${{ matrix.luajit && 'luajit' || 'lua' }} | |
| path: | | |
| addons/lua-gdextension/build/libluagdextension.* | |
| build_macos: | |
| name: ${{ matrix.platform }} (${{ matrix.arch }}, ${{ matrix.target }}, ${{ matrix.luajit && 'luajit' || 'lua' }}) | |
| runs-on: macos-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| target: [template_debug, template_release] | |
| arch: [universal] | |
| platform: [macos, ios] | |
| luajit: [false, true] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| - name: Setup godot-cpp | |
| uses: ./lib/godot-cpp/.github/actions/setup-godot-cpp | |
| with: | |
| platform: ${{ matrix.platform }} | |
| scons-version: $SCONS_VERSION | |
| - name: Cache SCons files | |
| uses: actions/cache@v4 | |
| with: | |
| path: .scons-cache/ | |
| key: ${{ matrix.platform }}-${{ matrix.arch }}-${{ matrix.target }}-${{ matrix.luajit && 'luajit' || 'lua' }}-${{ hashfiles('.gitmodules', 'src/**') }} | |
| restore-keys: | | |
| ${{ matrix.platform }}-${{ matrix.arch }}-${{ matrix.target }}-${{ matrix.luajit && 'luajit' || 'lua' }}- | |
| - name: Build artifact | |
| run: | | |
| scons platform=${{ matrix.platform }} arch=${{ matrix.arch }} target=${{ matrix.target }} luajit=${{ matrix.luajit }} | |
| env: | |
| PYTHON_BIN: python3 | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.platform }}-${{ matrix.arch }}-${{ matrix.target }}-${{ matrix.luajit && 'luajit' || 'lua' }} | |
| path: | | |
| addons/lua-gdextension/build/lib* | |
| test_distribution: | |
| name: Test ${{ matrix.name }} (${{ matrix.luajit && 'luajit' || 'lua' }}) | |
| needs: [build_linux, build_windows, build_macos, build_web] | |
| runs-on: ${{ matrix.runner-os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| luajit: [false, true] | |
| include: | |
| - name: Linux | |
| runner-os: ubuntu-latest | |
| godot-release: 4.4-stable/Godot_v4.4-stable_linux.x86_64.zip | |
| godot-bin: ./Godot_v4.4-stable_linux.x86_64 | |
| - name: Windows | |
| runner-os: windows-latest | |
| godot-release: 4.4-stable/Godot_v4.4-stable_win64.exe.zip | |
| godot-bin: ./Godot_v4.4-stable_win64.exe | |
| - name: macOS | |
| runner-os: macos-latest | |
| godot-release: 4.4-stable/Godot_v4.4-stable_macos.universal.zip | |
| godot-bin: ./Godot.app/Contents/MacOS/Godot | |
| env: | |
| GODOT_BIN: ${{ matrix.godot-bin }} | |
| MSYS_NO_PATHCONV: 1 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Download artifacts | |
| id: download | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts | |
| pattern: "*-${{ matrix.luajit && 'luajit' || 'lua' }}" | |
| merge-multiple: true | |
| - name: Setup godot-cpp | |
| uses: ./lib/godot-cpp/.github/actions/setup-godot-cpp | |
| with: | |
| platform: linux | |
| scons-version: $SCONS_VERSION | |
| - name: Copy artifacts to build folder | |
| run: | | |
| scons luajit=${{ matrix.luajit }} addons_files | |
| cp -r '${{ steps.download.outputs.download-path }}'/**/lib* addons/lua-gdextension/build | |
| - name: Download Godot | |
| run: | | |
| curl --location https://github.com/godotengine/godot/releases/download/${{ matrix.godot-release }} --output godot.zip | |
| unzip godot.zip | |
| - name: Run tests | |
| run: | | |
| make test | |
| distribute_zip: | |
| name: Distribute zip | |
| needs: [build_linux, build_windows, build_macos, build_web] | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| luajit: [false, true] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Download artifacts | |
| id: download | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts | |
| pattern: "*-${{ matrix.luajit && 'luajit' || 'lua' }}" | |
| merge-multiple: true | |
| - name: Setup godot-cpp | |
| uses: ./lib/godot-cpp/.github/actions/setup-godot-cpp | |
| with: | |
| platform: linux | |
| scons-version: $SCONS_VERSION | |
| - name: Copy artifacts to build folder | |
| run: | | |
| scons luajit=${{ matrix.luajit }} addons_files | |
| cp -r ${{ steps.download.outputs.download-path }}/**/lib* addons/lua-gdextension/build | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: lua-gdextension${{ matrix.luajit && '+luajit' || '' }} | |
| path: | | |
| LICENSE | |
| addons/lua-gdextension/** | |