Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
4824f5f
add initial cargo ci
Kasama Oct 13, 2025
c8581e2
merge master into add/cargo-ci
Kasama Oct 15, 2025
1c0406d
update cargo ci
Kasama Oct 24, 2025
c5ea361
[add/cargo-ci]: Merge remote-tracking branch 'origin/master' into add…
bfops Oct 27, 2025
b86cce7
Merge branch 'master' of github.com:clockworklabs/SpacetimeDB into ad…
Kasama Oct 29, 2025
852c13c
fix: PR comments
Kasama Oct 29, 2025
2b2250a
update ci to call cargo for unreal test
Kasama Oct 29, 2025
a9b46b2
update cargo ci docs
Kasama Oct 29, 2025
89b40c0
merge master into add/cargo-ci
Kasama Nov 4, 2025
b318678
Merge branch 'master' of github.com:clockworklabs/SpacetimeDB into ad…
Kasama Nov 6, 2025
fe350f5
fix: temp disable unreal engine tests running from `cargo ci`
Kasama Nov 6, 2025
d546167
Merge branch 'master' of github.com:clockworklabs/SpacetimeDB into ad…
Kasama Nov 6, 2025
ac25ba8
fix cargo lock
Kasama Nov 6, 2025
93e12b7
update smoketests call
Kasama Nov 6, 2025
8bf7367
add directory check for cli-docs
Kasama Nov 6, 2025
a733f12
update cargo ci docs
Kasama Nov 6, 2025
51a0c14
merge master into add/cargo-ci
Kasama Nov 12, 2025
8a37584
Merge branch 'master' of github.com:clockworklabs/SpacetimeDB into ad…
Kasama Nov 12, 2025
44eafca
remove unreal tests from cargo ci initially
Kasama Nov 12, 2025
05d4693
[add/cargo-ci]: Merge remote-tracking branch 'origin/master' into add…
bfops Nov 20, 2025
661af74
[add/cargo-ci]: fixes
bfops Nov 20, 2025
b3e115f
[add/cargo-ci]: review
bfops Nov 20, 2025
e0517e0
[add/cargo-ci]: rm
bfops Nov 20, 2025
8a479f5
[add/cargo-ci]: revert
bfops Nov 20, 2025
dabe11f
[add/cargo-ci]: update self-docs
bfops Nov 20, 2025
f67e95d
[add/cargo-ci]: fix?
bfops Nov 20, 2025
4498429
[add/cargo-ci]: remove stale comment
bfops Nov 20, 2025
a7202ef
[add/cargo-ci]: review
bfops Nov 20, 2025
42ed67c
Merge branch 'master' of github.com:clockworklabs/SpacetimeDB into ad…
Kasama Nov 21, 2025
d13b20a
merge master into add/cargo-ci
Kasama Dec 3, 2025
941763d
workaround: don't use cargo ci for windows jobs
Kasama Dec 3, 2025
7cf2039
merge master into add/cargo-ci
Kasama Dec 8, 2025
7fd39fd
add: bash macro for python3 check
Kasama Dec 8, 2025
922dc0c
Merge branch 'master' into add/cargo-ci
bfops Dec 9, 2025
4070974
Apply suggestion from @bfops
bfops Dec 9, 2025
3fb016d
Apply suggestion from @bfops
bfops Dec 9, 2025
a3a2ea9
Merge branch 'master' of github.com:clockworklabs/SpacetimeDB into ad…
Kasama Dec 10, 2025
77a71ef
Merge branch 'add/cargo-ci' of github.com:clockworklabs/SpacetimeDB i…
Kasama Dec 10, 2025
94302a8
Update tools/ci/src/main.rs
Kasama Dec 10, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ rustflags = ["--cfg", "tokio_unstable"]

[alias]
bump-versions = "run -p upgrade-version --"
ci = "run -p ci --"

