From 56c3c2657232a5aa26880e0fcdd14d3291893fc4 Mon Sep 17 00:00:00 2001 From: Serhii Snitsaruk Date: Fri, 29 Dec 2023 14:58:45 +0100 Subject: [PATCH] GHA: Add a macOS build to test builds workflow --- .github/workflows/macos.yml | 40 ++++++++++++++++++++++++------- .github/workflows/test_builds.yml | 8 +++++++ 2 files changed, 40 insertions(+), 8 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 38dd193..f7bd244 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -10,6 +10,10 @@ on: description: A tag, branch or commit hash in the LimboAI repository. type: string default: master + test-build: + description: Is this a test build? In other words, should we only build a classical editor? + type: boolean + default: false workflow_dispatch: inputs: @@ -21,6 +25,10 @@ on: description: A tag, branch or commit hash in the LimboAI repository. type: string default: master + test-build: + description: Is this a test build? In other words, should we only build a classical editor? + type: boolean + default: false # Global Settings @@ -33,49 +41,55 @@ env: jobs: macos-builds: runs-on: "macos-latest" - name: ${{ matrix.name }} + name: ${{ matrix.opts.name }} strategy: fail-fast: false matrix: - include: + opts: - name: Editor (x86_64, release) target: editor arch: x86_64 build-mono: false artifact-name: macos-editor + should-build: true - name: Template (x86_64, release) target: template_release arch: x86_64 build-mono: false artifact-name: macos-templates + should-build: ${{ !inputs.test-build }} - name: Template (x86_64, debug) target: template_debug arch: x86_64 build-mono: false artifact-name: macos-templates + should-build: ${{ !inputs.test-build }} - name: Editor (arm64, release) target: editor arch: arm64 build-mono: false artifact-name: macos-editor + should-build: ${{ !inputs.test-build }} - name: Template (arm64, release) target: template_release arch: arm64 build-mono: false artifact-name: macos-templates + should-build: ${{ !inputs.test-build }} - name: Template (arm64, debug) target: template_debug arch: arm64 build-mono: false artifact-name: macos-templates + should-build: ${{ !inputs.test-build }} - # ! Disabled for now: .NET version fail to build + # ! Disabled for now: .NET version fails to build # - name: .NET Editor (x86_64, release) # target: editor @@ -83,18 +97,21 @@ jobs: # build-mono: true # artifact-name: macos-mono-editor # cache-name: macos-editor + # should-build: ${{ !inputs.test-build }} # - name: .NET Template (x86_64, release) # target: template_release # arch: x86_64 # build-mono: true # artifact-name: macos-mono-templates + # should-build: ${{ !inputs.test-build }} # - name: .NET Template (x86_64, debug) # target: template_debug # arch: x86_64 # build-mono: true # artifact-name: macos-mono-templates + # should-build: ${{ !inputs.test-build }} # - name: .NET Editor (arm64, release) # target: editor @@ -102,21 +119,27 @@ jobs: # build-mono: true # artifact-name: macos-mono-editor # cache-name: macos-editor + # should-build: ${{ !inputs.test-build }} # - name: .NET Template (arm64, release) # target: template_release # arch: arm64 # build-mono: true # artifact-name: macos-mono-templates + # should-build: ${{ !inputs.test-build }} # - name: .NET Template (arm64, debug) # target: template_debug # arch: arm64 # build-mono: true # artifact-name: macos-mono-templates + # should-build: ${{ !inputs.test-build }} + + exclude: + - { opts: {should-build: false }} env: - BIN: godot.macos.${{matrix.target}}.${{matrix.arch}}${{ matrix.build-mono == true && '.mono' || '' }} + BIN: godot.macos.${{matrix.opts.target}}.${{matrix.opts.arch}}${{ matrix.opts.build-mono == true && '.mono' || '' }} steps: @@ -170,17 +193,17 @@ jobs: env: SCONS_CACHE: ${{github.workspace}}/.scons_cache/ run: | - scons -j2 platform=macos target=${{matrix.target}} arch=${{matrix.arch}} module_mono_enabled=${{matrix.build-mono}} ${{env.SCONSFLAGS}} + scons -j2 platform=macos target=${{matrix.opts.target}} arch=${{matrix.opts.arch}} module_mono_enabled=${{matrix.opts.build-mono}} ${{env.SCONSFLAGS}} # ! Disabled for now: .NET version fail to build # - name: Generate C# glue - # if: matrix.build-mono && matrix.target == 'editor' + # if: matrix.opts.build-mono && matrix.opts.target == 'editor' # run: | # ./bin/$BIN --headless --generate-mono-glue ./modules/mono/glue || true # - name: Build .NET solutions - # if: matrix.build-mono && matrix.target == 'editor' + # if: matrix.opts.build-mono && matrix.opts.target == 'editor' # run: | # ./modules/mono/build_scripts/build_assemblies.py --godot-output-dir=./bin --godot-platform=macos @@ -192,13 +215,14 @@ jobs: - name: Upload artifact uses: actions/upload-artifact@v3 with: - name: ${{ matrix.artifact-name }} + name: ${{ matrix.opts.artifact-name }} path: bin/* make-macos-bundle: runs-on: "macos-latest" name: Make macOS Bundles needs: macos-builds + if: ${{ !inputs.test-build }} steps: diff --git a/.github/workflows/test_builds.yml b/.github/workflows/test_builds.yml index be4c288..7f76ee3 100644 --- a/.github/workflows/test_builds.yml +++ b/.github/workflows/test_builds.yml @@ -122,3 +122,11 @@ jobs: godot-treeish: ${{ inputs.godot-treeish }} limboai-treeish: ${{ github.sha }} test-build: true + + macos-build: + name: 🍎 macOS test build + uses: ./.github/workflows/macos.yml + with: + godot-treeish: ${{ inputs.godot-treeish }} + limboai-treeish: ${{ github.sha }} + test-build: true