Skip to content

Commit aa707d5

Browse files
authored
Merge branch 'master' into rust-web-sdk
Signed-off-by: Thales R. <70434673+thlsrms@users.noreply.github.com>
2 parents 5246ce0 + 39f9127 commit aa707d5

543 files changed

Lines changed: 61824 additions & 12681 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.cargo/config.toml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,13 @@ rustflags = ["--cfg", "tokio_unstable"]
33

44
[alias]
55
bump-versions = "run -p upgrade-version --"
6+
7+
[target.x86_64-pc-windows-msvc]
8+
# Use a different linker. Otherwise, the build fails with some obscure linker error that
9+
# seems to be a result of us producing a massive PDB file.
10+
# I (@bfops) tried a variety of other link options besides switching linkers, but this
11+
# seems to be the only thing that worked.
12+
linker = "lld-link"
13+
# Without this, the linker complains that libc functions are undefined -
14+
# it probably signals to rustc and lld-link that libucrt should be included.
15+
rustflags = ["-Ctarget-feature=+crt-static"]

.envrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Directory environment using https://direnv.net/ and https://github.com/nix-community/nix-direnv.
2+
use flake

.github/workflows/benchmarks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ jobs:
183183
runs-on: ubuntu-latest
184184
timeout-minutes: 20 # on a successful run, runs in 8 minutes
185185
container:
186-
image: rust:1.88.0
186+
image: rust:1.90.0
187187
options: --privileged
188188
# filter for a comment containing 'benchmarks please'
189189
if: ${{ github.event_name != 'issue_comment' || (github.event.issue.pull_request && contains(github.event.comment.body, 'benchmarks please')) }}

.github/workflows/ci.yml

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ on:
1313

1414
name: CI
1515

16+
concurrency:
17+
# When a PR number isn't available, the event won't be a `pull_request` event so it won't matter.
18+
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
19+
# Only cancel when the event is a pull_request
20+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
21+
1622
jobs:
1723
docker_smoketests:
1824
name: Smoketests
@@ -58,12 +64,6 @@ jobs:
5864
$ErrorActionPreference = 'Stop'
5965
$PSNativeCommandUseErrorActionPreference = $true
6066
61-
# Use a different linker. Otherwise, the build fails with some obscure linker error that
62-
# seems to be a result of us producing a massive PDB file.
63-
# I (@bfops) tried a variety of other link options besides switching linkers, but this
64-
# seems to be the only thing that worked.
65-
$env:RUSTFLAGS='-Clinker=lld-link'
66-
6767
cargo build -p spacetimedb-cli -p spacetimedb-standalone -p spacetimedb-update
6868
Start-Process target/debug/spacetimedb-cli.exe -ArgumentList 'start --pg-port 5432'
6969
cd modules
@@ -73,8 +73,8 @@ jobs:
7373
- uses: actions/setup-python@v5
7474
with: { python-version: '3.12' }
7575
if: runner.os == 'Windows'
76-
- name: Install psycopg2
77-
run: python -m pip install psycopg2-binary
76+
- name: Install python deps
77+
run: python -m pip install psycopg2-binary xmltodict
7878
- name: Run smoketests
7979
# Note: clear_database and replication only work in private
8080
run: python -m smoketests ${{ matrix.smoketest_args }} -x clear_database replication
@@ -109,11 +109,24 @@ jobs:
109109
with:
110110
global-json-file: global.json
111111

112+
- name: Set up Node.js
113+
uses: actions/setup-node@v4
114+
with:
115+
node-version: 18
116+
117+
- uses: pnpm/action-setup@v4
118+
with:
119+
run_install: true
120+
112121
- name: Create /stdb dir
113122
run: |
114123
sudo mkdir /stdb
115124
sudo chmod 777 /stdb
116125
126+
- name: Build typescript module sdk
127+
working-directory: crates/bindings-typescript
128+
run: pnpm build
129+
117130
- name: Run cargo test
118131
#Note: Unreal tests will be run separately
119132
run: cargo test --all -- --skip unreal

.github/workflows/csharp-test.yml

Lines changed: 27 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ on:
66
- master
77
pull_request:
88

9+
concurrency:
10+
# When a PR number isn't available, the event won't be a `pull_request` event so it won't matter.
11+
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
12+
# Only cancel when the event is a pull_request
13+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
14+
915
jobs:
1016
unity-testsuite:
1117
runs-on: spacetimedb-runner
@@ -83,15 +89,20 @@ jobs:
8389
CARGO_TARGET_DIR: demo/Blackholio/server-rust/target
8490

8591
- name: Check quickstart-chat bindings are up to date
86-
working-directory: sdks/csharp/examples~/quickstart-chat
92+
working-directory: sdks/csharp
93+
run: |
94+
bash tools~/gen-quickstart.sh
95+
"${GITHUB_WORKSPACE}"/tools/check-diff.sh examples~/quickstart-chat || {
96+
echo 'Error: quickstart-chat bindings have changed. Please run `sdks/csharp/tools~/gen-quickstart.sh`.'
97+
exit 1
98+
}
99+
100+
- name: Check client-api bindings are up to date
101+
working-directory: sdks/csharp
87102
run: |
88-
bash ../../tools~/gen-quickstart.sh "${GITHUB_WORKSPACE}"
89-
# This was copied from tools/check-diff.sh.
90-
# It's required because `spacetime generate` creates lines with the SpacetimeDB commit
91-
# version, which would make this `git diff` check very brittle if included.
92-
PATTERN='^// This was generated using spacetimedb cli version.*'
93-
git diff --exit-code --ignore-matching-lines="$PATTERN" -- . || {
94-
echo "Error: quickstart-chat bindings have changed. Please regenerate the bindings and commit them to this branch."
103+
bash tools~/gen-client-api.sh
104+
"${GITHUB_WORKSPACE}"/tools/check-diff.sh src/SpacetimeDB/ClientApi || {
105+
echo 'Error: Client API bindings are dirty. Please run `sdks/csharp/tools~/gen-client-api.sh`.'
95106
exit 1
96107
}
97108
@@ -101,12 +112,8 @@ jobs:
101112

102113
- name: Check for changes
103114
run: |
104-
# This was copied from tools/check-diff.sh.
105-
# It's required because `spacetime generate` creates lines with the SpacetimeDB commit
106-
# version, which would make this `git diff` check very brittle if included.
107-
PATTERN='^// This was generated using spacetimedb cli version.*'
108-
git diff --exit-code --ignore-matching-lines="$PATTERN" -- demo/Blackholio/client-unity/Assets/Scripts/autogen || {
109-
echo "Error: Bindings are dirty. Please generate bindings again and commit them to this branch."
115+
tools/check-diff.sh demo/Blackholio/client-unity/Assets/Scripts/autogen || {
116+
echo 'Error: Bindings are dirty. Please run `demo/Blackholio/server-rust/generate.sh`.'
110117
exit 1
111118
}
112119
@@ -124,7 +131,12 @@ jobs:
124131
disown
125132
126133
- name: Run regression tests
127-
run: bash sdks/csharp/tools~/run-regression-tests.sh .
134+
run: |
135+
bash sdks/csharp/tools~/run-regression-tests.sh
136+
tools/check-diff.sh sdks/csharp/examples~/regression-tests || {
137+
echo 'Error: Bindings are dirty. Please run `sdks/csharp/tools~/gen-regression-tests.sh`.'
138+
exit 1
139+
}
128140
129141
- name: Publish unity-tests module to SpacetimeDB
130142
working-directory: demo/Blackholio/server-rust

.github/workflows/discord-posts.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ jobs:
2323
2424
- name: Fetch Check Run Results
2525
run: |
26-
RESULT="$(gh pr checks "${{github.event.pull_request.html_url}}" --json 'name,state' |
27-
jq -r ".[] | select(.name==\"${CHECK_NAME}\").state")"
26+
RESULT="$(gh pr checks "${{github.event.pull_request.html_url}}" --json 'workflow,state' |
27+
jq -r ".[] | select(.workflow==\"${CHECK_NAME}\").state")"
2828
2929
if [ -z "$RESULT" ]; then
3030
RESULT="The check did not run!"
@@ -41,7 +41,7 @@ jobs:
4141
CHECK_RESULT: ${{ env.CHECK_RESULT }}
4242
MENTION_ON_FAILURE: ${{ secrets.DEV_OPS_ROLE_ID }}
4343
run: |
44-
message="PR merged: [(#${PR_NUMBER}) ${PR_TITLE}](${PR_URL})"
44+
message="PR merged: [(#${PR_NUMBER}) ${PR_TITLE}](<${PR_URL}>)"
4545
message+=$'\n'
4646
message+="${CHECK_NAME} result: ${CHECK_RESULT}"
4747
# Note that anything besides success is treated as a failure (e.g. if the check did not run at all, or if it is still pending).

