Skip to content

Unit Tests

Unit Tests #4453

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@v4
- uses: actions/setup-node@v4
with:
node-version: 14
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: 17
distribution: 'zulu'
- name: Setup .NET versions
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
2.1.x
3.1.x
5.0.x
6.0.x
7.0.x
8.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 net8.0
- name: Core Integration Test project
run: dotnet test src/Core/ApiClientCodeGen.Core.IntegrationTests\ApiClientCodeGen.Core.IntegrationTests.csproj -f net8.0
vsix:
name: VSIX Extension
runs-on: windows-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
- name: Restore
run: dotnet restore VSIX.sln
working-directory: src
- name: Setup MSBuild.exe
uses: microsoft/setup-msbuild@v2
- 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