Skip to content

Commit 77ee391

Browse files
committed
Debug
1 parent 5d6a89b commit 77ee391

File tree

1 file changed

+25
-44
lines changed

1 file changed

+25
-44
lines changed

.github/workflows/ci.yml

Lines changed: 25 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
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
@@ -44,10 +44,6 @@ jobs:
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.
@@ -280,13 +274,23 @@ jobs:
280274
with:
281275
ref: ${{ env.GIT_REF }}
282276
- 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
289287

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+
'
290294
cli_docs:
291295
name: Check CLI docs
292296
permissions: read-all
@@ -304,46 +308,23 @@ jobs:
304308
GIT_REF="${{ github.ref }}"
305309
fi
306310
echo "GIT_REF=${GIT_REF}" >>"$GITHUB_ENV"
307-
308311
- name: Checkout sources
309312
uses: actions/checkout@v4
310313
with:
311314
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-
336315
- uses: dsherret/rust-toolchain-file@v1
337-
338316
- name: Check for docs change
339317
run: |
340318
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
342324
git status
343325
if git diff --exit-code HEAD; then
344326
echo "No docs changes detected"
345327
else
346328
echo "It looks like the CLI docs have changed:"
347329
exit 1
348330
fi
349-

0 commit comments

Comments
 (0)