[target.x86_64-pc-windows-msvc]
# Use a different linker. Otherwise, the build fails with some obscure linker error that
Expand Down
155 changes: 65 additions & 90 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,14 @@
if: runner.os == 'Windows'
- name: Install python deps
run: python -m pip install -r smoketests/requirements.txt
- name: Run smoketests
- name: Run smoketests (windows)
# Note: clear_database and replication only work in private
run: python -m smoketests ${{ matrix.smoketest_args }} -x clear_database replication teams
if: runner.os == 'Windows'
- name: Run smoketests (Linux)
# Note: clear_database and replication only work in private
run: cargo ci smoketests -- ${{ matrix.smoketest_args }} -x clear_database replication teams
if: runner.os != 'Windows'
- name: Stop containers (Linux)
if: always() && runner.os == 'Linux'
run: docker compose -f .github/docker-compose.yml down
Expand Down Expand Up @@ -167,34 +172,12 @@
with:
run_install: true

- name: Create /stdb dir
run: |
sudo mkdir /stdb
sudo chmod 777 /stdb

- name: Build typescript module sdk
working-directory: crates/bindings-typescript
run: pnpm build

- name: Run cargo test
#Note: Unreal tests will be run separately
run: cargo test --all -- --skip unreal

# The fallocate tests have been flakely when running in parallel
- name: Run fallocate tests
run: cargo test -p spacetimedb-durability --features fallocate -- --test-threads=1

- name: Check that the test outputs are up-to-date
run: bash tools/check-diff.sh

- name: Ensure C# autogen bindings are up-to-date
run: |
cargo run -p spacetimedb-codegen --example regen-csharp-moduledef
bash tools/check-diff.sh crates/bindings-csharp

- name: C# bindings tests
working-directory: crates/bindings-csharp
run: dotnet test -warnaserror
- name: Run tests
run: cargo ci test

lints:
name: Lints
Expand Down Expand Up @@ -224,30 +207,8 @@
with:
global-json-file: global.json

- name: Run cargo fmt
run: cargo fmt --all -- --check

- name: Run cargo clippy
run: cargo clippy --all --tests --benches -- -D warnings

- name: Run C# formatting check
working-directory: crates/bindings-csharp
run: |
dotnet tool restore
dotnet csharpier --check .

- name: Run `cargo doc` for bindings crate
# `bindings` is the only crate we care strongly about documenting,
# since we link to its docs.rs from our website.
# We won't pass `--no-deps`, though,
# since we want everything reachable through it to also work.
# This includes `sats` and `lib`.
working-directory: crates/bindings
env:
# Make `cargo doc` exit with error on warnings, most notably broken links
RUSTDOCFLAGS: '--deny warnings'
run: |
cargo doc
- name: Run ci lint
run: cargo ci lint

wasm_bindings:
name: Build and test wasm bindings
Expand All @@ -273,20 +234,7 @@
save-if: false

- name: Run bindgen tests
run: cargo test -p spacetimedb-codegen

# Make sure the `Cargo.lock` file reflects the latest available versions.
# This is what users would end up with on a fresh module, so we want to
# catch any compile errors arising from a different transitive closure
# of dependencies than what is in the workspace lock file.
#
# For context see also: https://github.com/clockworklabs/SpacetimeDB/pull/2714
- name: Update dependencies
run: cargo update

- name: Build module-test
run: cargo run -p spacetimedb-cli -- build --project-path modules/module-test

run: cargo ci wasm-bindings

publish_checks:
name: Check that packages are publishable
Expand Down Expand Up @@ -350,6 +298,7 @@

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

- name: Run self-install
env:
Expand All @@ -362,6 +311,13 @@
# happens very frequently on the `macos-runner`, but we haven't seen it on any others).
cargo run --features github-token-auth --target ${{ matrix.target }} -p spacetimedb-update -- self-install --root-dir="${ROOT_DIR}" --yes
"${ROOT_DIR}"/spacetime --root-dir="${ROOT_DIR}" help
if: runner.os == 'Windows'

