Skip to content
Merged
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
49 changes: 49 additions & 0 deletions .github/actions/keynote-bench-setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
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:
- 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
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
11 changes: 11 additions & 0 deletions .github/actions/setup-pnpm/action.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,24 @@
name: Set up pnpm
description: Install pnpm and configure repository package-age policy before any install
inputs:
package_json_file:
description: package.json file used to determine the pnpm version
required: false
default: package.json
run_install:
description: Run pnpm install after configuring pnpm
required: false
default: "false"
working_directory:
description: Directory to run pnpm install in
required: false
default: .
runs:
using: composite
steps:
- uses: pnpm/action-setup@v4
with:
package_json_file: ${{ inputs.package_json_file }}

- name: Configure pnpm package age policy
shell: bash
Expand All @@ -17,4 +27,5 @@ runs:
- name: Install dependencies
if: inputs.run_install == 'true'
shell: bash
working-directory: ${{ inputs.working_directory }}
run: pnpm install
35 changes: 7 additions & 28 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -377,30 +377,6 @@ jobs:
with:
ref: ${{ env.GIT_REF }}

- uses: dsherret/rust-toolchain-file@v1
- name: Set default rust toolchain
run: rustup default $(rustup show active-toolchain | cut -d' ' -f1)

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

- name: Check v8 outputs
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

- name: Build keynote benchmark binaries
run: cargo build --release -p spacetimedb-cli -p spacetimedb-standalone

# Node 24 is the current Active LTS line.
- name: Set up Node.js
uses: actions/setup-node@v4
Expand All @@ -409,11 +385,14 @@ jobs:

- uses: ./.github/actions/setup-pnpm
with:
run_install: true
package_json_file: package.json
working_directory: .
run_install: "true"

- name: Build TypeScript SDK
run: pnpm build
working-directory: crates/bindings-typescript
- uses: ./.github/actions/keynote-bench-setup
with:
public_root: .
rust_cache_workspaces: ${{ github.workspace }}

- name: Run keynote-2 benchmark regression check
run: cargo ci keynote-bench
Expand Down
11 changes: 11 additions & 0 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ members = [
"sdks/rust/tests/procedural-view-pk-client",
"sdks/rust/tests/event-table-client",
"tools/ci",
"tools/keynote-bench-harness",
"tools/license-check",
"tools/replace-spacetimedb",
"tools/generate-client-api",
Expand Down
1 change: 1 addition & 0 deletions tools/ci/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ serde_json.workspace = true
duct.workspace = true
tempfile.workspace = true
env_logger.workspace = true
keynote-bench-harness = { path = "../keynote-bench-harness" }
spacetimedb-guard.workspace = true
Loading
Loading