21
21
include :
22
22
- { runner: spacetimedb-runner, smoketest_args: --docker }
23
23
- { runner: windows-latest, smoketest_args: --no-build-cli }
24
- runner : [ spacetimedb-runner, windows-latest ]
24
+ runner : [spacetimedb-runner, windows-latest]
25
25
runs-on : ${{ matrix.runner }}
26
26
steps :
27
27
- name : Find Git ref
44
44
- uses : actions/setup-dotnet@v4
45
45
with :
46
46
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
51
47
- name : Build and start database (Linux)
52
48
if : runner.os == 'Linux'
53
49
run : docker compose up -d
@@ -58,13 +54,11 @@ jobs:
58
54
Start-Process target/debug/spacetimedb-cli.exe start
59
55
cd modules
60
56
# 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
62
58
dotnet workload update
63
59
- uses : actions/setup-python@v5
64
60
with : { python-version: '3.12' }
65
61
if : runner.os == 'Windows'
66
- - name : Install psycopg2
67
- run : python -m pip install psycopg2-binary
68
62
- name : Run smoketests
69
63
# Note: clear_database and replication only work in private
70
64
run : python -m smoketests ${{ matrix.smoketest_args }} -x clear_database replication
@@ -247,7 +241,7 @@ jobs:
247
241
name : Unreal Engine Tests
248
242
# 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
249
243
# a custom runner.
250
- runs-on : ubuntu-latest
244
+ runs-on : spacetimedb-runner
251
245
container :
252
246
image : ghcr.io/epicgames/unreal-engine:dev-5.6
253
247
credentials :
@@ -259,7 +253,7 @@ jobs:
259
253
password : ${{ secrets.GHCR_TOKEN }}
260
254
# Run as root because otherwise we get permission denied for various directories inside the container. I tried doing dances to allow it to run
261
255
# 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
263
257
steps :
264
258
# 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
265
259
# commits though.
@@ -280,13 +274,23 @@ jobs:
280
274
with :
281
275
ref : ${{ env.GIT_REF }}
282
276
- uses : dsherret/rust-toolchain-file@v1
283
- - name : Run Unreal Engine tests
284
- working-directory : sdks/unreal
285
- env :
286
- UE_ROOT_PATH : /home/ue4/UnrealEngine
287
- run : |
288
- cargo test
277
+ # 1) Fix ownership on mounts that actually exist
278
+ for p in "$GITHUB_WORKSPACE" "$RUNNER_TEMP" "$RUNNER_TOOL_CACHE"; do
279
+ if [ -n "${p:-}" ] && [ -d "$p" ]; then
280
+ chown -R 1001:1001 "$p"
281
+ fi
282
+ done
283
+
284
+ # 2) Create a user/group with UID:GID 1001 if missing
285
+ getent group 1001 >/dev/null || groupadd -g 1001 runnergrp
286
+ getent passwd 1001 >/dev/null || useradd -u 1001 -g 1001 -m -s /bin/bash runnerusr
289
287
288
+ # 3) Run the build as that user (preserve env like UE_ROOT_PATH)
289
+ sudo -E -H -u runnerusr bash -lc '
290
+ id
291
+ cd "$GITHUB_WORKSPACE/sdks/unreal"
292
+ cargo test
293
+ '
290
294
cli_docs:
291
295
name: Check CLI docs
292
296
permissions: read-all
@@ -304,46 +308,23 @@ jobs:
304
308
GIT_REF="${{ github.ref }}"
305
309
fi
306
310
echo "GIT_REF=${GIT_REF}" >>"$GITHUB_ENV"
307
-
308
311
- name: Checkout sources
309
312
uses: actions/checkout@v4
310
313
with:
311
314
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
-
336
315
- uses: dsherret/rust-toolchain-file@v1
337
-
338
316
- name: Check for docs change
339
317
run: |
340
318
cargo run --features markdown-docs -p spacetimedb-cli > docs/docs/cli-reference.md
341
- pnpm format
319
+ cd docs
320
+ # This is needed because our website doesn' t render markdown quite properly.
321
+ # See the README in docs for more details.
322
+ sed -i'' -E 's!^(##) `(.*)`$!\1 \2!' docs/cli-reference.md
323
+ sed -i'' -E 's!^(######) \*\*(.*)\*\*$!\1 <b>\2</b>!' docs/cli-reference.md
342
324
git status
343
325
if git diff --exit-code HEAD; then
344
326
echo "No docs changes detected"
345
327
else
346
328
echo "It looks like the CLI docs have changed:"
347
329
exit 1
348
330
fi
349
-
0 commit comments