- name: Test spacetimedb-update
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: cargo ci update-flow --target=${{ matrix.target }} --github-token-auth
if: runner.os != 'Windows'

unreal_engine_tests:
name: Unreal Engine Tests
Expand All @@ -386,20 +342,20 @@
# without this (reassigning env vars and stuff), but was unable to get it to work and it felt like an uphill battle.
options: --user 0:0
steps:
# 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
# commits though.
# - name: Find Git ref
# env:
# GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# shell: bash
# run: |
# PR_NUMBER="${{ github.event.inputs.pr_number || null }}"
# if test -n "${PR_NUMBER}"; then
# GIT_REF="$( gh pr view --repo clockworklabs/SpacetimeDB $PR_NUMBER --json headRefName --jq .headRefName )"
# else
# GIT_REF="${{ github.ref }}"
# fi
# echo "GIT_REF=${GIT_REF}" >>"$GITHUB_ENV"
# 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
# commits though.
# - name: Find Git ref
# env:
# GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# shell: bash
# run: |
# PR_NUMBER="${{ github.event.inputs.pr_number || null }}"
# if test -n "${PR_NUMBER}"; then
# GIT_REF="$( gh pr view --repo clockworklabs/SpacetimeDB $PR_NUMBER --json headRefName --jq .headRefName )"
# else
# GIT_REF="${{ github.ref }}"
# fi
# echo "GIT_REF=${GIT_REF}" >>"$GITHUB_ENV"
- name: Checkout sources
uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -452,7 +408,34 @@
cargo test -- --test-threads=1
'

ci_command_docs:
name: Check CI command docs
runs-on: ubuntu-latest
steps:
- name: Find Git ref
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash
run: |
PR_NUMBER="${{ github.event.inputs.pr_number || null }}"
if test -n "${PR_NUMBER}"; then
GIT_REF="$( gh pr view --repo clockworklabs/SpacetimeDB $PR_NUMBER --json headRefName --jq .headRefName )"
else
GIT_REF="${{ github.ref }}"
fi
echo "GIT_REF=${GIT_REF}" >>"$GITHUB_ENV"

- name: Checkout sources
uses: actions/checkout@v4
with:
ref: ${{ env.GIT_REF }}

- uses: dsherret/rust-toolchain-file@v1

- name: Check for docs change
run: cargo ci self-docs --check

cli_docs:

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
name: Check CLI docs
permissions: read-all
runs-on: spacetimedb-new-runner
Expand Down Expand Up @@ -515,15 +498,7 @@

- name: Check for docs change
run: |
cargo run --features markdown-docs -p spacetimedb-cli > docs/docs/cli-reference.md
pnpm format
git status
if git diff --exit-code HEAD -- docs/docs/cli-reference.md; then
echo "No docs changes detected"
else
echo "It looks like the CLI docs have changed:"
exit 1
fi
cargo ci cli-docs

unity-testsuite:
# Skip if this is an external contribution.
Expand Down Expand Up @@ -609,7 +584,7 @@
enable_pr_comment: ${{ github.event_name == 'pull_request' }}
target_path: sdks/csharp
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'

- name: Start SpacetimeDB
run: |
Expand Down Expand Up @@ -643,12 +618,12 @@
- name: Run Unity tests
uses: game-ci/unity-test-runner@v4
with:
unityVersion: 2022.3.32f1 # Adjust Unity version to a valid tag
projectPath: demo/Blackholio/client-unity # Path to the Unity project subdirectory
unityVersion: 2022.3.32f1 # Adjust Unity version to a valid tag
projectPath: demo/Blackholio/client-unity # Path to the Unity project subdirectory
githubToken: ${{ secrets.GITHUB_TOKEN }}
testMode: playmode
useHostNetwork: true
artifactsPath: ""
artifactsPath: ''
env:
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
Expand Down
12 changes: 12 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading