Skip to content

Commit e0ae18c

Browse files
authored
CI - Check C# quickstart-chat bindings are up to date (#2979)
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
1 parent 6c9aebd commit e0ae18c

2 files changed

Lines changed: 15 additions & 2 deletions

File tree

.github/workflows/csharp-test.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,19 @@ jobs:
7676
# Share the target directory with our local project to avoid rebuilding same SpacetimeDB crates twice.
7777
CARGO_TARGET_DIR: demo/Blackholio/server-rust/target
7878

79+
- name: Check quickstart-chat bindings are up to date
80+
working-directory: sdks/csharp/examples~/quickstart-chat
81+
run: |
82+
spacetime generate --lang csharp --out-dir client/module_bindings --project-path server
83+
# This was copied from tools/check-diff.sh.
84+
# It's required because `spacetime generate` creates lines with the SpacetimeDB commit
85+
# version, which would make this `git diff` check very brittle if included.
86+
PATTERN='^// This was generated using spacetimedb cli version.*'
87+
git diff --exit-code --ignore-matching-lines="$PATTERN" -- . || {
88+
echo "Error: quickstart-chat bindings have changed. Please regenerate the bindings and commit them to this branch."
89+
exit 1
90+
}
91+
7992
- name: Generate client bindings
8093
working-directory: demo/Blackholio/server-rust
8194
run: bash ./generate.sh -y

sdks/csharp/examples~/quickstart-chat/client/module_bindings/SpacetimeDBClient.g.cs

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)