-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (46 loc) · 1.91 KB
/
dotnet.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
name: .NET build
on:
push:
pull_request:
types: [opened, reopened]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
path: spacetimedb-csharp-sdk
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 7.0.x
- name: Checkout SpacetimeDB
uses: actions/checkout@v4
with:
repository: clockworklabs/SpacetimeDB
path: SpacetimeDB
- name: Setup SpacetimeDB packages
working-directory: spacetimedb-csharp-sdk
run: |
( cd ../SpacetimeDB/crates/bindings-csharp/BSATN.Runtime && dotnet pack )
# 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.
./tools~/write-nuget-config.sh ../SpacetimeDB
- name: Restore dependencies
working-directory: spacetimedb-csharp-sdk
run: dotnet restore
- name: Build everything
working-directory: spacetimedb-csharp-sdk
run: dotnet build --no-restore -warnaserror
- name: Run tests
working-directory: spacetimedb-csharp-sdk
run: dotnet test --no-build
- name: Verify formatting
working-directory: spacetimedb-csharp-sdk
run: dotnet format --no-restore --verify-no-changes SpacetimeDB.ClientSDK.sln