Skip to content

Commit 6f20f3f

Browse files
committed
chore: Point CMB resources at new monorepo
1 parent 19fdff8 commit 6f20f3f

3 files changed

Lines changed: 66 additions & 7 deletions

File tree

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Builds the CMB runtime (comb-server) from unity-player-services on all
2+
# desktop platforms and publishes the binaries as downloadable artifacts.
3+
# See ../Tools/CI/service.cmb/README.md for more information.
4+
name: CMB Runtime Build
5+
6+
on:
7+
workflow_dispatch:
8+
inputs:
9+
ref:
10+
description: 'unity-player-services branch, tag, or SHA to build'
11+
required: false
12+
default: 'main'
13+
14+
env:
15+
RUNTIME_DIR: services/common-multiplayer-backend/runtime
16+
17+
jobs:
18+
build:
19+
name: Build comb-server (${{ matrix.os }})
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
os: [ubuntu-latest, windows-latest, macos-latest]
24+
runs-on: ${{ matrix.os }}
25+
steps:
26+
- uses: actions/checkout@v4
27+
with:
28+
repository: Unity-Technologies/unity-player-services
29+
ref: ${{ inputs.ref }}
30+
token: ${{ secrets.NETCODE_CI_SERVICE_TOKEN }}
31+
sparse-checkout: services/common-multiplayer-backend/runtime
32+
- uses: dtolnay/rust-toolchain@stable
33+
- uses: Swatinem/rust-cache@v2.8.2
34+
with:
35+
workspaces: ${{ env.RUNTIME_DIR }}
36+
- uses: arduino/setup-protoc@v3
37+
with:
38+
repo-token: ${{ secrets.GITHUB_TOKEN }}
39+
- name: Build
40+
working-directory: ${{ env.RUNTIME_DIR }}
41+
run: cargo build --release --locked
42+
- name: Upload artifact
43+
uses: actions/upload-artifact@v4
44+
with:
45+
name: comb-server-${{ matrix.os }}
46+
if-no-files-found: error
47+
path: |
48+
${{ env.RUNTIME_DIR }}/target/release/comb-server
49+
${{ env.RUNTIME_DIR }}/target/release/comb-server.exe

Tools/CI/service.cmb/README.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Testing against the CMB Service
22

3-
The CMB Service is a tool that is external to our repository. The tool is inside the `runtime` folder in the [mps-common-multiplayer-backend](https://github.com/Unity-Technologies/mps-common-multiplayer-backend) repository.
3+
The CMB Service is a tool that is external to our repository. The tool is inside the `runtime` folder of the [CMB service](https://github.com/Unity-Technologies/unity-player-services/tree/main/services/common-multiplayer-backend) in the Unity Player Services monorepo.
44

55
Due to this, there is some more setup needed when running tests against the CMB Service.
66

@@ -16,9 +16,12 @@ First, ensure the `USE_CMB_SERVICE` scripting define or environment variable is
1616

1717
### Download the service
1818

19-
Go to the `CMB Runtime CI` action inside the cmb repo ([link here](https://github.com/Unity-Technologies/mps-common-multiplayer-backend/actions/workflows/runtime.yaml)). Open the most recent job and scroll down to the bottom of the page (You may have to scroll in the sidebar on the left, the centre of the page is not scrollable).
19+
1. Go to the [CMB Runtime Build workflow](https://github.com/Unity-Technologies/com.unity.netcode.gameobjects/actions/workflows/cmb-runtime-build.yaml) on this repo's Actions page.
20+
2. Trigger a new run with **Run workflow**
21+
a. optionally pass a unity-player-services branch, tag, or SHA (default will build `main`).
22+
3. Wait for the action to finish running.
2023

21-
Inside the **Artifacts** section at the bottom of the page, download the `comb-server-<platform>-latest` that matches your computer architecture. This will download a pre-built binary of the most recent CMB Service.
24+
Inside the **Artifacts** section at the bottom of the page of the finished run you will see three pre-built `comb-server` binaries. Download the `comb-server-<platform>-latest` binary that matches your computer architecture.
2225

2326
### Run the service locally
2427

@@ -56,3 +59,7 @@ The following environment variables allow for further configuration of the setup
5659
`CMB_SERVICE_PORT` defines the port where the tests will try to connect to the service (defaults to `7789`).
5760

5861
`NGO_HOST` defines the http address where the tests will try to connect to the service (defaults to `127.0.0.1`).
62+
63+
## Running on CI (Yamato)
64+
65+
The CMB tests can also be run from Yamato. The jobs are defined in [`.yamato/cmb-service-standalone-tests.yml`](../../../.yamato/cmb-service-standalone-tests.yml) and appear in Yamato as `CMB Service Test - NGO <project> - [<platform>, <editor>, <backend>]`. The job can be triggered manually from any branch meaning it can be easier to run the CMB tests from Yamato rather than set them up locally. The test uses [`run_cmb_service.sh`](./run_cmb_service.sh) to setup and run the CMB service.

Tools/CI/service.cmb/run_cmb_service.sh

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
# Example usage:
1818
# ./<path-to-script>/run_cmb_service.sh -e 7788 -s 7799
1919

20-
# This script is currently used in the desktop-standalone-tests yamato job.
20+
# This script is currently used in the cmb-service-standalone-tests yamato job (found at ../../../.yamato/cmb-service-standalone-tests.yml).
2121

2222
# TECHNICAL CONSIDERATIONS---------------------------------------------------------------
2323
# This is a bash script and so needs to be run on a Unix based system.
@@ -136,11 +136,14 @@ else
136136
logMessage "Protocol Buffer Compiler Installed & ENV variables verified!\n PROTOC path is: $PROTOC"
137137
fi
138138

139-
# clone the cmb service repo
140-
git clone https://github.com/Unity-Technologies/mps-common-multiplayer-backend.git
139+
# Sparse-checkout only the CMB service directory from the unity-player-services monorepo.
140+
# --filter=blob:none + --depth 1 avoids downloading file contents and history for the rest of the monorepo.
141+
git clone --depth 1 --filter=blob:none --sparse https://github.com/Unity-Technologies/unity-player-services.git
142+
cd ./unity-player-services
143+
git sparse-checkout set services/common-multiplayer-backend/runtime
141144

142145
# navigate to the cmb service directory
143-
cd ./mps-common-multiplayer-backend/runtime
146+
cd ./services/common-multiplayer-backend/runtime
144147

145148
# Install rust
146149
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y

0 commit comments

Comments
 (0)