Skip to content

Commit bbe83de

Browse files
konardclaude
andcommitted
fix(ci): correct spacetime CLI commands and add Windows support
- Replace `spacetime build --project-path` with `cargo build --release --target wasm32-unknown-unknown` (spacetime build has no --project-path flag; using cargo directly is simpler and equivalent) - Replace `spacetime publish --project-path` with `spacetime publish --bin-path <wasm>` pointing to the pre-built artifact - Add separate Windows install step using PowerShell: `iwr https://windows.spacetimedb.com -useb | iex` (the Unix installer at install.spacetimedb.com returns 404 on Windows) - Add Windows PATH update for SpacetimeDB binary location - Split server start and module publish steps by OS for cross-platform compat - Use cargo WASM build in benchmark job too for consistency Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent f122819 commit bbe83de

1 file changed

Lines changed: 48 additions & 12 deletions

File tree

.github/workflows/rust-benchmark.yml

Lines changed: 48 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -47,19 +47,28 @@ jobs:
4747
- name: Run Clippy
4848
run: cargo clippy --all-targets
4949

50-
- name: Install SpacetimeDB CLI
50+
- name: Install SpacetimeDB CLI (Unix)
51+
if: runner.os != 'Windows'
5152
shell: bash
5253
run: |
5354
curl -sSf https://install.spacetimedb.com | sh -s -- -y
5455
echo "$HOME/.local/bin" >> $GITHUB_PATH
5556
working-directory: .
5657

57-
- name: Build SpacetimeDB module (WASM)
58-
shell: bash
59-
run: spacetime build --project-path spacetime-module
58+
- name: Install SpacetimeDB CLI (Windows)
59+
if: runner.os == 'Windows'
60+
shell: pwsh
61+
run: |
62+
iwr https://windows.spacetimedb.com -useb | iex
63+
echo "$env:LOCALAPPDATA\SpacetimeDB\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
6064
working-directory: .
6165

62-
- name: Start SpacetimeDB server
66+
- name: Build SpacetimeDB module (WASM)
67+
run: cargo build --release --target wasm32-unknown-unknown
68+
working-directory: rust/spacetime-module
69+
70+
- name: Start SpacetimeDB server (Unix)
71+
if: runner.os != 'Windows'
6372
shell: bash
6473
run: |
6574
spacetime start &
@@ -73,11 +82,37 @@ jobs:
7382
done
7483
working-directory: .
7584

76-
- name: Publish SpacetimeDB module
77-
shell: bash
78-
run: spacetime publish --project-path spacetime-module benchmark-links
85+
- name: Start SpacetimeDB server (Windows)
86+
if: runner.os == 'Windows'
87+
shell: pwsh
88+
run: |
89+
Start-Process spacetime -ArgumentList "start" -NoNewWindow
90+
Write-Host "Waiting for SpacetimeDB server to be ready..."
91+
for ($i = 0; $i -lt 30; $i++) {
92+
try {
93+
$r = Invoke-WebRequest -Uri http://localhost:3000/ -UseBasicParsing -ErrorAction Stop
94+
Write-Host "SpacetimeDB server is ready"
95+
break
96+
} catch {
97+
Start-Sleep -Seconds 1
98+
}
99+
}
79100
working-directory: .
80101

102+
- name: Publish SpacetimeDB module (Unix)
103+
if: runner.os != 'Windows'
104+
shell: bash
105+
run: |
106+
spacetime publish --bin-path target/wasm32-unknown-unknown/release/spacetime_module.wasm benchmark-links
107+
working-directory: rust/spacetime-module
108+
109+
- name: Publish SpacetimeDB module (Windows)
110+
if: runner.os == 'Windows'
111+
shell: pwsh
112+
run: |
113+
spacetime publish --bin-path target/wasm32-unknown-unknown/release/spacetime_module.wasm benchmark-links
114+
working-directory: rust/spacetime-module
115+
81116
- name: Run tests
82117
env:
83118
SPACETIMEDB_URI: http://localhost:3000
@@ -122,8 +157,8 @@ jobs:
122157
working-directory: .
123158

124159
- name: Build SpacetimeDB module (WASM)
125-
run: spacetime build --project-path spacetime-module
126-
working-directory: .
160+
run: cargo build --release --target wasm32-unknown-unknown
161+
working-directory: rust/spacetime-module
127162

128163
- name: Start SpacetimeDB server
129164
run: |
@@ -138,8 +173,9 @@ jobs:
138173
working-directory: .
139174

140175
- name: Publish SpacetimeDB module
141-
run: spacetime publish --project-path spacetime-module benchmark-links
142-
working-directory: .
176+
run: |
177+
spacetime publish --bin-path target/wasm32-unknown-unknown/release/spacetime_module.wasm benchmark-links
178+
working-directory: rust/spacetime-module
143179

144180
- name: Build benchmark
145181
run: cargo build --release

0 commit comments

Comments
 (0)