Skip to content

Merge pull request #212 from nenoNaninu/dependabot/nuget/multi-c1cffd… #478

Merge pull request #212 from nenoNaninu/dependabot/nuget/multi-c1cffd…

Merge pull request #212 from nenoNaninu/dependabot/nuget/multi-c1cffd… #478

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