Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
d952e49
Shard smoketests using nextest
joshua-spacetime Jul 28, 2026
1daa84d
fix docs
joshua-spacetime Jul 28, 2026
5c426cb
update pnpm/action-setup to v6
joshua-spacetime Jul 28, 2026
7dbfaad
revert pnpm/action-setup to v4
joshua-spacetime Jul 28, 2026
53f7cea
pnpm caching
joshua-spacetime Jul 29, 2026
408beb4
dependency-only caching in smoketest partitions
joshua-spacetime Jul 29, 2026
0ad2bd6
fix pnpm policy lint to allow pnpm/action-setup@v4
joshua-spacetime Jul 29, 2026
c02cfd0
stop rebuilding ts deps
joshua-spacetime Jul 29, 2026
64ec710
remove rust-cache from partition jobs
joshua-spacetime Jul 29, 2026
4a14fee
cargo -- timings
joshua-spacetime Jul 29, 2026
82fad41
remove rust-cache from build jobs
joshua-spacetime Jul 29, 2026
280a860
fix pnpm build
joshua-spacetime Jul 30, 2026
3b4d682
have all tests restore from the smoketest build
joshua-spacetime Jul 30, 2026
04920ef
use SPACETIMEDB_WORKSPACE_ROOT instead of CARGO_MANIFEST_DIR
joshua-spacetime Jul 30, 2026
59baa45
cache dependencies for v8 and openssl
joshua-spacetime Jul 30, 2026
74f6dca
Make windows smoketest build job the only rust-cache writer
joshua-spacetime Jul 30, 2026
d2346d8
split out test_all_templates
joshua-spacetime Jul 30, 2026
c03d7f7
remove global pnpm installs
joshua-spacetime Jul 30, 2026
c3279ac
simplify
joshua-spacetime Jul 30, 2026
e4a1645
remove stale comments
joshua-spacetime Jul 30, 2026
f8d6812
fix caching for unity builds
joshua-spacetime Jul 30, 2026
76d0c24
update native rusty_v8 cache key
joshua-spacetime Jul 30, 2026
1ba2b3b
fix setup-pnpm
joshua-spacetime Jul 30, 2026
23f0183
remove sccache
joshua-spacetime Jul 30, 2026
dfceff8
only 2 partitions for linux
joshua-spacetime Jul 30, 2026
e389edb
remove rust-cache-targets
joshua-spacetime Jul 30, 2026
51ef1d3
private compatibility
joshua-spacetime Jul 30, 2026
471db45
use one runner for release dry-run
joshua-spacetime Jul 30, 2026
a8a952b
full pnpm install for test suite
joshua-spacetime Jul 30, 2026
7607b15
fix internal tests
joshua-spacetime Jul 31, 2026
4d86687
don't wait for lints
joshua-spacetime Jul 31, 2026
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
47 changes: 0 additions & 47 deletions .github/actions/keynote-bench-setup/action.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@
name: Keynote Bench Setup
description: Shared setup for the keynote benchmark job

inputs:
public_root:
description: Path to the public SpacetimeDB checkout in the caller workspace
required: false
default: .
rust_cache_workspaces:
description: Workspace paths passed to Swatinem/rust-cache
required: true

runs:
using: composite
steps:
Expand All @@ -18,41 +9,3 @@ runs:
- name: Set default rust toolchain
shell: bash
run: rustup default $(rustup show active-toolchain | cut -d' ' -f1)

- name: Set up sccache
uses: mozilla-actions/sccache-action@v0.0.10

- name: Enable sccache
shell: bash
run: |
echo "SCCACHE_GHA_ENABLED=true" >>"$GITHUB_ENV"
echo "RUSTC_WRAPPER=sccache" >>"$GITHUB_ENV"

- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
with:
workspaces: ${{ inputs.rust_cache_workspaces }}
shared-key: spacetimedb
save-if: false
prefix-key: v1

- name: Check v8 outputs
shell: bash
run: |
find "${CARGO_TARGET_DIR}"/ -type f | grep '[/_]v8' || true
if ! [ -f "${CARGO_TARGET_DIR}"/release/gn_out/obj/librusty_v8.a ]; then
echo "Could not find v8 output file librusty_v8.a; rebuilding manually."
cargo clean --release -p v8 || true
cargo build --release -p v8
fi
working-directory: ${{ inputs.public_root }}

- name: Build public keynote benchmark binaries
shell: bash
run: cargo build --release -p spacetimedb-cli -p spacetimedb-standalone
working-directory: ${{ inputs.public_root }}

- name: Build TypeScript SDK
shell: bash
run: pnpm build
working-directory: ${{ inputs.public_root }}/crates/bindings-typescript
46 changes: 46 additions & 0 deletions .github/actions/restore-smoketest-build/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Restore smoketest build
description: Restore prebuilt Linux smoketest support binaries from a build artifact.

inputs:
artifact-name:
description: Name of the smoketest build artifact to download.
required: true
require-standalone:
description: Require the artifact to contain the standalone server.
required: false
default: "true"
schema-extractor-path:
description: Optional schema extractor executable used instead of standalone.
required: false
default: ""

