Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1254,6 +1254,66 @@ jobs:
path: demo/Blackholio/client-unity/Library
key: ${{ steps.restore-unity-library.outputs.cache-primary-key }}

unity-webgl-build:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's go with this for now but if we don't have enough runner throughput for the unity jobs then we might have to combine this with the other job. I wouldn't invest time into combining them right now since we already have this but if we start having issues later it would possibly be worth it to investigate combining them.

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.
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: 30
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' }}
Expand Down
Loading