Skip to content

Commit 6b3a26a

Browse files
Merge remote-tracking branch 'origin/master' into jlarabie/unreal-multimodule
# Conflicts: # docs/docs/05-cli-reference/01-cli-reference.md
2 parents 0b00fb8 + a2c4341 commit 6b3a26a

466 files changed

Lines changed: 17819 additions & 3345 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.cargo/config.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ rustflags = ["--cfg", "tokio_unstable"]
33

44
[alias]
55
bump-versions = "run -p upgrade-version --"
6+
ci = "run -p ci --"
67

78
[target.x86_64-pc-windows-msvc]
89
# Use a different linker. Otherwise, the build fails with some obscure linker error that

.github/workflows/ci.yml

Lines changed: 62 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ jobs:
113113
run: python -m pip install -r smoketests/requirements.txt
114114
- name: Run smoketests
115115
# Note: clear_database and replication only work in private
116-
run: python -m smoketests ${{ matrix.smoketest_args }} -x clear_database replication teams
116+
run: cargo ci smoketests -- ${{ matrix.smoketest_args }} -x clear_database replication teams
117117
- name: Stop containers (Linux)
118118
if: always() && runner.os == 'Linux'
119119
run: docker compose -f .github/docker-compose.yml down
@@ -167,34 +167,12 @@ jobs:
167167
with:
168168
run_install: true
169169

170-
- name: Create /stdb dir
171-
run: |
172-
sudo mkdir /stdb
173-
sudo chmod 777 /stdb
174-
175170
- name: Build typescript module sdk
176171
working-directory: crates/bindings-typescript
177172
run: pnpm build
178173

179-
- name: Run cargo test
180-
#Note: Unreal tests will be run separately
181-
run: cargo test --all -- --skip unreal
182-
183-
# The fallocate tests have been flakely when running in parallel
184-
- name: Run fallocate tests
185-
run: cargo test -p spacetimedb-durability --features fallocate -- --test-threads=1
186-
187-
- name: Check that the test outputs are up-to-date
188-
run: bash tools/check-diff.sh
189-
190-
- name: Ensure C# autogen bindings are up-to-date
191-
run: |
192-
cargo run -p spacetimedb-codegen --example regen-csharp-moduledef
193-
bash tools/check-diff.sh crates/bindings-csharp
194-
195-
- name: C# bindings tests
196-
working-directory: crates/bindings-csharp
197-
run: dotnet test -warnaserror
174+
- name: Run tests
175+
run: cargo ci test
198176

199177
lints:
200178
name: Lints
@@ -224,30 +202,8 @@ jobs:
224202
with:
225203
global-json-file: global.json
226204

227-
- name: Run cargo fmt
228-
run: cargo fmt --all -- --check
229-
230-
- name: Run cargo clippy
231-
run: cargo clippy --all --tests --benches -- -D warnings
232-
233-
- name: Run C# formatting check
234-
working-directory: crates/bindings-csharp
235-
run: |
236-
dotnet tool restore
237-
dotnet csharpier --check .
238-
239-
- name: Run `cargo doc` for bindings crate
240-
# `bindings` is the only crate we care strongly about documenting,
241-
# since we link to its docs.rs from our website.
242-
# We won't pass `--no-deps`, though,
243-
# since we want everything reachable through it to also work.
244-
# This includes `sats` and `lib`.
245-
working-directory: crates/bindings
246-
env:
247-
# Make `cargo doc` exit with error on warnings, most notably broken links
248-
RUSTDOCFLAGS: '--deny warnings'
249-
run: |
250-
cargo doc
205+
- name: Run ci lint
206+
run: cargo ci lint
251207

252208
wasm_bindings:
253209
name: Build and test wasm bindings
@@ -273,20 +229,7 @@ jobs:
273229
save-if: false
274230

275231
- name: Run bindgen tests
276-
run: cargo test -p spacetimedb-codegen
277-
278-
# Make sure the `Cargo.lock` file reflects the latest available versions.
279-
# This is what users would end up with on a fresh module, so we want to
280-
# catch any compile errors arising from a different transitive closure
281-
# of dependencies than what is in the workspace lock file.
282-
#
283-
# For context see also: https://github.com/clockworklabs/SpacetimeDB/pull/2714
284-
- name: Update dependencies
285-
run: cargo update
286-
287-
- name: Build module-test
288-
run: cargo run -p spacetimedb-cli -- build --project-path modules/module-test
289-
232+
run: cargo ci wasm-bindings
290233

291234
publish_checks:
292235
name: Check that packages are publishable
@@ -350,6 +293,7 @@ jobs:
350293

351294
- name: Build spacetimedb-update
352295
run: cargo build --features github-token-auth --target ${{ matrix.target }} -p spacetimedb-update
296+
if: runner.os == 'Windows'
353297

354298
- name: Run self-install
355299
env:
@@ -362,6 +306,13 @@ jobs:
362306
# happens very frequently on the `macos-runner`, but we haven't seen it on any others).
363307
cargo run --features github-token-auth --target ${{ matrix.target }} -p spacetimedb-update -- self-install --root-dir="${ROOT_DIR}" --yes
364308
"${ROOT_DIR}"/spacetime --root-dir="${ROOT_DIR}" help
309+
if: runner.os == 'Windows'
310+
311+
- name: Test spacetimedb-update
312+
env:
313+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
314+
run: cargo ci update-flow --target=${{ matrix.target }} --github-token-auth
315+
if: runner.os != 'Windows'
365316