runs:
using: composite
steps:
- name: Download smoketest build
uses: actions/download-artifact@v4
with:
name: ${{ inputs.artifact-name }}
path: ${{ runner.temp }}/smoketest-build

- name: Extract smoketest support files
shell: bash
run: tar -xzf "${RUNNER_TEMP}/smoketest-build/smoketest-support.tar.gz"

- name: Configure prebuilt SpacetimeDB binaries
shell: bash
env:
REQUIRE_STANDALONE: ${{ inputs.require-standalone }}
SCHEMA_EXTRACTOR_PATH: ${{ inputs.schema-extractor-path }}
run: |
test -x "${CARGO_TARGET_DIR}/release/spacetimedb-cli"
if [[ "${REQUIRE_STANDALONE}" == "true" ]]; then
test -x "${CARGO_TARGET_DIR}/release/spacetimedb-standalone"
fi
if [[ -n "${SCHEMA_EXTRACTOR_PATH}" ]]; then
test -x "${SCHEMA_EXTRACTOR_PATH}"
echo "SPACETIMEDB_SCHEMA_EXTRACTOR=${SCHEMA_EXTRACTOR_PATH}" >>"$GITHUB_ENV"
fi
ln -sf spacetimedb-cli "${CARGO_TARGET_DIR}/release/spacetime"
echo "${CARGO_TARGET_DIR}/release" >>"$GITHUB_PATH"
echo "SPACETIME_PREBUILT_BINARIES=1" >>"$GITHUB_ENV"
33 changes: 32 additions & 1 deletion .github/actions/setup-pnpm/action.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,30 @@
name: Set up pnpm
description: Install pnpm and configure repository package-age policy before any install
inputs:
version:
description: pnpm version to install. If omitted, package_json_file determines the version.
required: false
default: ""
package_json_file:
description: package.json file used to determine the pnpm version
required: false
default: package.json
node_version:
description: Node.js version to install with pnpm dependency caching; omitted when Node.js is already configured
required: false
default: ""
cache_dependency_path:
description: Lockfile used by setup-node's pnpm store cache
required: false
default: pnpm-lock.yaml
run_install:
description: Run pnpm install after configuring pnpm
required: false
default: "false"
install_args:
description: Additional arguments passed to pnpm install
required: false
default: ""
working_directory:
description: Directory to run pnpm install in
required: false
Expand All @@ -17,9 +33,24 @@ runs:
using: composite
steps:
- uses: pnpm/action-setup@v4
if: inputs.version != ''
with:
version: ${{ inputs.version }}

- uses: pnpm/action-setup@v4
if: inputs.version == ''
with:
package_json_file: ${{ inputs.package_json_file }}

# setup-node's pnpm cache requires the pnpm executable to exist first.
- name: Set up Node.js
if: inputs.node_version != ''
uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node_version }}
cache: pnpm
cache-dependency-path: ${{ inputs.cache_dependency_path }}

- name: Configure pnpm package age policy
shell: bash
run: pnpm config set --global minimumReleaseAge 1440
Expand All @@ -28,4 +59,4 @@ runs:
if: inputs.run_install == 'true'
shell: bash
working-directory: ${{ inputs.working_directory }}
run: pnpm install
run: pnpm install ${{ inputs.install_args }}
54 changes: 54 additions & 0 deletions .github/actions/smoketest-build/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Build smoketest artifacts
description: Build and upload the nextest archive and smoketest runtime artifacts.

inputs:
artifact-name:
description: Name of the workflow artifact to upload.
required: true

runs:
using: composite
steps:
- name: Build smoketest dependencies and archive test binaries
shell: bash
run: |
cargo ci smoketests archive --archive-file smoketest-nextest.tar.zst

if [[ "${RUNNER_OS}" == "Windows" ]]; then
executable_suffix=".exe"
else
executable_suffix=""
fi

shopt -s nullglob
precompiled_modules=(target/wasm32-unknown-unknown/release/smoketest_module_*.wasm)
if (( ${#precompiled_modules[@]} == 0 )); then
echo "No precompiled smoketest modules were produced."
exit 1
fi

tar -czf smoketest-support.tar.gz \
crates/bindings-typescript/dist \
"target/debug/ci${executable_suffix}" \
"target/release/spacetimedb-cli${executable_suffix}" \
"target/release/spacetimedb-standalone${executable_suffix}" \
"${precompiled_modules[@]}"

- name: Upload Cargo timings
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.artifact-name }}-cargo-timings
path: ${{ env.CARGO_TARGET_DIR }}/cargo-timings
if-no-files-found: warn
overwrite: true

- name: Upload smoketest build
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.artifact-name }}
path: |
smoketest-nextest.tar.zst
smoketest-support.tar.gz
if-no-files-found: error
overwrite: true
53 changes: 53 additions & 0 deletions .github/actions/smoketest-run-partition/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Run smoketest partition
description: Download a smoketest build and run one nextest hash partition.

