From c17b7be84a62b9fb0b9b9f13bc05f1af90dfb0af Mon Sep 17 00:00:00 2001 From: Zeke Foppa Date: Mon, 31 Aug 2026 14:32:10 -0700 Subject: [PATCH 1/5] [bfops/webgl-ci]: CI - Test Unity WebGL build --- .github/workflows/ci.yml | 59 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d349ae85819..656ca0d34e3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1254,6 +1254,65 @@ jobs: path: demo/Blackholio/client-unity/Library key: ${{ steps.restore-unity-library.outputs.cache-primary-key }} + unity-webgl-build: + needs: [merge_queue_noop, lints] + # Skip if this is an external contribution. + # The license secrets will be empty, so the step would fail anyway. + if: ${{ needs.merge_queue_noop.outputs.skip != 'true' && (github.event_name != 'pull_request' || !github.event.pull_request.head.repo.fork) }} + permissions: + contents: read + runs-on: spacetimedb-unity-runner + timeout-minutes: 45 + env: + CARGO_TARGET_DIR: ${{ github.workspace }}/target + UNITY_VERSION: 2022.3.32f1 + steps: + - *find-git-ref + - *checkout-sources + + # Keep this before hydration so ignored build outputs do not affect hashFiles. + - name: Restore Unity WebGL Library + id: restore-unity-webgl-library + uses: actions/cache/restore@v4 + with: + path: demo/Blackholio/client-unity/Library + key: Unity-WebGL-v1-${{ runner.os }}-${{ env.UNITY_VERSION }}-${{ hashFiles('demo/Blackholio/client-unity/**', 'sdks/csharp/**', 'crates/bindings-csharp/BSATN.Runtime/**', 'crates/bindings-csharp/Runtime/**', 'crates/bindings-csharp/Directory.Build.props', 'tools/regen/src/csharp.rs', 'global.json') }} + restore-keys: | + Unity-WebGL-v1-${{ runner.os }}-${{ env.UNITY_VERSION }}- + + - name: Setup dotnet + uses: actions/setup-dotnet@v3 + with: + global-json-file: global.json + + - name: Install Rust toolchain + uses: dsherret/rust-toolchain-file@v1 + - *set-default-rust-toolchain + + - name: Hydrate Unity SDK DLLs + run: cargo regen csharp dlls + + - name: Build Unity WebGL player + uses: game-ci/unity-builder@v4 + with: + unityVersion: ${{ env.UNITY_VERSION }} + projectPath: demo/Blackholio/client-unity + targetPlatform: WebGL + buildsPath: demo/Blackholio/client-unity/Build + versioning: None + runAsHostUser: true + env: + UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} + UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} + UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }} + + - name: Save Unity WebGL Library + if: ${{ github.ref == 'refs/heads/master' && steps.restore-unity-webgl-library.outputs.cache-hit != 'true' }} + uses: actions/cache/save@v4 + with: + path: demo/Blackholio/client-unity/Library + key: ${{ steps.restore-unity-webgl-library.outputs.cache-primary-key }} + godot-testsuite: needs: [merge_queue_noop, lints, upload-build-artifacts-linux] if: ${{ needs.merge_queue_noop.outputs.skip != 'true' }} From 62dc9de3d774c39135aede7547876345f91f8815 Mon Sep 17 00:00:00 2001 From: Zeke Foppa Date: Mon, 31 Aug 2026 15:46:17 -0700 Subject: [PATCH 2/5] [bfops/webgl-ci]: Revert "Fix Unity WebGL IEnumerator import (#5792)" This reverts commit ea1f39f13f226f677a35c03093e351441e050caf. --- sdks/csharp/src/SpacetimeDBClient.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdks/csharp/src/SpacetimeDBClient.cs b/sdks/csharp/src/SpacetimeDBClient.cs index b726a15eefb..9e30b22c835 100644 --- a/sdks/csharp/src/SpacetimeDBClient.cs +++ b/sdks/csharp/src/SpacetimeDBClient.cs @@ -313,7 +313,7 @@ internal struct ParsedMessage }; #if UNITY_WEBGL && !UNITY_EDITOR - internal System.Collections.IEnumerator ParseMessages() + internal IEnumerator ParseMessages() #else internal void ParseMessages() #endif From cee9f257cfe37cc467a9ae4ad7ea8aaf2ecbba7b Mon Sep 17 00:00:00 2001 From: Zeke Foppa Date: Mon, 31 Aug 2026 15:48:12 -0700 Subject: [PATCH 3/5] [bfops/webgl-ci]: Rename check --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 656ca0d34e3..313b5fd7502 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1255,6 +1255,7 @@ jobs: key: ${{ steps.restore-unity-library.outputs.cache-primary-key }} unity-webgl-build: + name: Unity WebGL build needs: [merge_queue_noop, lints] # Skip if this is an external contribution. # The license secrets will be empty, so the step would fail anyway. From 739c324cb7cb544181cabd2883fb24353aa35a84 Mon Sep 17 00:00:00 2001 From: Zeke Foppa Date: Mon, 31 Aug 2026 16:02:09 -0700 Subject: [PATCH 4/5] [bfops/webgl-ci]: Revert "[bfops/webgl-ci]: Revert "Fix Unity WebGL IEnumerator import (#5792)"" This reverts commit 62dc9de3d774c39135aede7547876345f91f8815. --- sdks/csharp/src/SpacetimeDBClient.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdks/csharp/src/SpacetimeDBClient.cs b/sdks/csharp/src/SpacetimeDBClient.cs index 9e30b22c835..b726a15eefb 100644 --- a/sdks/csharp/src/SpacetimeDBClient.cs +++ b/sdks/csharp/src/SpacetimeDBClient.cs @@ -313,7 +313,7 @@ internal struct ParsedMessage }; #if UNITY_WEBGL && !UNITY_EDITOR - internal IEnumerator ParseMessages() + internal System.Collections.IEnumerator ParseMessages() #else internal void ParseMessages() #endif From 826f055fb1000c3e2c49b613c06bc6f6904278eb Mon Sep 17 00:00:00 2001 From: Zeke Foppa <196249+bfops@users.noreply.github.com> Date: Mon, 31 Aug 2026 16:03:31 -0700 Subject: [PATCH 5/5] Update .github/workflows/ci.yml Signed-off-by: Zeke Foppa <196249+bfops@users.noreply.github.com> --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 313b5fd7502..058802c297d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1263,7 +1263,7 @@ jobs: permissions: contents: read runs-on: spacetimedb-unity-runner - timeout-minutes: 45 + timeout-minutes: 30 env: CARGO_TARGET_DIR: ${{ github.workspace }}/target UNITY_VERSION: 2022.3.32f1