2121 include :
2222 - { runner: spacetimedb-runner, smoketest_args: --docker }
2323 - { runner: windows-latest, smoketest_args: --no-build-cli }
24- runner : [ spacetimedb-runner, windows-latest ]
24+ runner : [spacetimedb-runner, windows-latest]
2525 runs-on : ${{ matrix.runner }}
2626 steps :
2727 - name : Find Git ref
4444 - uses : actions/setup-dotnet@v4
4545 with :
4646 global-json-file : modules/global.json
47- - name : Install psql (Windows)
48- if : runner.os == 'Windows'
49- run : choco install psql -y --no-progress
50- shell : powershell
5147 - name : Build and start database (Linux)
5248 if : runner.os == 'Linux'
5349 run : docker compose up -d
@@ -58,13 +54,11 @@ jobs:
5854 Start-Process target/debug/spacetimedb-cli.exe start
5955 cd modules
6056 # the sdk-manifests on windows-latest are messed up, so we need to update them
61- dotnet workload config --update-mode manifests
57+ dotnet workload config --update-mode workload-set
6258 dotnet workload update
6359 - uses : actions/setup-python@v5
6460 with : { python-version: '3.12' }
6561 if : runner.os == 'Windows'
66- - name : Install psycopg2
67- run : python -m pip install psycopg2-binary
6862 - name : Run smoketests
6963 # Note: clear_database and replication only work in private
7064 run : python -m smoketests ${{ matrix.smoketest_args }} -x clear_database replication
@@ -247,7 +241,7 @@ jobs:
247241 name : Unreal Engine Tests
248242 # This can't go on e.g. ubuntu-latest because that runner runs out of disk space. ChatGPT suggested that the general solution tends to be to use
249243 # a custom runner.
250- runs-on : ubuntu-latest
244+ runs-on : spacetimedb-runner
251245 container :
252246 image : ghcr.io/epicgames/unreal-engine:dev-5.6
253247 credentials :
@@ -259,7 +253,7 @@ jobs:
259253 password : ${{ secrets.GHCR_TOKEN }}
260254 # Run as root because otherwise we get permission denied for various directories inside the container. I tried doing dances to allow it to run
261255 # without this (reassigning env vars and stuff), but was unable to get it to work and it felt like an uphill battle.
262- # options: --user 0:0
256+ options : --user 0:0
263257 steps :
264258# Uncomment this before merging so that it will run properly if run manually through the GH actions flow. It was playing weird with rolled back
265259# commits though.
@@ -285,8 +279,23 @@ jobs:
285279 env :
286280 UE_ROOT_PATH : /home/ue4/UnrealEngine
287281 run : |
288- cargo test
282+ # 1) Fix ownership on mounts that actually exist
283+ for p in "$GITHUB_WORKSPACE" "$RUNNER_TEMP" "$RUNNER_TOOL_CACHE"; do
284+ if [ -n "${p:-}" ] && [ -d "$p" ]; then
285+ chown -R 1001:1001 "$p"
286+ fi
287+ done
289288
289+ # 2) Create a user/group with UID:GID 1001 if missing
290+ getent group 1001 >/dev/null || groupadd -g 1001 runnergrp
291+ getent passwd 1001 >/dev/null || useradd -u 1001 -g 1001 -m -s /bin/bash runnerusr
292+
293+ # 3) Run the build as that user (preserve env like UE_ROOT_PATH)
294+ sudo -E -H -u runnerusr bash -lc '
295+ id
296+ cd "$GITHUB_WORKSPACE/sdks/unreal"
297+ cargo test
298+ '
290299 cli_docs :
291300 name : Check CLI docs
292301 permissions : read-all
@@ -304,46 +313,23 @@ jobs:
304313 GIT_REF="${{ github.ref }}"
305314 fi
306315 echo "GIT_REF=${GIT_REF}" >>"$GITHUB_ENV"
307-
308316 - name : Checkout sources
309317 uses : actions/checkout@v4
310318 with :
311319 ref : ${{ env.GIT_REF }}
312-
313- - name : Set up Node.js
314- uses : actions/setup-node@v4
315- with :
316- node-version : 18
317-
318- - uses : pnpm/action-setup@v4
319- with :
320- run_install : true
321-
322- - name : Get pnpm store directory
323- shell : bash
324- working-directory : sdks/typescript
325- run : |
326- echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
327-
328- - uses : actions/cache@v4
329- name : Setup pnpm cache
330- with :
331- path : ${{ env.STORE_PATH }}
332- key : ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
333- restore-keys : |
334- ${{ runner.os }}-pnpm-store-
335-
336320 - uses : dsherret/rust-toolchain-file@v1
337-
338321 - name : Check for docs change
339322 run : |
340323 cargo run --features markdown-docs -p spacetimedb-cli > docs/docs/cli-reference.md
341- pnpm format
324+ cd docs
325+ # This is needed because our website doesn't render markdown quite properly.
326+ # See the README in docs for more details.
327+ sed -i'' -E 's!^(##) `(.*)`$!\1 \2!' docs/cli-reference.md
328+ sed -i'' -E 's!^(######) \*\*(.*)\*\*$!\1 <b>\2</b>!' docs/cli-reference.md
342329 git status
343330 if git diff --exit-code HEAD; then
344331 echo "No docs changes detected"
345332 else
346333 echo "It looks like the CLI docs have changed:"
347334 exit 1
348335 fi
349-
0 commit comments