1313
1414name : CI
1515
16+ concurrency :
17+ group : ${{ github.workflow }}-${{ github.event.pull_request.number || github.event.inputs.pr_number || format('sha-{0}', github.sha) }}
18+ cancel-in-progress : true
19+
1620jobs :
1721 docker_smoketests :
1822 name : Smoketests
1923 strategy :
2024 matrix :
25+ runner : [spacetimedb-new-runner, windows-latest]
2126 include :
22- - { runner: spacetimedb-runner, smoketest_args: --docker }
23- - { runner: windows-latest, smoketest_args: --no-build-cli }
24- runner : [ spacetimedb-runner, windows-latest ]
27+ - runner : spacetimedb-new-runner
28+ smoketest_args : --docker
29+ container :
30+ image : localhost:5000/spacetimedb-ci:latest
31+ options : --privileged
32+ - runner : windows-latest
33+ smoketest_args : --no-build-cli
34+ container : null
2535 runs-on : ${{ matrix.runner }}
36+ container : ${{ matrix.container }}
37+
2638 steps :
2739 - name : Find Git ref
2840 env :
@@ -44,10 +56,25 @@ jobs:
4456 - uses : actions/setup-dotnet@v4
4557 with :
4658 global-json-file : global.json
59+
60+ # nodejs and pnpm are required for the typescript quickstart smoketest
61+ - name : Set up Node.js
62+ uses : actions/setup-node@v4
63+ with :
64+ node-version : 18
65+
66+ - uses : pnpm/action-setup@v4
67+ with :
68+ run_install : true
69+
4770 - name : Install psql (Windows)
4871 if : runner.os == 'Windows'
4972 run : choco install psql -y --no-progress
5073 shell : powershell
74+ - name : Start Docker daemon
75+ if : runner.os == 'Linux'
76+ run : /usr/local/bin/start-docker.sh
77+
5178 - name : Build and start database (Linux)
5279 if : runner.os == 'Linux'
5380 run : docker compose up -d
5885 $ErrorActionPreference = 'Stop'
5986 $PSNativeCommandUseErrorActionPreference = $true
6087
61- # Use a different linker. Otherwise, the build fails with some obscure linker error that
62- # seems to be a result of us producing a massive PDB file.
63- # I (@bfops) tried a variety of other link options besides switching linkers, but this
64- # seems to be the only thing that worked.
65- $env:RUSTFLAGS='-Clinker=lld-link'
66-
6788 cargo build -p spacetimedb-cli -p spacetimedb-standalone -p spacetimedb-update
6889 Start-Process target/debug/spacetimedb-cli.exe -ArgumentList 'start --pg-port 5432'
6990 cd modules
@@ -73,18 +94,22 @@ jobs:
7394 - uses : actions/setup-python@v5
7495 with : { python-version: '3.12' }
7596 if : runner.os == 'Windows'
76- - name : Install psycopg2
77- run : python -m pip install psycopg2-binary
97+ - name : Install python deps
98+ run : python -m pip install psycopg2-binary xmltodict
7899 - name : Run smoketests
79100 # Note: clear_database and replication only work in private
80- run : python -m smoketests ${{ matrix.smoketest_args }} -x clear_database replication
101+ run : python -m smoketests ${{ matrix.smoketest_args }} -x clear_database replication teams
81102 - name : Stop containers (Linux)
82103 if : always() && runner.os == 'Linux'
83104 run : docker compose down
84105
85106 test :
86107 name : Test Suite
87- runs-on : spacetimedb-runner
108+ runs-on : spacetimedb-new-runner
109+ container :
110+ image : localhost:5000/spacetimedb-ci:latest
111+ options : >-
112+ --privileged
88113 steps :
89114 - name : Find Git ref
90115 env :
@@ -109,15 +134,32 @@ jobs:
109134 with :
110135 global-json-file : global.json
111136
137+ - name : Set up Node.js
138+ uses : actions/setup-node@v4
139+ with :
140+ node-version : 18
141+
142+ - uses : pnpm/action-setup@v4
143+ with :
144+ run_install : true
145+
112146 - name : Create /stdb dir
113147 run : |
114148 sudo mkdir /stdb
115149 sudo chmod 777 /stdb
116150
151+ - name : Build typescript module sdk
152+ working-directory : crates/bindings-typescript
153+ run : pnpm build
154+
117155 - name : Run cargo test
118156 # Note: Unreal tests will be run separately
119157 run : cargo test --all -- --skip unreal
120158
159+ # The fallocate tests have been flakely when running in parallel
160+ - name : Run fallocate tests
161+ run : cargo test -p spacetimedb-durability --features fallocate -- --test-threads=1
162+
121163 - name : Check that the test outputs are up-to-date
122164 run : bash tools/check-diff.sh
123165
@@ -132,7 +174,11 @@ jobs:
132174
133175 lints :
134176 name : Lints
135- runs-on : spacetimedb-runner
177+ runs-on : spacetimedb-new-runner
178+ container :
179+ image : localhost:5000/spacetimedb-ci:latest
180+ options : >-
181+ --privileged
136182 steps :
137183 - name : Checkout sources
138184 uses : actions/checkout@v3
@@ -171,7 +217,11 @@ jobs:
171217
172218 wasm_bindings :
173219 name : Build and test wasm bindings
174- runs-on : spacetimedb-runner
220+ runs-on : spacetimedb-new-runner
221+ container :
222+ image : localhost:5000/spacetimedb-ci:latest
223+ options : >-
224+ --privileged
175225 steps :
176226 - uses : actions/checkout@v3
177227
@@ -196,7 +246,11 @@ jobs:
196246
197247 publish_checks :
198248 name : Check that packages are publishable
199- runs-on : ubuntu-latest
249+ runs-on : spacetimedb-new-runner
250+ container :
251+ image : localhost:5000/spacetimedb-ci:latest
252+ options : >-
253+ --privileged
200254 permissions : read-all
201255 steps :
202256 - uses : actions/checkout@v3
@@ -206,11 +260,12 @@ jobs:
206260 venv/bin/pip3 install argparse toml
207261 - name : Run checks
208262 run : |
263+ set -ueo pipefail
209264 FAILED=0
210- # This definition of ROOTS and invocation of find-publish-list.py is copied from publish-crates.sh
211- ROOTS=(bindings sdk cli standalone )
212- for crate in $(venv/bin/python3 tools/find-publish-list.py --recursive --quiet "${ROOTS[@]}") ; do
213- if ! venv/bin/python3 tools/crate-publish-checks.py "crates/$crate "; then
265+ ROOTS=(spacetimedb spacetimedb-sdk)
266+ CRATES=$(venv/bin/python3 tools/find-publish-list.py --recursive --directories --quiet "${ROOTS[@]}" )
267+ for crate_dir in $CRATES ; do
268+ if ! venv/bin/python3 tools/crate-publish-checks.py "${crate_dir} "; then
214269 FAILED=$(( $FAILED + 1 ))
215270 fi
216271 done
@@ -263,7 +318,9 @@ jobs:
263318 name : Unreal Engine Tests
264319 # 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
265320 # a custom runner.
266- runs-on : spacetimedb-runner
321+ runs-on : spacetimedb-new-runner
322+ # Skip if this is an external contribution. GitHub secrets will be empty, so the step would fail anyway.
323+ if : ${{ github.event_name != 'pull_request' || !github.event.pull_request.head.repo.fork }}
267324 container :
268325 image : ghcr.io/epicgames/unreal-engine:dev-5.6
269326 credentials :
@@ -340,13 +397,17 @@ jobs:
340397
341398 cd "$GITHUB_WORKSPACE/sdks/unreal"
342399 cargo --version
343- cargo test
400+ cargo test -- --test-threads=1
344401 '
345402
346403 cli_docs :
347404 name : Check CLI docs
348405 permissions : read-all
349- runs-on : ubuntu-latest
406+ runs-on : spacetimedb-new-runner
407+ container :
408+ image : localhost:5000/spacetimedb-ci:latest
409+ options : >-
410+ --privileged
350411 steps :
351412 - name : Find Git ref
352413 env :
0 commit comments