Skip to content

Commit c4d2657

Browse files
authored
Add support for a [CI BUILD DEV] to build Development builds (#712)
Note that this does not need to also contain the regular [xCI BUILDx] command, and indeed, if this is part of a pull request, it should not (as then it will build twice). Also note that we currently have 11 builds, but only 20 available workers, which means that enabling Development builds will require a second round of builds. The queuing system will handle this automatically, but it will take longer. This commit also adds a dummy list of names to prevent the includes from overwriting each other. This is a quirk of Github matrices, whereby if there's *just* an include: list, it will copy them as-is, but once there's a predefined matrix, then include will overwrite, rather than append, anything with a matching key. By priming the list with the names, even without any of the config, we ensure that none will be skipped, and we just use the include list for the configurations.
1 parent f5228c5 commit c4d2657

File tree

1 file changed

+25
-5
lines changed

1 file changed

+25
-5
lines changed

.github/workflows/build.yml

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ jobs:
4343
fastlanelane: ${{ steps.version.outputs.fastlanelane}}
4444
uid: ${{ steps.github.outputs.uid }}
4545
gid: ${{ steps.github.outputs.gid }}
46+
flavors: ${{ steps.flavors.outputs.flavors }}
4647
steps:
4748
- name: Checkout repository
4849
uses: actions/checkout@v4
@@ -155,14 +156,28 @@ jobs:
155156
fi
156157
echo "uid=$(id -u)" >> $GITHUB_OUTPUT
157158
echo "gid=$(id -g)" >> $GITHUB_OUTPUT
159+
160+
- name: Determine whether to build Development builds or not
161+
id: flavors
162+
run: |
163+
set -x
164+
if [[ $(git log --format=%B ${{ github.event.pull_request.head.sha }} -1) == *'[CI BUILD DEV]'* ]]
165+
then
166+
echo 'flavors=[{"development": true, "title": "Development"}, {"development": false}]' >> $GITHUB_OUTPUT
167+
168+
else
169+
echo 'flavors=[{"development": false}]' >> $GITHUB_OUTPUT
170+
fi
171+
158172
build:
159-
name: ${{ matrix.name }}
173+
name: ${{ matrix.name }} ${{ matrix.flavors.title }}
160174
needs: configuration
161175
runs-on: ubuntu-latest
162176
strategy:
163177
fail-fast: false
164178
matrix:
165-
# We don't use an actual matrix because there's more exceptions than actual cases!
179+
flavors: ${{ fromJson(needs.configuration.outputs.flavors) }}
180+
name: [Windows OpenXR, Windows Pimax, Windows Rift, Linux, MacOS, Android OpenXR, Oculus Quest (1), Oculus Quest (2+), Android Pico, Android Pico (CN), iOS Zapbox] # These will all be overwritten, but because we have the flavors matrix as well, we can't just add configurations via include; they'll overwrite each other. This way ensures that we get each one
166181
include:
167182
- name: Windows OpenXR
168183
targetPlatform: StandaloneWindows64
@@ -275,7 +290,7 @@ jobs:
275290
lfs: true # We don't use LFS, but it adds no time, and leave it here in case we do at some point later
276291

277292
- name: Install Pimax unity package
278-
if: matrix.name == 'Windows Pimax'
293+
if: startsWith(matrix.name, 'Windows Pimax')
279294
run: |
280295
# version 0.6.3
281296
# Same as above, but adapted to work for Pimax instead.
@@ -401,6 +416,11 @@ jobs:
401416
run: |
402417
echo "stamp=-btb-stamp ${{needs.configuration.outputs.stamp}}" >> $GITHUB_ENV
403418
419+
- name: Enable Development Mode
420+
if: ${{ matrix.flavors.development == true }}
421+
run: |
422+
echo "btbbopts=-btb-bopt Development" >> $GITHUB_ENV
423+
404424
- name: Update version
405425
env:
406426
VERSION: ${{ needs.configuration.outputs.version}}
@@ -445,7 +465,7 @@ jobs:
445465
allowDirtyBuild: true # Because of the OVR Update, the build tree might be dirty
446466
unityVersion: ${{ env.UNITY_VERSION }}
447467
targetPlatform: ${{ matrix.targetPlatform }}
448-
customParameters: -btb-target ${{ matrix.targetPlatform }} -btb-display ${{ matrix.vrsdk }} -btb-out /github/workspace/build/${{ matrix.vrsdk }}/${{ matrix.targetPlatform }}/${{ env.filename }} ${{ needs.configuration.outputs.description}} ${{ env.stamp }} ${{ matrix.extraoptions }}
468+
customParameters: -btb-target ${{ matrix.targetPlatform }} -btb-display ${{ matrix.vrsdk }} -btb-out /github/workspace/build/${{ matrix.vrsdk }}/${{ matrix.targetPlatform }}/${{ env.filename }} ${{ needs.configuration.outputs.description}} ${{ env.stamp }} ${{ env.btbbopts }} ${{ matrix.extraoptions }}
449469
versioning: Custom
450470
androidVersionCode: "${{ needs.configuration.outputs.androidVersionCode }}${{ matrix.versionSuffix }}"
451471
version: ${{ needs.configuration.outputs.version }}
@@ -485,7 +505,7 @@ jobs:
485505
allowDirtyBuild: true # Because of the OVR Update, the build tree might be dirty
486506
unityVersion: ${{ env.UNITY_VERSION }}
487507
targetPlatform: ${{ matrix.targetPlatform }}
488-
customParameters: -btb-target ${{ matrix.targetPlatform }} -btb-display ${{ matrix.vrsdk }} -btb-out /github/workspace/build/${{ matrix.vrsdk }}/${{ matrix.targetPlatform }}/${{ env.filename }} ${{ needs.configuration.outputs.description}} ${{ env.stamp }} ${{ matrix.extraoptions }}
508+
customParameters: -btb-target ${{ matrix.targetPlatform }} -btb-display ${{ matrix.vrsdk }} -btb-out /github/workspace/build/${{ matrix.vrsdk }}/${{ matrix.targetPlatform }}/${{ env.filename }} ${{ needs.configuration.outputs.description}} ${{ env.stamp }} ${{ env.btbbopts }} ${{ matrix.extraoptions }}
489509
versioning: Custom
490510
androidVersionCode: "${{ needs.configuration.outputs.androidVersionCode }}${{ matrix.versionSuffix }}"
491511
version: ${{ needs.configuration.outputs.version }}

0 commit comments

Comments
 (0)