Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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 @@ -4,6 +4,7 @@ rustflags = ["--cfg", "tokio_unstable"]
[alias]
llm = "run --package xtask-llm-benchmark --bin llm_benchmark --"
ci = "run -p ci --"
spacetime = "ci other-workflows run-spacetime"
regen = "run -p regen --"
smoketest = "ci smoketests --"
smoketests = "smoketest"
Expand Down
166 changes: 57 additions & 109 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,6 @@ jobs:
SMOKETEST_SUITE: standalone
steps: &smoketest-build-steps
- *find-git-ref

- *checkout-sources

- uses: dsherret/rust-toolchain-file@v1
Expand Down Expand Up @@ -400,7 +399,6 @@ jobs:
PARTITION_COUNT: 1
steps: &smoketest-partition-steps
- *find-git-ref

- *checkout-sources

- uses: dsherret/rust-toolchain-file@v1
Expand Down Expand Up @@ -472,13 +470,15 @@ jobs:
- name: Install cargo-nextest
uses: taiki-e/install-action@nextest

- name: Download build artifacts
- &download-build-artifacts
name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: build-artifacts-${{ env.ARTIFACT_SUFFIX }}
path: build-artifacts

- name: Extract build artifacts
- &extract-build-artifacts
name: Extract build artifacts
shell: bash
run: |
tar -xzf build-artifacts/build-support.tar.gz
Expand Down Expand Up @@ -570,14 +570,16 @@ jobs:
run: echo "Merge queue commit has the same tree as the PR head; smoketest already ran for the PR."

test:
needs: [merge_queue_noop, lints]
needs: [merge_queue_noop, lints, upload-build-artifacts-linux]
if: ${{ needs.merge_queue_noop.outputs.skip != 'true' }}
name: Test Suite
runs-on: spacetimedb-new-runner-2

env:
CARGO_TARGET_DIR: ${{ github.workspace }}/target
RUST_BACKTRACE: full
ARTIFACT_SUFFIX: linux
SPACETIME_BIN: ${{ github.workspace }}/target/release/spacetimedb-cli
steps:
- name: Find Git ref
env:
Expand Down Expand Up @@ -627,6 +629,9 @@ jobs:
- *restore-openssl
- *configure-cached-openssl

- *download-build-artifacts
- *extract-build-artifacts

- uses: actions/setup-dotnet@v3
with:
global-json-file: global.json
Expand Down Expand Up @@ -678,7 +683,7 @@ jobs:
- name: Run tests
run: |
source ~/emsdk/emsdk_env.sh
cargo ci test
cargo ci test --no-build

- name: Upload timing reports
if: always()
Expand Down Expand Up @@ -820,47 +825,29 @@ jobs:
path: ${{ env.CARGO_TARGET_DIR }}/cargo-timings/
retention-days: 14

wasm_bindings:
needs: [merge_queue_noop]
module_latest_deps:
needs: [merge_queue_noop, upload-build-artifacts-linux]
if: ${{ needs.merge_queue_noop.outputs.skip != 'true' }}
name: Build and test wasm bindings
runs-on: spacetimedb-new-runner-2
env:
CARGO_TARGET_DIR: ${{ github.workspace }}/target
RUST_BACKTRACE: full
ARTIFACT_SUFFIX: linux
SPACETIME_BIN: ${{ github.workspace }}/target/release/spacetimedb-cli
steps:
- uses: actions/checkout@v3
- *find-git-ref
- *checkout-sources

- uses: dsherret/rust-toolchain-file@v1
- name: Set default rust toolchain
run: rustup default $(rustup show active-toolchain | cut -d' ' -f1)
- *set-default-rust-toolchain
- run: echo ::add-matcher::.github/workflows/rust_matcher.json

- *set-native-cache-keys
- *restore-jemalloc
- *configure-cached-jemalloc
- *restore-zstd
- *configure-cached-zstd
- *restore-openssl
- *configure-cached-openssl

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 22

- uses: ./.github/actions/setup-pnpm
- *download-build-artifacts
- *extract-build-artifacts

