refactor: TBD #222
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: .NET Build | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
permissions: | |
actions: write | |
checks: write | |
contents: read | |
deployments: read | |
issues: write | |
discussions: write | |
packages: read | |
pages: write | |
pull-requests: write | |
security-events: write | |
statuses: write | |
jobs: | |
build: | |
runs-on: windows-latest | |
steps: | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v2 | |
with: | |
distribution: 'microsoft' | |
java-version: '17' | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: 7.0.x | |
- name: Install SonarScanner | |
run: | | |
dotnet tool update --global dotnet-sonarscanner | |
- name: Install coverlet | |
id: install-coverlet | |
run: | | |
dotnet tool install --global dotnet-coverage | |
- uses: actions/checkout@v3 | |
- name: Begin SonarScanner | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
run: dotnet-sonarscanner begin /k:"Vonage_vonage-dotnet-sdk" /o:"vonage" /d:sonar.login="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.vscoveragexml.reportsPaths=coverage.xml | |
- name: Build | |
run: | | |
dotnet build --configuration Release .\Vonage.Common\Vonage.Common.csproj | |
dotnet build --configuration Release .\Vonage\Vonage.csproj | |
dotnet build --configuration Release .\Vonage.Server\Vonage.Server.csproj | |
dotnet build --configuration Release .\Vonage.Common.Test\Vonage.Common.Test.csproj -f net7.0 | |
dotnet build --configuration Release .\Vonage.Test.Unit\Vonage.Test.Unit.csproj -f net7.0 | |
dotnet build --configuration Release .\Vonage.Server.Test\Vonage.Server.Test.csproj -f net7.0 | |
- name: Test | |
run: dotnet-coverage collect 'dotnet test --configuration Release --no-build -f net7.0 --filter Category!=Integration' -f xml -o 'coverage.xml' | |
env: | |
Vonage.Test.RsaPrivateKey: ${{ secrets.VONAGE_RSA_PRIVATE_KEY }} | |
- name: End SonarScanner | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
run: dotnet-sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}" |