inputs:
artifact-name:
description: Name of the workflow artifact to download.
required: true
partition:
description: One-based hash partition number.
required: true
partition-total:
description: Total number of hash partitions.
required: true

runs:
using: composite
steps:
- name: Download smoketest build
uses: actions/download-artifact@v4
with:
name: ${{ inputs.artifact-name }}

- name: Extract smoketest support files
shell: bash
run: |
tar -xzf smoketest-support.tar.gz
echo "SPACETIME_PREBUILT_TYPESCRIPT_SDK=1" >>"$GITHUB_ENV"

- name: Run smoketest partition (Linux)
if: runner.os == 'Linux'
shell: bash
env:
SPACETIMEDB_WORKSPACE_ROOT: ${{ github.workspace }}
run: |
source ~/emsdk/emsdk_env.sh
./target/debug/ci smoketests run-archive \
--archive-file smoketest-nextest.tar.zst \
-- \
--test-threads=1 \
--partition hash:${{ inputs.partition }}/${{ inputs.partition-total }}

- name: Run smoketest partition (Windows)
if: runner.os == 'Windows'
shell: pwsh
env:
SPACETIMEDB_WORKSPACE_ROOT: ${{ github.workspace }}
run: |
& "$env:USERPROFILE\emsdk\emsdk_env.ps1" | Out-Null
& .\target\debug\ci.exe smoketests run-archive `
--archive-file smoketest-nextest.tar.zst `
-- `
--test-threads=1 `
--partition "hash:${{ inputs.partition }}/${{ inputs.partition-total }}"
102 changes: 102 additions & 0 deletions .github/actions/smoketest-setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
name: Set up smoketests
description: Set up Rust and the language toolchains used by the smoketests.

inputs:
runtime-dependencies:
description: Install dependencies needed while executing smoketests.
required: false
default: "true"
rust-cache-enabled:
description: Restore and save the Rust cache.
required: false
default: "true"
rust-cache-shared-key:
description: Shared key used for the Rust cache.
required: false
default: spacetimedb

runs:
using: composite
steps:
- uses: dsherret/rust-toolchain-file@v1

- name: Set default Rust toolchain
shell: bash
run: rustup default "$(rustup show active-toolchain | cut -d' ' -f1)"

- name: Cache Rust dependencies
if: inputs.rust-cache-enabled == 'true'
uses: Swatinem/rust-cache@v2
with:
workspaces: ${{ github.workspace }}
shared-key: ${{ inputs.rust-cache-shared-key }}
cache-targets: true
cache-bin: false
cache-on-failure: false
cache-all-crates: false
cache-workspace-crates: false
prefix-key: v1

- name: Set up .NET
if: inputs.runtime-dependencies == 'true'
uses: actions/setup-dotnet@v4
with:
global-json-file: global.json

# Install Emscripten for C++ module compilation tests.
- name: Install Emscripten (Linux)
if: inputs.runtime-dependencies == 'true' && runner.os == 'Linux'
shell: bash
run: |
git clone https://github.com/emscripten-core/emsdk.git ~/emsdk
cd ~/emsdk
./emsdk install 4.0.21
./emsdk activate 4.0.21

- name: Install Emscripten (Windows)
if: inputs.runtime-dependencies == 'true' && runner.os == 'Windows'
shell: pwsh
run: |
git clone https://github.com/emscripten-core/emsdk.git $env:USERPROFILE\emsdk
cd $env:USERPROFILE\emsdk
.\emsdk install 4.0.21
.\emsdk activate 4.0.21

- name: Install psql (Windows)
if: inputs.runtime-dependencies == 'true' && runner.os == 'Windows'
shell: pwsh
run: |
$ErrorActionPreference = 'Stop'
$PSNativeCommandUseErrorActionPreference = $true
choco install psql -y --no-progress
# Chocolatey does not reliably fail the step when installation fails.
Get-Command psql

- name: Update .NET workloads (Windows)
if: inputs.runtime-dependencies == 'true' && runner.os == 'Windows'
shell: pwsh
run: |
$ErrorActionPreference = 'Stop'
$PSNativeCommandUseErrorActionPreference = $true

cd modules
# The sdk-manifests on windows-latest need to be updated before installing workloads.
dotnet workload config --update-mode manifests
dotnet workload update --from-previous-sdk
# Explicitly install wasi-experimental for .NET 8 SDK.
$sdk8Json = '{"sdk":{"version":"8.0.400","rollForward":"latestFeature"}}'
$sdk8Json | Out-File -FilePath global.json -Encoding utf8
dotnet workload install wasi-experimental
Remove-Item global.json

- name: Override NuGet packages
if: inputs.runtime-dependencies == 'true'
shell: bash
run: |
dotnet pack -c Release crates/bindings-csharp/BSATN.Runtime
dotnet pack -c Release crates/bindings-csharp/Runtime
cd sdks/csharp
./tools~/write-nuget-config.sh ../..

- name: Install cargo-nextest
uses: taiki-e/install-action@nextest
Loading
Loading