@@ -101,8 +101,15 @@ jobs:
101101
102102 - name : Install psql (Windows)
103103 if : runner.os == 'Windows'
104- run : choco install psql -y --no-progress
105- shell : powershell
104+ shell : pwsh
105+ run : |
106+ # Fail properly if any individual command fails
107+ $ErrorActionPreference = 'Stop'
108+ $PSNativeCommandUseErrorActionPreference = $true
109+ choco install psql -y --no-progress
110+ # Check for existence, since `choco` doesn't seem to fail the step if it fails to install..
111+ # See https://github.com/clockworklabs/SpacetimeDB/pull/4399 for more background.
112+ Get-Command psql
106113
107114 - name : Update dotnet workloads
108115 if : runner.os == 'Windows'
@@ -171,132 +178,6 @@ jobs:
171178 exit 1
172179 }
173180
174- smoketests-python :
175- needs : [lints]
176- name : Smoketests (Python Legacy) (${{matrix.name}})
177- strategy :
178- matrix :
179- include :
180- - name : Linux
181- runner : spacetimedb-new-runner-2
182- smoketest_args : --docker
183- - name : Windows
184- runner : windows-latest
185- smoketest_args : --no-build-cli
186- runs-on : ${{ matrix.runner }}
187- timeout-minutes : 120
188- env :
189- CARGO_TARGET_DIR : ${{ github.workspace }}/target
190- steps :
191- - name : Find Git ref
192- env :
193- GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
194- shell : bash
195- run : |
196- PR_NUMBER="${{ github.event.inputs.pr_number || null }}"
197- if test -n "${PR_NUMBER}"; then
198- GIT_REF="$( gh pr view --repo clockworklabs/SpacetimeDB $PR_NUMBER --json headRefName --jq .headRefName )"
199- else
200- GIT_REF="${{ github.ref }}"
201- fi
202- echo "GIT_REF=${GIT_REF}" >>"$GITHUB_ENV"
203- - name : Checkout sources
204- uses : actions/checkout@v4
205- with :
206- ref : ${{ env.GIT_REF }}
207- - uses : dsherret/rust-toolchain-file@v1
208- - name : Set default rust toolchain
209- run : rustup default $(rustup show active-toolchain | cut -d' ' -f1)
210- - name : Cache Rust dependencies
211- uses : Swatinem/rust-cache@v2
212- with :
213- workspaces : ${{ github.workspace }}
214- shared-key : spacetimedb
215- cache-on-failure : false
216- cache-all-crates : true
217- cache-workspace-crates : true
218- prefix-key : v1
219-
220- # This step shouldn't be needed, but somehow we end up with caches that are missing librusty_v8.a.
221- # ChatGPT suspects that this could be due to different build invocations using the same target dir,
222- # and this makes sense to me because we only see it in this job where we mix `cargo build -p` with
223- # `cargo build --manifest-path` (which apparently build different dependency trees).
224- # However, we've been unable to fix it so... /shrug
225- - name : Check v8 outputs
226- shell : bash
227- run : |
228- find "${CARGO_TARGET_DIR}"/ -type f | grep '[/_]v8' || true
229- if ! [ -f "${CARGO_TARGET_DIR}"/debug/gn_out/obj/librusty_v8.a ]; then
230- echo "Could not find v8 output file librusty_v8.a; rebuilding manually."
231- cargo clean -p v8 || true
232- cargo build -p v8
233- fi
234-
235- - uses : actions/setup-dotnet@v4
236- with :
237- global-json-file : global.json
238-
239- - name : Override NuGet packages
240- shell : bash
241- run : |
242- dotnet pack -c Release crates/bindings-csharp/BSATN.Runtime
243- dotnet pack -c Release crates/bindings-csharp/Runtime
244- cd sdks/csharp
245- ./tools~/write-nuget-config.sh ../..
246-
247- # nodejs and pnpm are required for the typescript quickstart smoketest
248- - name : Set up Node.js
249- uses : actions/setup-node@v4
250- with :
251- node-version : 22
252-
253- - uses : pnpm/action-setup@v4
254- with :
255- run_install : true
256-
257- - name : Install psql (Windows)
258- if : runner.os == 'Windows'
259- run : choco install psql -y --no-progress
260- shell : powershell
261-
262- - name : Build crates
263- run : cargo build -p spacetimedb-cli -p spacetimedb-standalone -p spacetimedb-update
264-
265- - name : Build and start database (Linux)
266- if : runner.os == 'Linux'
267- run : |
268- # Our .dockerignore omits `target`, which our CI Dockerfile needs.
269- rm .dockerignore
270- docker compose -f .github/docker-compose.yml up -d
271-
272- - name : Build and start database (Windows)
273- if : runner.os == 'Windows'
274- run : |
275- # Fail properly if any individual command fails
276- $ErrorActionPreference = 'Stop'
277- $PSNativeCommandUseErrorActionPreference = $true
278-
279- Start-Process target/debug/spacetimedb-cli.exe -ArgumentList 'start --pg-port 5432'
280- cd modules
281- # the sdk-manifests on windows-latest are messed up, so we need to update them
282- dotnet workload config --update-mode manifests
283- dotnet workload update
284-
285- - uses : actions/setup-python@v5
286- with : { python-version: "3.12" }
287- if : runner.os == 'Windows'
288-
289- - name : Install python deps
290- run : python -m pip install -r smoketests/requirements.txt
291-
292- - name : Run Python smoketests
293- # Note: clear_database and replication only work in private
294- run : python -m smoketests ${{ matrix.smoketest_args }} -x clear_database replication teams
295-
296- - name : Stop containers (Linux)
297- if : always() && runner.os == 'Linux'
298- run : docker compose -f .github/docker-compose.yml down
299-
300181 test :
301182 needs : [lints]
302183 name : Test Suite
@@ -1180,3 +1061,59 @@ jobs:
11801061 fi
11811062
11821063 echo "No Python smoketest changes detected."
1064+
1065+ smoketests_mod_rs_complete :
1066+ name : Check smoketests/mod.rs is complete
1067+ runs-on : ubuntu-latest
1068+ permissions :
1069+ contents : read
1070+ env :
1071+ CARGO_TARGET_DIR : ${{ github.workspace }}/target
1072+ steps :
1073+ - name : Find Git ref
1074+ env :
1075+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
1076+ shell : bash
1077+ run : |
1078+ PR_NUMBER="${{ github.event.inputs.pr_number || null }}"
1079+ if test -n "${PR_NUMBER}"; then
1080+ GIT_REF="$( gh pr view --repo clockworklabs/SpacetimeDB $PR_NUMBER --json headRefName --jq .headRefName )"
1081+ else
1082+ GIT_REF="${{ github.ref }}"
1083+ fi
1084+ echo "GIT_REF=${GIT_REF}" >>"$GITHUB_ENV"
1085+ - name : Checkout sources
1086+ uses : actions/checkout@v4
1087+ with :
1088+ ref : ${{ env.GIT_REF }}
1089+ - uses : dsherret/rust-toolchain-file@v1
1090+ - name : Set default rust toolchain
1091+ run : rustup default $(rustup show active-toolchain | cut -d' ' -f1)
1092+ - name : Cache Rust dependencies
1093+ uses : Swatinem/rust-cache@v2
1094+ with :
1095+ workspaces : ${{ github.workspace }}
1096+ shared-key : spacetimedb
1097+ cache-on-failure : false
1098+ cache-all-crates : true
1099+ cache-workspace-crates : true
1100+ prefix-key : v1
1101+
1102+ # This step shouldn't be needed, but somehow we end up with caches that are missing librusty_v8.a.
1103+ # ChatGPT suspects that this could be due to different build invocations using the same target dir,
1104+ # and this makes sense to me because we only see it in this job where we mix `cargo build -p` with
1105+ # `cargo build --manifest-path` (which apparently build different dependency trees).
1106+ # However, we've been unable to fix it so... /shrug
1107+ - name : Check v8 outputs
1108+ shell : bash
1109+ run : |
1110+ find "${CARGO_TARGET_DIR}"/ -type f | grep '[/_]v8' || true
1111+ if ! [ -f "${CARGO_TARGET_DIR}"/debug/gn_out/obj/librusty_v8.a ]; then
1112+ echo "Could not find v8 output file librusty_v8.a; rebuilding manually."
1113+ cargo clean -p v8 || true
1114+ cargo build -p v8
1115+ fi
1116+
1117+ - name : Verify crates/smoketests/tests/smoketests/mod.rs lists all entries
1118+ run : |
1119+ cargo ci smoketests check-mod-list
0 commit comments