Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate C# client-side reducer enum to the new syntax #2033

Merged
merged 1 commit into from
Dec 4, 2024
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
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

RReverser marked this conversation as resolved.
Show resolved Hide resolved
- 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
Loading