Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
d3dc60f
Use new runner for testsuite
jdetter Nov 13, 2025
8f0e79d
Run job in container
jdetter Nov 13, 2025
eefdd0b
Use custom container
jdetter Nov 13, 2025
71980d3
Use local container
jdetter Nov 13, 2025
3d22d05
updated workflow
jdetter Nov 13, 2025
62a4f7e
Fix run for fallocate test
jdetter Nov 13, 2025
ac437f8
Run smoketests on the custom runner
jdetter Nov 13, 2025
fa624f9
Rerun CI
jdetter Nov 13, 2025
7ba5a74
Potential fix
jdetter Nov 13, 2025
d50a347
One-liner
jdetter Nov 13, 2025
9e92535
Indenting fix
jdetter Nov 13, 2025
4cd95dc
Use docker in docker
jdetter Nov 13, 2025
29b0859
Fix copy/paste issue
jdetter Nov 13, 2025
b8769b7
Add debug step
jdetter Nov 13, 2025
5112401
Remove debug
jdetter Nov 13, 2025
6ef59eb
Few docker updates
jdetter Nov 14, 2025
325901f
Let's give the unreal engine testsuite a try
jdetter Nov 14, 2025
14a2f1f
Fix
jdetter Nov 14, 2025
4ec0cfe
Let's try the Unity tests as well
jdetter Nov 14, 2025
04b25fa
Try unity testsuite again
jdetter Nov 14, 2025
27bb5c0
Use start docker so that the testsuite can access docker
jdetter Nov 14, 2025
84e344e
Rebuild
jdetter Nov 14, 2025
5458647
Rebuild again
jdetter Nov 14, 2025
96090a0
Use cargo home instead
jdetter Nov 14, 2025
c3faf0c
Fix cgroups error
jdetter Nov 14, 2025
bb2462e
Remove debug
jdetter Nov 14, 2025
4d33efd
All tests are passing
jdetter Nov 14, 2025
c96eeef
Merge branch 'master' into jdetter/use-new-runner
jdetter Nov 14, 2025
8384f9a
Try sequential testing for UnrealEngine
jdetter Nov 14, 2025
2ddb8a1
Merge remote-tracking branch 'origin/jdetter/use-new-runner' into jde…
jdetter Nov 14, 2025
f9bd412
Merge branch 'master' into jdetter/use-new-runner
jdetter Nov 17, 2025
5eec82c
Serial test
jdetter Nov 17, 2025
d6ac573
Use --test-threads properly
jdetter Nov 17, 2025
5552c9a
Update comment
jdetter Nov 17, 2025
7213e91
Restored runner line
jdetter Nov 17, 2025
8c22386
Eliminated some options in running the unreal tests
jdetter Nov 17, 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
55 changes: 44 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,19 @@ jobs:
name: Smoketests
strategy:
matrix:
runner: [spacetimedb-new-runner, windows-latest]
include:
- { runner: spacetimedb-runner, smoketest_args: --docker }
- { runner: windows-latest, smoketest_args: --no-build-cli }
runner: [ spacetimedb-runner, windows-latest ]
Comment thread
jdetter marked this conversation as resolved.
- runner: spacetimedb-new-runner
Comment thread
jdetter marked this conversation as resolved.
smoketest_args: --docker
container:
image: localhost:5000/spacetimedb-ci:latest
options: --privileged
- runner: windows-latest
smoketest_args: --no-build-cli
container: null
runs-on: ${{ matrix.runner }}
container: ${{ matrix.container }}

steps:
- name: Find Git ref
env:
Expand Down Expand Up @@ -63,6 +71,10 @@ jobs:
if: runner.os == 'Windows'
run: choco install psql -y --no-progress
shell: powershell
- name: Start Docker daemon
if: runner.os == 'Linux'
run: /usr/local/bin/start-docker.sh
Comment thread
jdetter marked this conversation as resolved.

- name: Build and start database (Linux)
if: runner.os == 'Linux'
run: docker compose up -d
Expand Down Expand Up @@ -93,7 +105,11 @@ jobs:

test:
name: Test Suite
runs-on: spacetimedb-runner
runs-on: spacetimedb-new-runner
container:
image: localhost:5000/spacetimedb-ci:latest
options: >-
--privileged
steps:
- name: Find Git ref
env:
Expand Down Expand Up @@ -140,8 +156,9 @@ jobs:
#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
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
Expand All @@ -157,7 +174,11 @@ jobs:

lints:
name: Lints
runs-on: spacetimedb-runner
runs-on: spacetimedb-new-runner
container:
image: localhost:5000/spacetimedb-ci:latest
options: >-
--privileged
steps:
- name: Checkout sources
uses: actions/checkout@v3
Expand Down Expand Up @@ -196,7 +217,11 @@ jobs:

wasm_bindings:
name: Build and test wasm bindings
runs-on: spacetimedb-runner
runs-on: spacetimedb-new-runner
container:
image: localhost:5000/spacetimedb-ci:latest
options: >-
--privileged
steps:
- uses: actions/checkout@v3

Expand All @@ -221,7 +246,11 @@ jobs:

publish_checks:
name: Check that packages are publishable
runs-on: ubuntu-latest
runs-on: spacetimedb-new-runner
container:
image: localhost:5000/spacetimedb-ci:latest
options: >-
--privileged
permissions: read-all
steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -289,7 +318,7 @@ jobs:
name: Unreal Engine Tests
# This can't go on e.g. ubuntu-latest because that runner runs out of disk space. ChatGPT suggested that the general solution tends to be to use
# a custom runner.
runs-on: spacetimedb-runner
runs-on: spacetimedb-new-runner
# Skip if this is an external contribution. GitHub secrets will be empty, so the step would fail anyway.
if: ${{ github.event_name != 'pull_request' || !github.event.pull_request.head.repo.fork }}
container:
Expand Down Expand Up @@ -368,13 +397,17 @@ jobs:

cd "$GITHUB_WORKSPACE/sdks/unreal"
cargo --version
cargo test
cargo test -- --test-threads=1
'

cli_docs:
name: Check CLI docs
permissions: read-all
runs-on: ubuntu-latest
runs-on: spacetimedb-new-runner
container:
image: localhost:5000/spacetimedb-ci:latest
options: >-
--privileged
steps:
- name: Find Git ref
env:
Expand Down
12 changes: 10 additions & 2 deletions .github/workflows/csharp-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,163 +12,171 @@

jobs:
unity-testsuite:
runs-on: spacetimedb-runner
runs-on: spacetimedb-new-runner
container:
image: localhost:5000/spacetimedb-ci:latest
options: >-
--privileged
--cgroupns=host
Comment thread
jdetter marked this conversation as resolved.
# Cancel any previous testsuites running on the same PR and/or ref.
concurrency:
group: unity-test-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
timeout-minutes: 30
steps:
- name: Checkout repository
id: checkout-stdb
uses: actions/checkout@v4

# Run cheap .NET tests first. If those fail, no need to run expensive Unity tests.

- name: Setup dotnet
uses: actions/setup-dotnet@v3
with:
global-json-file: global.json

- name: Override NuGet packages
run: |
dotnet pack crates/bindings-csharp/BSATN.Runtime
dotnet pack crates/bindings-csharp/Runtime

# Write out the nuget config file to `nuget.config`. This causes the spacetimedb-csharp-sdk repository
# to be aware of the local versions of the `bindings-csharp` packages in SpacetimeDB, and use them if
# available. Otherwise, `spacetimedb-csharp-sdk` will use the NuGet versions of the packages.
# This means that (if version numbers match) we will test the local versions of the C# packages, even
# if they're not pushed to NuGet.
# See https://learn.microsoft.com/en-us/nuget/reference/nuget-config-file for more info on the config file.
cd sdks/csharp
./tools~/write-nuget-config.sh ../..

- name: Run .NET tests
working-directory: sdks/csharp
run: dotnet test -warnaserror

- name: Verify C# formatting
working-directory: sdks/csharp
run: dotnet format --no-restore --verify-no-changes SpacetimeDB.ClientSDK.sln

# Now, setup the Unity tests.

- name: Patch spacetimedb dependency in Cargo.toml
working-directory: demo/Blackholio/server-rust
run: |
sed -i "s|spacetimedb *=.*|spacetimedb = \{ path = \"../../../crates/bindings\" \}|" Cargo.toml
cat Cargo.toml

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable

- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
id: cache-rust-deps
with:
workspaces: demo/Blackholio/server-rust
key: ${{ steps.checkout-stdb.outputs.commit }}
# Cache Rust deps even if unit tests have failed.
cache-on-failure: true
# Cache the CLI as well.
cache-all-crates: true

- name: Install SpacetimeDB CLI from the local checkout
# Rebuild only if we didn't get a precise cache hit.
if: steps.cache-rust-deps.outputs.cache-hit == 'false'
run: |
cargo install --force --path crates/cli --locked --message-format=short
cargo install --force --path crates/standalone --locked --message-format=short
# Add a handy alias using the old binary name, so that we don't have to rewrite all scripts (incl. in submodules).
ln -sf $HOME/.cargo/bin/spacetimedb-cli $HOME/.cargo/bin/spacetime
ln -sf $CARGO_HOME/bin/spacetimedb-cli $CARGO_HOME/bin/spacetime
env:
# Share the target directory with our local project to avoid rebuilding same SpacetimeDB crates twice.
CARGO_TARGET_DIR: demo/Blackholio/server-rust/target

- name: Check quickstart-chat bindings are up to date
working-directory: sdks/csharp
run: |
bash tools~/gen-quickstart.sh
"${GITHUB_WORKSPACE}"/tools/check-diff.sh examples~/quickstart-chat || {
echo 'Error: quickstart-chat bindings have changed. Please run `sdks/csharp/tools~/gen-quickstart.sh`.'
exit 1
}

- name: Check client-api bindings are up to date
working-directory: sdks/csharp
run: |
bash tools~/gen-client-api.sh
"${GITHUB_WORKSPACE}"/tools/check-diff.sh src/SpacetimeDB/ClientApi || {
echo 'Error: Client API bindings are dirty. Please run `sdks/csharp/tools~/gen-client-api.sh`.'
exit 1
}

- name: Generate client bindings
working-directory: demo/Blackholio/server-rust
run: bash ./generate.sh -y

- name: Check for changes
run: |
tools/check-diff.sh demo/Blackholio/client-unity/Assets/Scripts/autogen || {
echo 'Error: Bindings are dirty. Please run `demo/Blackholio/server-rust/generate.sh`.'
exit 1
}

- name: Check Unity meta files
uses: DeNA/unity-meta-check@v3
with:
enable_pr_comment: ${{ github.event_name == 'pull_request' }}
target_path: sdks/csharp
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

- name: Start SpacetimeDB
run: |
spacetime start &
disown

- name: Run regression tests
run: |
bash sdks/csharp/tools~/run-regression-tests.sh
tools/check-diff.sh sdks/csharp/examples~/regression-tests || {
echo 'Error: Bindings are dirty. Please run `sdks/csharp/tools~/gen-regression-tests.sh`.'
exit 1
}

- name: Publish unity-tests module to SpacetimeDB
working-directory: demo/Blackholio/server-rust
run: |
spacetime logout && spacetime login --server-issued-login local
bash ./publish.sh

- name: Patch com.clockworklabs.spacetimedbsdk dependency in manifest.json
working-directory: demo/Blackholio/client-unity/Packages
run: |
# Replace the com.clockworklabs.spacetimedbsdk dependency with the current branch.
# Note: Pointing to a local directory does not work, because our earlier steps nuke our meta files, which then causes Unity to not properly respect the DLLs (e.g.
# codegen does not work properly).
yq e -i '.dependencies["com.clockworklabs.spacetimedbsdk"] = "https://github.com/clockworklabs/SpacetimeDB.git?path=sdks/csharp#${{ github.head_ref }}"' manifest.json
cat manifest.json

- uses: actions/cache@v3
with:
path: demo/Blackholio/client-unity/Library
key: Unity-${{ github.head_ref }}
restore-keys: Unity-

# We need this to support "Docker in Docker"
- name: Start Docker daemon
run: /usr/local/bin/start-docker.sh
Comment thread
jdetter marked this conversation as resolved.
- 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
githubToken: ${{ secrets.GITHUB_TOKEN }}
testMode: playmode
useHostNetwork: true
env:
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }}
# Skip if this is an external contribution.
# The license secrets will be empty, so the step would fail anyway.
if: ${{ github.event_name != 'pull_request' || !github.event.pull_request.head.repo.fork }}

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}
Loading