3636 timeout-minutes : 120
3737 env :
3838 CARGO_TARGET_DIR : ${{ github.workspace }}/target
39+ RUST_BACKTRACE : full
3940 SPACETIMEDB_CPP_DIR : ${{ github.workspace }}/crates/bindings-cpp
4041 steps :
4142 - name : Find Git ref
@@ -182,6 +183,7 @@ jobs:
182183
183184 env :
184185 CARGO_TARGET_DIR : ${{ github.workspace }}/target
186+ RUST_BACKTRACE : full
185187 steps :
186188 - name : Find Git ref
187189 env :
@@ -272,6 +274,7 @@ jobs:
272274 timeout-minutes : 60
273275 env :
274276 CARGO_TARGET_DIR : ${{ github.workspace }}/target
277+ RUST_BACKTRACE : full
275278 steps :
276279 - name : Find Git ref
277280 env :
@@ -327,6 +330,7 @@ jobs:
327330 runs-on : spacetimedb-new-runner-2
328331 env :
329332 CARGO_TARGET_DIR : ${{ github.workspace }}/target
333+ RUST_BACKTRACE : full
330334 steps :
331335 - name : Checkout sources
332336 uses : actions/checkout@v3
@@ -366,6 +370,7 @@ jobs:
366370 runs-on : spacetimedb-new-runner-2
367371 env :
368372 CARGO_TARGET_DIR : ${{ github.workspace }}/target
373+ RUST_BACKTRACE : full
369374 steps :
370375 - uses : actions/checkout@v3
371376
@@ -390,6 +395,8 @@ jobs:
390395 name : Check that packages are publishable
391396 runs-on : spacetimedb-new-runner-2
392397 permissions : read-all
398+ env :
399+ RUST_BACKTRACE : full
393400 steps :
394401 - uses : actions/checkout@v3
395402 - uses : dsherret/rust-toolchain-file@v1
@@ -409,6 +416,8 @@ jobs:
409416 - { target: aarch64-apple-darwin, runner: macos-latest }
410417 - { target: x86_64-pc-windows-msvc, runner: windows-latest }
411418 runs-on : ${{ matrix.runner }}
419+ env :
420+ RUST_BACKTRACE : full
412421 steps :
413422 - name : Checkout
414423 uses : actions/checkout@v3
@@ -453,6 +462,8 @@ jobs:
453462 # Run as root because otherwise we get permission denied for various directories inside the container. I tried doing dances to allow it to run
454463 # without this (reassigning env vars and stuff), but was unable to get it to work and it felt like an uphill battle.
455464 options : --user 0:0
465+ env :
466+ RUST_BACKTRACE : full
456467 steps :
457468 # Uncomment this before merging so that it will run properly if run manually through the GH actions flow. It was playing weird with rolled back
458469 # commits though.
@@ -525,6 +536,8 @@ jobs:
525536 ci_command_docs :
526537 name : Check CI command docs
527538 runs-on : spacetimedb-new-runner-2
539+ env :
540+ RUST_BACKTRACE : full
528541 steps :
529542 - name : Find Git ref
530543 env :
@@ -557,6 +570,7 @@ jobs:
557570 runs-on : spacetimedb-new-runner-2
558571 env :
559572 CARGO_TARGET_DIR : ${{ github.workspace }}/target
573+ RUST_BACKTRACE : full
560574 steps :
561575 - name : Find Git ref
562576 env :
@@ -627,6 +641,7 @@ jobs:
627641 timeout-minutes : 30
628642 env :
629643 CARGO_TARGET_DIR : ${{ github.workspace }}/target
644+ RUST_BACKTRACE : full
630645 steps :
631646 - name : Checkout repository
632647 id : checkout-stdb
@@ -760,19 +775,143 @@ jobs:
760775 UNITY_PASSWORD : ${{ secrets.UNITY_PASSWORD }}
761776 UNITY_SERIAL : ${{ secrets.UNITY_SERIAL }}
762777
778+ godot-testsuite :
779+ needs : [lints]
780+ permissions :
781+ contents : read
782+ runs-on : spacetimedb-new-runner-2
783+ env :
784+ CARGO_TARGET_DIR : ${{ github.workspace }}/target
785+ UseLocalBsatnRuntime : true
786+ steps :
787+ - name : Checkout repository
788+ id : checkout-stdb
789+ uses : actions/checkout@v4
790+
791+ - name : Setup dotnet
792+ uses : actions/setup-dotnet@v3
793+ with :
794+ global-json-file : global.json
795+
796+ - name : Override NuGet packages
797+ run : |
798+ dotnet pack -c Release crates/bindings-csharp/BSATN.Runtime
799+ dotnet pack -c Release crates/bindings-csharp/Runtime
800+
801+ # Write out the nuget config file to `nuget.config`. This causes the spacetimedb-csharp-sdk repository
802+ # to be aware of the local versions of the `bindings-csharp` packages in SpacetimeDB, and use them if
803+ # available. Otherwise, `spacetimedb-csharp-sdk` will use the NuGet versions of the packages.
804+ # This means that (if version numbers match) we will test the local versions of the C# packages, even
805+ # if they're not pushed to NuGet.
806+ # See https://learn.microsoft.com/en-us/nuget/reference/nuget-config-file for more info on the config file.
807+ cd sdks/csharp
808+ ./tools~/write-nuget-config.sh ../..
809+
810+ - name : Restore .NET solution
811+ working-directory : sdks/csharp
812+ run : dotnet restore --configfile NuGet.Config SpacetimeDB.ClientSDK.sln
813+
814+ # Now, setup the Godot tests.
815+ - name : Patch spacetimedb dependency in Cargo.toml
816+ working-directory : demo/Blackholio/server-rust
817+ run : |
818+ sed -i "s|spacetimedb *=.*|spacetimedb = \{ path = \"../../../crates/bindings\" \}|" Cargo.toml
819+ cat Cargo.toml
820+
821+ - name : Install Rust toolchain
822+ uses : dsherret/rust-toolchain-file@v1
823+ - name : Set default rust toolchain
824+ run : rustup default $(rustup show active-toolchain | cut -d' ' -f1)
825+
826+ - name : Cache Rust dependencies
827+ uses : Swatinem/rust-cache@v2
828+ with :
829+ workspaces : ${{ github.workspace }}
830+ shared-key : spacetimedb
831+ # Let the main CI job save the cache since it builds the most things
832+ save-if : false
833+ prefix-key : v1
834+
835+ # This step shouldn't be needed, but somehow we end up with caches that are missing librusty_v8.a.
836+ # ChatGPT suspects that this could be due to different build invocations using the same target dir,
837+ # and this makes sense to me because we only see it in this job where we mix `cargo build -p` with
838+ # `cargo build --manifest-path` (which apparently build different dependency trees).
839+ # However, we've been unable to fix it so... /shrug
840+ - name : Check v8 outputs
841+ run : |
842+ find "${CARGO_TARGET_DIR}"/ -type f | grep '[/_]v8' || true
843+ if ! [ -f "${CARGO_TARGET_DIR}"/release/gn_out/obj/librusty_v8.a ]; then
844+ echo "Could not find v8 output file librusty_v8.a; rebuilding manually."
845+ cargo clean --release -p v8 || true
846+ cargo build --release -p v8
847+ fi
848+
849+ - name : Install SpacetimeDB CLI from the local checkout
850+ run : |
851+ export CARGO_HOME="$HOME/.cargo"
852+ echo "$CARGO_HOME/bin" >> "$GITHUB_PATH"
853+ cargo install --force --path crates/cli --locked --message-format=short
854+ cargo install --force --path crates/standalone --locked --message-format=short
855+ # Add a handy alias using the old binary name, so that we don't have to rewrite all scripts (incl. in submodules).
856+ ln -sf $CARGO_HOME/bin/spacetimedb-cli $CARGO_HOME/bin/spacetime
857+
858+ - name : Generate client bindings
859+ working-directory : demo/Blackholio/server-rust
860+ run : bash ./generate.sh -y
861+
862+ - name : Check for changes
863+ run : |
864+ tools/check-diff.sh demo/Blackholio/client-godot/module_bindings || {
865+ echo 'Error: Godot bindings are dirty. Please run `demo/Blackholio/server-rust/generate.sh`.'
866+ exit 1
867+ }
868+
869+ - name : Patch SpacetimeDB Godot SDK dependency
870+ working-directory : demo/Blackholio/client-godot
871+ run : |
872+ dotnet remove package SpacetimeDB.ClientSDK.Godot
873+ dotnet add reference ../../../sdks/csharp/SpacetimeDB.ClientSDK.Godot.csproj
874+ cat blackholio.csproj
875+
876+ - name : Setup Godot
877+ uses : chickensoft-games/setup-godot@v2
878+ with :
879+ version : 4.6.2
880+ use-dotnet : true
881+
882+ - name : Restore Godot project
883+ working-directory : demo/Blackholio/client-godot
884+ run : dotnet restore --configfile ../../../NuGet.Config blackholio.csproj
885+
886+ - name : Build Godot project
887+ run : godot --headless --verbose --path demo/Blackholio/client-godot --build-solutions --quit
888+
889+ - name : Start SpacetimeDB
890+ run : |
891+ spacetime start &
892+ disown
893+
894+ - name : Publish godot-tests module to SpacetimeDB
895+ working-directory : demo/Blackholio/server-rust
896+ run : |
897+ spacetime login --server-issued-login local
898+ bash ./publish.sh
899+
900+ - name : Run Godot tests
901+ run : godot --headless --path demo/Blackholio/client-godot --scene res://tests/GodotPlayModeTests.tscn
902+
763903 csharp-testsuite :
764904 needs : [lints]
765905 runs-on : spacetimedb-new-runner-2
766906 timeout-minutes : 30
767907 env :
768908 CARGO_TARGET_DIR : ${{ github.workspace }}/target
909+ RUST_BACKTRACE : full
769910 steps :
770911 - name : Checkout repository
771912 id : checkout-stdb
772913 uses : actions/checkout@v4
773914
774- # Run cheap .NET tests first. If those fail, no need to run expensive Unity tests.
775-
776915 - name : Setup dotnet
777916 uses : actions/setup-dotnet@v3
778917 with :
@@ -883,6 +1022,8 @@ jobs:
8831022 runs-on : ubuntu-latest
8841023 permissions :
8851024 contents : read
1025+ env :
1026+ RUST_BACKTRACE : full
8861027 steps :
8871028 - name : Find Git ref
8881029 env :
@@ -922,6 +1063,7 @@ jobs:
9221063 contents : read
9231064 env :
9241065 CARGO_TARGET_DIR : ${{ github.workspace }}/target
1066+ RUST_BACKTRACE : full
9251067 steps :
9261068 - name : Find Git ref
9271069 env :
@@ -974,6 +1116,8 @@ jobs:
9741116 docs-build :
9751117 name : Docs build
9761118 runs-on : spacetimedb-new-runner-2
1119+ env :
1120+ RUST_BACKTRACE : full
9771121 steps :
9781122 - name : Checkout repository
9791123 uses : actions/checkout@v3
@@ -1011,6 +1155,8 @@ jobs:
10111155 typescript-test :
10121156 name : TypeScript - Tests
10131157 runs-on : spacetimedb-new-runner-2
1158+ env :
1159+ RUST_BACKTRACE : full
10141160 steps :
10151161 - name : Checkout repository
10161162 uses : actions/checkout@v4
@@ -1121,6 +1267,8 @@ jobs:
11211267
11221268 version_upgrade_check :
11231269 runs-on : spacetimedb-new-runner-2
1270+ env :
1271+ RUST_BACKTRACE : full
11241272 steps :
11251273 - name : Checkout
11261274 uses : actions/checkout@v3
0 commit comments