Skip to content

Unit Tests

Unit Tests #2966

Workflow file for this run

name: Unit Tests
on:
workflow_dispatch:
push:
paths-ignore:
- '**/*'
- '!.github/workflows/unit-tests.yml'
- '!src/**/*.csproj'
- '!src/**/*.cs'
branches:
- '*'
pull_request:
branches:
- '*'
schedule:
- cron: '0 8 * * *'
jobs:
rapicgen:
name: CLI Tool
runs-on: windows-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 14
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
java-version: 17
distribution: 'zulu'
- name: Setup .NET versions
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
2.1.x
3.1.x
5.0.x
6.0.x
7.0.x
- name: Build with dotnet
run: dotnet build Rapicgen.sln
working-directory: src
- name: Core test project
run: dotnet test src/Core/ApiClientCodeGen.Core.Tests\ApiClientCodeGen.Core.Tests.csproj -f net6.0
- name: Core Integration Test project
run: dotnet test src/Core/ApiClientCodeGen.Core.IntegrationTests\ApiClientCodeGen.Core.IntegrationTests.csproj -f net6.0
vsmac:
name: VS Mac Extension
runs-on: macos-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
- name: Setup .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: 3.1
- name: Core Test project
run: dotnet test src/Core/ApiClientCodeGen.Core.Tests/ApiClientCodeGen.Core.Tests.csproj -f net6.0
- name: Core Integration Test project
run: dotnet test src/Core/ApiClientCodeGen.Core.IntegrationTests/ApiClientCodeGen.Core.IntegrationTests.csproj -f net6.0
vsix:
name: VSIX Extension
runs-on: windows-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v3
- name: Restore
run: dotnet restore VSIX.sln
working-directory: src
- name: Setup MSBuild.exe
uses: microsoft/setup-msbuild@v1.1
- name: Build
run: msbuild VSIX.sln /property:Configuration=Release /t:Rebuild
working-directory: src
- name: Run .NET Core Tests
working-directory: src
continue-on-error: true
run: |
dotnet test CLI/ApiClientCodeGen.CLI.Tests\ApiClientCodeGen.CLI.Tests.csproj --collect "Code coverage" -c Release --no-build
dotnet test Core/ApiClientCodeGen.Core.Tests\ApiClientCodeGen.Core.Tests.csproj --collect "Code coverage" -c Release --no-build
dotnet test Core/ApiClientCodeGen.Core.IntegrationTests\ApiClientCodeGen.Core.IntegrationTests.csproj --collect "Code coverage" -c Release --no-build