From 6f20f3f0520e985e72ec169a5687f68999963fcf Mon Sep 17 00:00:00 2001 From: Emma Date: Mon, 27 Jul 2026 13:38:29 -0400 Subject: [PATCH 1/3] chore: Point CMB resources at new monorepo --- .github/workflows/cmb-runtime-build.yaml | 49 ++++++++++++++++++++++++ Tools/CI/service.cmb/README.md | 13 +++++-- Tools/CI/service.cmb/run_cmb_service.sh | 11 ++++-- 3 files changed, 66 insertions(+), 7 deletions(-) create mode 100644 .github/workflows/cmb-runtime-build.yaml diff --git a/.github/workflows/cmb-runtime-build.yaml b/.github/workflows/cmb-runtime-build.yaml new file mode 100644 index 0000000000..017abe5a13 --- /dev/null +++ b/.github/workflows/cmb-runtime-build.yaml @@ -0,0 +1,49 @@ +# Builds the CMB runtime (comb-server) from unity-player-services on all +# desktop platforms and publishes the binaries as downloadable artifacts. +# See ../Tools/CI/service.cmb/README.md for more information. +name: CMB Runtime Build + +on: + workflow_dispatch: + inputs: + ref: + description: 'unity-player-services branch, tag, or SHA to build' + required: false + default: 'main' + +env: + RUNTIME_DIR: services/common-multiplayer-backend/runtime + +jobs: + build: + name: Build comb-server (${{ matrix.os }}) + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + with: + repository: Unity-Technologies/unity-player-services + ref: ${{ inputs.ref }} + token: ${{ secrets.NETCODE_CI_SERVICE_TOKEN }} + sparse-checkout: services/common-multiplayer-backend/runtime + - uses: dtolnay/rust-toolchain@stable + - uses: Swatinem/rust-cache@v2.8.2 + with: + workspaces: ${{ env.RUNTIME_DIR }} + - uses: arduino/setup-protoc@v3 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + - name: Build + working-directory: ${{ env.RUNTIME_DIR }} + run: cargo build --release --locked + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: comb-server-${{ matrix.os }} + if-no-files-found: error + path: | + ${{ env.RUNTIME_DIR }}/target/release/comb-server + ${{ env.RUNTIME_DIR }}/target/release/comb-server.exe diff --git a/Tools/CI/service.cmb/README.md b/Tools/CI/service.cmb/README.md index e50f68b86b..0232c32125 100644 --- a/Tools/CI/service.cmb/README.md +++ b/Tools/CI/service.cmb/README.md @@ -1,6 +1,6 @@ # Testing against the CMB Service -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. +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. Due to this, there is some more setup needed when running tests against the CMB Service. @@ -16,9 +16,12 @@ First, ensure the `USE_CMB_SERVICE` scripting define or environment variable is ### Download the service -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). +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. +2. Trigger a new run with **Run workflow** + a. optionally pass a unity-player-services branch, tag, or SHA (default will build `main`). +3. Wait for the action to finish running. -Inside the **Artifacts** section at the bottom of the page, download the `comb-server--latest` that matches your computer architecture. This will download a pre-built binary of the most recent CMB Service. +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--latest` binary that matches your computer architecture. ### Run the service locally @@ -56,3 +59,7 @@ The following environment variables allow for further configuration of the setup `CMB_SERVICE_PORT` defines the port where the tests will try to connect to the service (defaults to `7789`). `NGO_HOST` defines the http address where the tests will try to connect to the service (defaults to `127.0.0.1`). + +## Running on CI (Yamato) + +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 - [, , ]`. 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. diff --git a/Tools/CI/service.cmb/run_cmb_service.sh b/Tools/CI/service.cmb/run_cmb_service.sh index 4bcf8c7468..8dd26df88a 100755 --- a/Tools/CI/service.cmb/run_cmb_service.sh +++ b/Tools/CI/service.cmb/run_cmb_service.sh @@ -17,7 +17,7 @@ # Example usage: # .//run_cmb_service.sh -e 7788 -s 7799 - # This script is currently used in the desktop-standalone-tests yamato job. + # This script is currently used in the cmb-service-standalone-tests yamato job (found at ../../../.yamato/cmb-service-standalone-tests.yml). # TECHNICAL CONSIDERATIONS--------------------------------------------------------------- # This is a bash script and so needs to be run on a Unix based system. @@ -136,11 +136,14 @@ else logMessage "Protocol Buffer Compiler Installed & ENV variables verified!\n PROTOC path is: $PROTOC" fi -# clone the cmb service repo -git clone https://github.com/Unity-Technologies/mps-common-multiplayer-backend.git +# Sparse-checkout only the CMB service directory from the unity-player-services monorepo. +# --filter=blob:none + --depth 1 avoids downloading file contents and history for the rest of the monorepo. +git clone --depth 1 --filter=blob:none --sparse https://github.com/Unity-Technologies/unity-player-services.git +cd ./unity-player-services +git sparse-checkout set services/common-multiplayer-backend/runtime # navigate to the cmb service directory -cd ./mps-common-multiplayer-backend/runtime +cd ./services/common-multiplayer-backend/runtime # Install rust curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y From 6c8ef134faa988e26af466aabca95df1c17a3d58 Mon Sep 17 00:00:00 2001 From: Emma Date: Mon, 27 Jul 2026 13:56:57 -0400 Subject: [PATCH 2/3] test build action --- .github/workflows/cmb-runtime-build.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/cmb-runtime-build.yaml b/.github/workflows/cmb-runtime-build.yaml index 017abe5a13..13d08acfe0 100644 --- a/.github/workflows/cmb-runtime-build.yaml +++ b/.github/workflows/cmb-runtime-build.yaml @@ -4,6 +4,9 @@ name: CMB Runtime Build on: + push: + branches: + - chore/point-cmb-at-monorepo workflow_dispatch: inputs: ref: From 89b13bbd1c1d36ebc7c452d6e46404cd0c01e3b7 Mon Sep 17 00:00:00 2001 From: Emma Date: Mon, 27 Jul 2026 15:39:34 -0400 Subject: [PATCH 3/3] Drop using our own github action to build the binaries --- .github/workflows/cmb-runtime-build.yaml | 52 ------------------------ Tools/CI/service.cmb/README.md | 7 +--- 2 files changed, 2 insertions(+), 57 deletions(-) delete mode 100644 .github/workflows/cmb-runtime-build.yaml diff --git a/.github/workflows/cmb-runtime-build.yaml b/.github/workflows/cmb-runtime-build.yaml deleted file mode 100644 index 13d08acfe0..0000000000 --- a/.github/workflows/cmb-runtime-build.yaml +++ /dev/null @@ -1,52 +0,0 @@ -# Builds the CMB runtime (comb-server) from unity-player-services on all -# desktop platforms and publishes the binaries as downloadable artifacts. -# See ../Tools/CI/service.cmb/README.md for more information. -name: CMB Runtime Build - -on: - push: - branches: - - chore/point-cmb-at-monorepo - workflow_dispatch: - inputs: - ref: - description: 'unity-player-services branch, tag, or SHA to build' - required: false - default: 'main' - -env: - RUNTIME_DIR: services/common-multiplayer-backend/runtime - -jobs: - build: - name: Build comb-server (${{ matrix.os }}) - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest, windows-latest, macos-latest] - runs-on: ${{ matrix.os }} - steps: - - uses: actions/checkout@v4 - with: - repository: Unity-Technologies/unity-player-services - ref: ${{ inputs.ref }} - token: ${{ secrets.NETCODE_CI_SERVICE_TOKEN }} - sparse-checkout: services/common-multiplayer-backend/runtime - - uses: dtolnay/rust-toolchain@stable - - uses: Swatinem/rust-cache@v2.8.2 - with: - workspaces: ${{ env.RUNTIME_DIR }} - - uses: arduino/setup-protoc@v3 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - - name: Build - working-directory: ${{ env.RUNTIME_DIR }} - run: cargo build --release --locked - - name: Upload artifact - uses: actions/upload-artifact@v4 - with: - name: comb-server-${{ matrix.os }} - if-no-files-found: error - path: | - ${{ env.RUNTIME_DIR }}/target/release/comb-server - ${{ env.RUNTIME_DIR }}/target/release/comb-server.exe diff --git a/Tools/CI/service.cmb/README.md b/Tools/CI/service.cmb/README.md index 0232c32125..97079d3393 100644 --- a/Tools/CI/service.cmb/README.md +++ b/Tools/CI/service.cmb/README.md @@ -16,12 +16,9 @@ First, ensure the `USE_CMB_SERVICE` scripting define or environment variable is ### Download the service -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. -2. Trigger a new run with **Run workflow** - a. optionally pass a unity-player-services branch, tag, or SHA (default will build `main`). -3. Wait for the action to finish running. +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). -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--latest` binary that matches your computer architecture. +Inside the **Artifacts** section at the bottom of the page, download the `comb-server--latest` that matches your computer architecture. This will download a pre-built binary of the most recent CMB Service. ### Run the service locally