- name: Run bindgen tests
run: cargo ci wasm-bindings

- name: Upload timing reports
if: always()
uses: actions/upload-artifact@v4
with:
name: cargo-timings-wasm-bindings
path: ${{ env.CARGO_TARGET_DIR }}/cargo-timings/
retention-days: 14
- name: Build module with latest compatible dependencies
run: cargo ci module-latest-deps --no-build

publish_checks:
needs: [merge_queue_noop]
Expand Down Expand Up @@ -1103,7 +1090,7 @@ jobs:
retention-days: 14

unity-testsuite:
needs: [merge_queue_noop, lints]
needs: [merge_queue_noop, lints, upload-build-artifacts-linux]
# Skip if this is an external contribution.
# The license secrets will be empty, so the step would fail anyway.
if: ${{ needs.merge_queue_noop.outputs.skip != 'true' && (github.event_name != 'pull_request' || !github.event.pull_request.head.repo.fork) }}
Expand All @@ -1115,11 +1102,11 @@ jobs:
env:
CARGO_TARGET_DIR: ${{ github.workspace }}/target
RUST_BACKTRACE: full
ARTIFACT_SUFFIX: linux
UNITY_VERSION: 2022.3.32f1
steps:
- name: Checkout repository
id: checkout-stdb
uses: actions/checkout@v4
- *find-git-ref
- *checkout-sources

# Keep this before generation/hydration so ignored build outputs do not affect hashFiles.
- name: Restore Unity Library
Expand Down Expand Up @@ -1177,14 +1164,15 @@ jobs:
- *restore-openssl
- *configure-cached-openssl

- name: Install SpacetimeDB CLI from the local checkout
- *download-build-artifacts
- *extract-build-artifacts

- &expose-spacetime-cli
name: Expose SpacetimeDB CLI on PATH
shell: bash
run: |
export CARGO_HOME="$HOME/.cargo"
echo "$CARGO_HOME/bin" >> "$GITHUB_PATH"
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 $CARGO_HOME/bin/spacetimedb-cli $CARGO_HOME/bin/spacetime
ln -sf spacetimedb-cli target/release/spacetime
echo "$GITHUB_WORKSPACE/target/release" >> "$GITHUB_PATH"

- name: Generate client bindings
working-directory: demo/Blackholio/server-rust
Expand Down Expand Up @@ -1247,18 +1235,18 @@ jobs:
key: ${{ steps.restore-unity-library.outputs.cache-primary-key }}

godot-testsuite:
needs: [merge_queue_noop, lints]
needs: [merge_queue_noop, lints, upload-build-artifacts-linux]
if: ${{ needs.merge_queue_noop.outputs.skip != 'true' }}
permissions:
contents: read
runs-on: spacetimedb-new-runner-2
env:
CARGO_TARGET_DIR: ${{ github.workspace }}/target
ARTIFACT_SUFFIX: linux
UseLocalBsatnRuntime: true
steps:
- name: Checkout repository
id: checkout-stdb
uses: actions/checkout@v4
- *find-git-ref
- *checkout-sources

- name: Setup dotnet
uses: actions/setup-dotnet@v3
Expand Down Expand Up @@ -1304,14 +1292,9 @@ jobs:
- *restore-openssl
- *configure-cached-openssl

- name: Install SpacetimeDB CLI from the local checkout
run: |
export CARGO_HOME="$HOME/.cargo"
echo "$CARGO_HOME/bin" >> "$GITHUB_PATH"
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 $CARGO_HOME/bin/spacetimedb-cli $CARGO_HOME/bin/spacetime
- *download-build-artifacts
- *extract-build-artifacts
- *expose-spacetime-cli

- name: Generate client bindings
working-directory: demo/Blackholio/server-rust
Expand Down Expand Up @@ -1361,17 +1344,18 @@ jobs:
run: godot --headless --scene res://tests/GodotPlayModeTests.tscn