.github/workflows/docs-check-links.yml

Lines changed: 0 additions & 30 deletions
This file was deleted.
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Docs / Publish
2+
3+
permissions:
4+
contents: read
5+
6+
on:
7+
push:
8+
branches:
9+
- docs/release
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v3
17+
18+
- name: Set up Node.js
19+
uses: actions/setup-node@v3
20+
with:
21+
node-version: '22'
22+
23+
- uses: pnpm/action-setup@v4
24+
with:
25+
run_install: true
26+
27+
- name: Get pnpm store directory
28+
working-directory: sdks/typescript
29+
shell: bash
30+
run: |
31+
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
32+
33+
- uses: actions/cache@v4
34+
name: Setup pnpm cache
35+
with:
36+
path: ${{ env.STORE_PATH }}
37+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
38+
restore-keys: |
39+
${{ runner.os }}-pnpm-store-
40+
41+
- name: Install dependencies
42+
working-directory: docs
43+
run: pnpm install
44+
45+
- name: Docusaurus build
46+
working-directory: docs
47+
run: pnpm build
48+
49+
- name: Publish docs to S3
50+
uses: shallwefootball/s3-upload-action@master
51+
with:
52+
aws_key_id: ${{ secrets.DOCS_AWS_KEY_ID }}
53+
aws_secret_access_key: ${{ secrets.DOCS_AWS_SECRET_ACCESS_KEY}}
54+
aws_bucket: spacetimedb-docs
55+
source_dir: docs/build
56+
destination_dir: 'docs'

.github/workflows/docs-test.yaml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Docs / Test
2+
permissions:
3+
contents: read
4+
5+
on:
6+
pull_request:
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout repository
13+
uses: actions/checkout@v3
14+
15+
- name: Set up Node.js
16+
uses: actions/setup-node@v3
17+
with:
18+
node-version: '22'
19+
20+
- uses: pnpm/action-setup@v4
21+
with:
22+
run_install: true
23+
24+
- name: Get pnpm store directory
25+
working-directory: sdks/typescript
26+
shell: bash
27+
run: |
28+
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
29+
30+
- uses: actions/cache@v4
31+
name: Setup pnpm cache
32+
with:
33+
path: ${{ env.STORE_PATH }}
34+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
35+
restore-keys: |
36+
${{ runner.os }}-pnpm-store-
37+
38+
- name: Install dependencies
39+
working-directory: docs
40+
run: pnpm install
41+
42+
- name: Docusaurus build
43+
working-directory: docs
44+
run: pnpm build

.github/workflows/docs-validate-nav-build.yml

Lines changed: 0 additions & 79 deletions
This file was deleted.

0 commit comments

Comments
 (0)