Skip to content

Merge pull request #120 from nenoNaninu/dependabot/nuget/xunit-2.5.1 #305

Merge pull request #120 from nenoNaninu/dependabot/nuget/xunit-2.5.1

Merge pull request #120 from nenoNaninu/dependabot/nuget/xunit-2.5.1 #305

name: build-and-test
on:
push:
branches: [main]
pull_request:
branches: [main]
env:
DOTNET_VERSION: "7.0.x"
NODE_VERSION: "18"
DOTNET_NOLOGO: true
jobs:
build-and-test:
name: build-and-test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- 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 --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 --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 --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 --no-build --launch-profile Tapper.Tests.Server &
- name: Launch test server2
run: dotnet run --project ./tests/Tapper.Tests.Server/Tapper.Tests.Server.csproj --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