csharp-testsuite:
needs: [merge_queue_noop, lints]
needs: [merge_queue_noop, lints, upload-build-artifacts-linux]
if: ${{ needs.merge_queue_noop.outputs.skip != 'true' }}
runs-on: spacetimedb-new-runner-2
timeout-minutes: 30
env:
CARGO_TARGET_DIR: ${{ github.workspace }}/target
RUST_BACKTRACE: full
ARTIFACT_SUFFIX: linux
SPACETIME_BIN: ${{ github.workspace }}/target/release/spacetimedb-cli
steps:
- name: Checkout repository
id: checkout-stdb
uses: actions/checkout@v4
- *find-git-ref
- *checkout-sources

- name: Setup dotnet
uses: actions/setup-dotnet@v3
Expand Down Expand Up @@ -1429,14 +1413,9 @@ jobs:
- *restore-openssl
- *configure-cached-openssl

- name: Install SpacetimeDB CLI from the local checkout
run: |
export CARGO_HOME="$HOME/.cargo"
echo "$CARGO_HOME/bin" >> "$GITHUB_PATH"
cargo install --force --path crates/cli --locked --message-format=short
cargo install --force --path crates/standalone --features allow_loopback_http_for_tests --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 $CARGO_HOME/bin/spacetimedb-cli $CARGO_HOME/bin/spacetime
- *download-build-artifacts
- *extract-build-artifacts
- *expose-spacetime-cli

- name: Check quickstart-chat bindings are up to date
run: |
Expand Down Expand Up @@ -1597,16 +1576,18 @@ jobs:
retention-days: 14

typescript-test:
needs: [merge_queue_noop]
needs: [merge_queue_noop, upload-build-artifacts-linux]
if: ${{ needs.merge_queue_noop.outputs.skip != 'true' }}
name: TypeScript - Tests
runs-on: spacetimedb-new-runner-2
env:
CARGO_TARGET_DIR: ${{ github.workspace }}/target
RUST_BACKTRACE: full
ARTIFACT_SUFFIX: linux
SPACETIME_BIN: ${{ github.workspace }}/target/release/spacetimedb-cli
steps:
- name: Checkout repository
uses: actions/checkout@v4
- *find-git-ref
- *checkout-sources

- name: Set up Node.js
uses: actions/setup-node@v4
Expand All @@ -1617,31 +1598,6 @@ jobs:
with:
run_install: true

# - name: Extract SpacetimeDB branch name from file
# id: extract-branch
# run: |
# # Define the path to the branch file
# BRANCH_FILE=".github/spacetimedb-branch.txt"

# # Default to master if file doesn't exist
# if [ ! -f "$BRANCH_FILE" ]; then
# echo "::notice::No SpacetimeDB branch file found, using 'master'"
# echo "branch=master" >> $GITHUB_OUTPUT
# exit 0
# fi

# # Read and trim whitespace from the file
# branch=$(cat "$BRANCH_FILE" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')

# # Fallback to master if empty
# if [ -z "$branch" ]; then
# echo "::warning::SpacetimeDB branch file is empty, using 'master'"
# branch="master"
# fi

# echo "branch=$branch" >> $GITHUB_OUTPUT
# echo "Using SpacetimeDB branch from file: $branch"

- name: Install Rust toolchain
uses: dsherret/rust-toolchain-file@v1
- name: Set default rust toolchain
Expand All @@ -1656,19 +1612,11 @@ jobs:
- *restore-openssl
- *configure-cached-openssl

# - name: Install SpacetimeDB CLI from the local checkout
# run: |
# export CARGO_HOME="$HOME/.cargo"
# echo "$CARGO_HOME/bin" >> "$GITHUB_PATH"
# 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 $CARGO_HOME/bin/spacetimedb-cli $CARGO_HOME/bin/spacetime
# # Clear any existing information
# spacetime server clear -y
- *download-build-artifacts
- *extract-build-artifacts

- name: Run TypeScript tests
run: cargo ci typescript-test
run: cargo ci typescript-test --no-build

- name: Upload timing reports
if: always()
Expand Down
28 changes: 18 additions & 10 deletions Cargo.lock

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

Loading
Loading