-
Notifications
You must be signed in to change notification settings - Fork 8
78 lines (57 loc) · 2.84 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
72
73
74
75
76
77
78
name: build-and-test
on:
push:
branches: [main]
pull_request:
branches: [main]
env:
DOTNET_VERSION: "8.0.x"
NODE_VERSION: "18"
DOTNET_NOLOGO: true
jobs:
build-and-test:
name: build-and-test
runs-on: ubuntu-latest
strategy:
matrix:
DOTNET_VERSION: ["8.0.x", "7.0.x"]
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ matrix.DOTNET_VERSION }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- if: matrix.DOTNET_VERSION == '7.0.x'
run: echo "DOTNET_TFM=net7.0" >> $GITHUB_ENV
- if: matrix.DOTNET_VERSION == '8.0.x'
run: echo "DOTNET_TFM=net8.0" >> $GITHUB_ENV
- name: Restore dependencies
run: dotnet restore
- name: Build Tapper.csproj
run: dotnet build ./src/Tapper/Tapper.csproj --no-restore
- name: Test
run: dotnet test --no-restore
- name: Build Tapper.Generator.csproj
run: dotnet build ./src/Tapper.Generator/Tapper.Generator.csproj --no-restore
- name: Generate Code (json)
run: dotnet run --project ./src/Tapper.Generator/Tapper.Generator.csproj --framework ${{ env.DOTNET_TFM }} --no-build -- --project ./tests/Tapper.Tests.Server/Tapper.Tests.Server.csproj --output ./tests/TypeScriptTest/src/generated/json/
- name: Generate Code (msgpack)
run: dotnet run --project ./src/Tapper.Generator/Tapper.Generator.csproj --framework ${{ env.DOTNET_TFM }} --no-build -- --project ./tests/Tapper.Tests.Server/Tapper.Tests.Server.csproj --output ./tests/TypeScriptTest/src/generated/msgpack --serializer messagepack --naming-style none
- name: Generate Code (json-string-enum)
run: dotnet run --project ./src/Tapper.Generator/Tapper.Generator.csproj --framework ${{ env.DOTNET_TFM }} --no-build -- --project ./tests/Tapper.Tests.Server/Tapper.Tests.Server.csproj --output ./tests/TypeScriptTest/src/generated/json-string-enum --enum nameCamel
- name: Build test api server
run: dotnet build ./tests/Tapper.Tests.Server/Tapper.Tests.Server.csproj --no-restore
- name: Launch test server1
run: dotnet run --project ./tests/Tapper.Tests.Server/Tapper.Tests.Server.csproj --framework ${{ env.DOTNET_TFM }} --no-build --launch-profile Tapper.Tests.Server &
- name: Launch test server2
run: dotnet run --project ./tests/Tapper.Tests.Server/Tapper.Tests.Server.csproj --framework ${{ env.DOTNET_TFM }} --no-build --launch-profile Tapper.Tests.Server-JsonStringEnum &
- name: Install yarn
run: npm install -g yarn
- name: Yarn install
run: yarn --cwd ./tests/TypeScriptTest/ install --frozen-lockfile
- name: Yarn test
run: yarn --cwd ./tests/TypeScriptTest/ test