366317
unreal_engine_tests:
367318
name: Unreal Engine Tests
@@ -386,20 +337,20 @@ jobs:
386337
# without this (reassigning env vars and stuff), but was unable to get it to work and it felt like an uphill battle.
387338
options: --user 0:0
388339
steps:
389-
# 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
390-
# commits though.
391-
# - name: Find Git ref
392-
# env:
393-
# GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
394-
# shell: bash
395-
# run: |
396-
# PR_NUMBER="${{ github.event.inputs.pr_number || null }}"
397-
# if test -n "${PR_NUMBER}"; then
398-
# GIT_REF="$( gh pr view --repo clockworklabs/SpacetimeDB $PR_NUMBER --json headRefName --jq .headRefName )"
399-
# else
400-
# GIT_REF="${{ github.ref }}"
401-
# fi
402-
# echo "GIT_REF=${GIT_REF}" >>"$GITHUB_ENV"
340+
# 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
341+
# commits though.
342+
# - name: Find Git ref
343+
# env:
344+
# GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
345+
# shell: bash
346+
# run: |
347+
# PR_NUMBER="${{ github.event.inputs.pr_number || null }}"
348+
# if test -n "${PR_NUMBER}"; then
349+
# GIT_REF="$( gh pr view --repo clockworklabs/SpacetimeDB $PR_NUMBER --json headRefName --jq .headRefName )"
350+
# else
351+
# GIT_REF="${{ github.ref }}"
352+
# fi
353+
# echo "GIT_REF=${GIT_REF}" >>"$GITHUB_ENV"
403354
- name: Checkout sources
404355
uses: actions/checkout@v4
405356
with:
@@ -452,6 +403,33 @@ jobs:
452403
cargo test -- --test-threads=1
453404
'
454405
406+
ci_command_docs:
407+
name: Check CI command docs
408+
runs-on: ubuntu-latest
409+
steps:
410+
- name: Find Git ref
411+
env:
412+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
413+
shell: bash
414+
run: |
415+
PR_NUMBER="${{ github.event.inputs.pr_number || null }}"
416+
if test -n "${PR_NUMBER}"; then
417+
GIT_REF="$( gh pr view --repo clockworklabs/SpacetimeDB $PR_NUMBER --json headRefName --jq .headRefName )"
418+
else
419+
GIT_REF="${{ github.ref }}"
420+
fi
421+
echo "GIT_REF=${GIT_REF}" >>"$GITHUB_ENV"
422+
423+
- name: Checkout sources
424+
uses: actions/checkout@v4
425+
with:
426+
ref: ${{ env.GIT_REF }}
427+
428+
- uses: dsherret/rust-toolchain-file@v1
429+
430+
- name: Check for docs change
431+
run: cargo ci self-docs --check
432+
455433
cli_docs:
456434
name: Check CLI docs
457435
permissions: read-all
@@ -515,15 +493,7 @@ jobs:
515493

516494
- name: Check for docs change
517495
run: |
518-
cargo run --features markdown-docs -p spacetimedb-cli > docs/docs/cli-reference.md
519-
pnpm format
520-
git status
521-
if git diff --exit-code HEAD -- docs/docs/cli-reference.md; then
522-
echo "No docs changes detected"
523-
else
524-
echo "It looks like the CLI docs have changed:"
525-
exit 1
526-
fi
496+
cargo ci cli-docs
527497
528498
unity-testsuite:
529499
# Skip if this is an external contribution.
@@ -575,7 +545,7 @@ jobs:
575545
cat Cargo.toml
576546
577547
- name: Install Rust toolchain
578-
uses: dtolnay/rust-toolchain@stable
548+
uses: dsherret/rust-toolchain-file@v1
579549

580550
- name: Cache Rust dependencies
581551
uses: Swatinem/rust-cache@v2
@@ -609,7 +579,7 @@ jobs:
609579
enable_pr_comment: ${{ github.event_name == 'pull_request' }}
610580
target_path: sdks/csharp
611581
env:
612-
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
582+
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
613583

614584
- name: Start SpacetimeDB
615585
run: |
@@ -643,12 +613,12 @@ jobs:
643613
- name: Run Unity tests
644614
uses: game-ci/unity-test-runner@v4
645615
with:
646-
unityVersion: 2022.3.32f1 # Adjust Unity version to a valid tag
647-
projectPath: demo/Blackholio/client-unity # Path to the Unity project subdirectory
616+
unityVersion: 2022.3.32f1 # Adjust Unity version to a valid tag
617+
projectPath: demo/Blackholio/client-unity # Path to the Unity project subdirectory
648618
githubToken: ${{ secrets.GITHUB_TOKEN }}
649619
testMode: playmode
650620
useHostNetwork: true
651-
artifactsPath: ""
621+
artifactsPath: ''
652622
env:
653623
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
654624
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
@@ -699,7 +669,7 @@ jobs:
699669
run: dotnet format --no-restore --verify-no-changes SpacetimeDB.ClientSDK.sln
700670

701671
- name: Install Rust toolchain
702-
uses: dtolnay/rust-toolchain@stable
672+
uses: dsherret/rust-toolchain-file@v1
703673

704674
- name: Cache Rust dependencies
705675
uses: Swatinem/rust-cache@v2

.github/workflows/typescript-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ jobs:
8181
# echo "Using SpacetimeDB branch from file: $branch"
8282

8383
- name: Install Rust toolchain
84-
uses: dtolnay/rust-toolchain@stable
84+
uses: dsherret/rust-toolchain-file@v1
8585

8686
- name: Cache Rust dependencies
8787
uses: Swatinem/rust-cache@v2

0 commit comments

Comments
 (0)