-
Notifications
You must be signed in to change notification settings - Fork 11
71 lines (53 loc) · 2.95 KB
/
build-and-test.yaml
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: build-and-test
on:
push:
branches: [main]
pull_request:
branches: [main]
env:
DOTNET_NOLOGO: true
NODE_VERSION: "18"
jobs:
build-and-test:
name: build-and-test
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
DOTNET_VERSION: ["9.0.x", "8.0.x"]
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- if: matrix.DOTNET_VERSION == '8.0.x'
run: echo "DOTNET_TFM=net8.0" >> $GITHUB_ENV
- if: matrix.DOTNET_VERSION == '9.0.x'
run: echo "DOTNET_TFM=net9.0" >> $GITHUB_ENV
- name: Restore dependencies
run: dotnet restore
- name: Build TypedSignalR.Client.TypeScript.Attributes.csproj
run: dotnet build ./src/TypedSignalR.Client.TypeScript.Attributes/TypedSignalR.Client.TypeScript.Attributes.csproj --no-restore
- name: Build TypedSignalR.Client.TypeScript.Analyzer.csproj
run: dotnet build ./src/TypedSignalR.Client.TypeScript.Analyzer/TypedSignalR.Client.TypeScript.Analyzer.csproj --no-restore
- name: Build TypedSignalR.Client.TypeScript.csproj
run: dotnet build ./src/TypedSignalR.Client.TypeScript/TypedSignalR.Client.TypeScript.csproj --framework ${{ env.DOTNET_TFM }} --no-restore
- name: Build TypedSignalR.Client.TypeScript.Generator.csproj
run: dotnet build ./src/TypedSignalR.Client.TypeScript.Generator/TypedSignalR.Client.TypeScript.Generator.csproj --framework ${{ env.DOTNET_TFM }} --no-restore
- name: Launch test server
run: dotnet run --project ./tests/TypedSignalR.Client.TypeScript.Tests.Server/TypedSignalR.Client.TypeScript.Tests.Server.csproj --framework ${{ env.DOTNET_TFM }} --no-restore &
- name: Generate TypeScript code for test (JSON)
run: dotnet run --project ./src/TypedSignalR.Client.TypeScript.Generator/TypedSignalR.Client.TypeScript.Generator.csproj --framework ${{ env.DOTNET_TFM }} --no-build -- --project ./tests/TypedSignalR.Client.TypeScript.Tests.Shared/TypedSignalR.Client.TypeScript.Tests.Shared.csproj --output ./tests/TypeScriptTests/src/generated/json
- name: Generate TypeScript code for test (MessagePack)
run: dotnet run --project ./src/TypedSignalR.Client.TypeScript.Generator/TypedSignalR.Client.TypeScript.Generator.csproj --framework ${{ env.DOTNET_TFM }} --no-build -- --project ./tests/TypedSignalR.Client.TypeScript.Tests.Shared/TypedSignalR.Client.TypeScript.Tests.Shared.csproj --output ./tests/TypeScriptTests/src/generated/msgpack --serializer MessagePack --naming-style none
- name: Install yarn
run: npm install -g yarn
- name: Yarn install
run: yarn --cwd ./tests/TypeScriptTests/ install --frozen-lockfile
- name: Yarn Test
run: yarn --cwd ./tests/TypeScriptTests/ test