@@ -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'
@@ -1180,3 +1187,59 @@ jobs:
11801187 fi
11811188
11821189 echo "No Python smoketest changes detected."
1190+
1191+ smoketests_mod_rs_complete :
1192+ name : Check smoketests/mod.rs is complete
1193+ runs-on : ubuntu-latest
1194+ permissions :
1195+ contents : read
1196+ env :
1197+ CARGO_TARGET_DIR : ${{ github.workspace }}/target
1198+ steps :
1199+ - name : Find Git ref
1200+ env :
1201+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
1202+ shell : bash
1203+ run : |
1204+ PR_NUMBER="${{ github.event.inputs.pr_number || null }}"
1205+ if test -n "${PR_NUMBER}"; then
1206+ GIT_REF="$( gh pr view --repo clockworklabs/SpacetimeDB $PR_NUMBER --json headRefName --jq .headRefName )"
1207+ else
1208+ GIT_REF="${{ github.ref }}"
1209+ fi
1210+ echo "GIT_REF=${GIT_REF}" >>"$GITHUB_ENV"
1211+ - name : Checkout sources
1212+ uses : actions/checkout@v4
1213+ with :
1214+ ref : ${{ env.GIT_REF }}
1215+ - uses : dsherret/rust-toolchain-file@v1
1216+ - name : Set default rust toolchain
1217+ run : rustup default $(rustup show active-toolchain | cut -d' ' -f1)
1218+ - name : Cache Rust dependencies
1219+ uses : Swatinem/rust-cache@v2
1220+ with :
1221+ workspaces : ${{ github.workspace }}
1222+ shared-key : spacetimedb
1223+ cache-on-failure : false
1224+ cache-all-crates : true
1225+ cache-workspace-crates : true
1226+ prefix-key : v1
1227+
1228+ # This step shouldn't be needed, but somehow we end up with caches that are missing librusty_v8.a.
1229+ # ChatGPT suspects that this could be due to different build invocations using the same target dir,
1230+ # and this makes sense to me because we only see it in this job where we mix `cargo build -p` with
1231+ # `cargo build --manifest-path` (which apparently build different dependency trees).
1232+ # However, we've been unable to fix it so... /shrug
1233+ - name : Check v8 outputs
1234+ shell : bash
1235+ run : |
1236+ find "${CARGO_TARGET_DIR}"/ -type f | grep '[/_]v8' || true
1237+ if ! [ -f "${CARGO_TARGET_DIR}"/debug/gn_out/obj/librusty_v8.a ]; then
1238+ echo "Could not find v8 output file librusty_v8.a; rebuilding manually."
1239+ cargo clean -p v8 || true
1240+ cargo build -p v8
1241+ fi
1242+
1243+ - name : Verify crates/smoketests/tests/smoketests/mod.rs lists all entries
1244+ run : |
1245+ cargo ci smoketests check-mod-list
0 commit comments