Skip to content

Commit

Permalink
Migrate C# client-side reducer enum to the new syntax (#2033)
Browse files Browse the repository at this point in the history
  • Loading branch information
RReverser authored Dec 4, 2024
1 parent a5feed0 commit 3902f75
Show file tree
Hide file tree
Showing 8 changed files with 314 additions and 368 deletions.
41 changes: 9 additions & 32 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,49 +120,26 @@ jobs:
run: |
sudo mkdir /stdb
sudo chmod 777 /stdb
- name: Checkout C# SDK
uses: actions/checkout@v4
with:
repository: clockworklabs/spacetimedb-csharp-sdk
ref: staging
path: spacetimedb-csharp-sdk

- name: C# SDK tests
- name: Setup NuGet override for C# SDK
working-directory: spacetimedb-csharp-sdk
run: |
( cd crates/bindings-csharp/BSATN.Runtime && dotnet pack )
cd spacetimedb-csharp-sdk
# Write out the nuget config file to `nuget.config`. This causes the spacetimedb-csharp-sdk repository
# to be aware of the local versions of the `bindings-csharp` packages in SpacetimeDB, and use them if
# available. Otherwise, `spacetimedb-csharp-sdk` will use the NuGet versions of the packages.
# This means that (if version numbers match) we will test the local versions of the C# packages, even
# if they're not pushed to NuGet.
# See https://learn.microsoft.com/en-us/nuget/reference/nuget-config-file for more info on the config file,
# and https://tldp.org/LDP/abs/html/here-docs.html for more info on this bash feature.
cat >nuget.config <<EOF
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<!-- Local NuGet repositories -->
<add key="Local SpacetimeDB.BSATN.Runtime" value="../crates/bindings-csharp/BSATN.Runtime/bin/Release" />
</packageSources>
<packageSourceMapping>
<!-- Ensure that SpacetimeDB.BSATN.Runtime is used from the local folder. -->
<!-- Otherwise we risk an outdated version being quietly pulled from NuGet for testing. -->
<packageSource key="Local SpacetimeDB.BSATN.Runtime">
<package pattern="SpacetimeDB.BSATN.Runtime" />
</packageSource>
<!-- Fallback to NuGet for other packages. -->
<packageSource key="nuget.org">
<package pattern="*" />
</packageSource>
</packageSourceMapping>
</configuration>
EOF
dotnet pack ../crates/bindings-csharp/BSATN.Runtime
./tools~/write-nuget-config.sh ..
# clear package caches, so we get fresh ones even if version numbers haven't changed
dotnet nuget locals all --clear
dotnet test
- name: Run C# SDK tests
working-directory: spacetimedb-csharp-sdk
run: dotnet test

lints:
name: Lints
Expand Down

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

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

4 changes: 1 addition & 3 deletions crates/bindings-csharp/Runtime/Internal/Autogen/Typespace.cs

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

Loading

2 comments on commit 3902f75

@github-actions
Copy link

@github-actions github-actions bot commented on 3902f75 Dec 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmarking failed. Please check the workflow run for details.

@github-actions
Copy link

@github-actions github-actions bot commented on 3902f75 Dec 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Callgrind benchmark results Error when comparing benchmarks:

Caused by:

Please sign in to comment.