Merge pull request #17 from marthijn/dependabot/nuget/tests-8c8b2232d5 #71
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: build | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- '*' | |
env: | |
DOTNET_NOLOGO: true | |
jobs: | |
build: | |
runs-on: ubuntu-22.04 | |
strategy: | |
matrix: | |
dotnet-version: [ '9.x' ] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-java@v4 #sonar scanner requires jdk | |
with: | |
distribution: 'microsoft' | |
java-version: '17' | |
- name: Setup dotnet | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: ${{ matrix.dotnet-version }} | |
- name: Install dotnet-sonarscanner | |
run: dotnet tool install --global dotnet-sonarscanner | |
- name: install dotnet-coverage | |
run: dotnet tool install --global dotnet-coverage | |
- name: Install dependencies | |
run: dotnet restore | |
- name: dotnet build,test and sonar analyze | |
run: | | |
dotnet sonarscanner begin \ | |
-k:"marthijn_Sidio.Web.Security" \ | |
-o:"marthijn" \ | |
-d:sonar.token="${{ secrets.SONAR_TOKEN }}" \ | |
-d:sonar.host.url="https://sonarcloud.io/" \ | |
-d:sonar.exclusions=".github/**" \ | |
-d:sonar.cs.vscoveragexml.reportsPaths=coverage.xml | |
dotnet build --configuration Release | |
dotnet-coverage collect "dotnet test" -f xml -o "coverage.xml" | |
dotnet sonarscanner end -d:sonar.token="${{ secrets.SONAR_TOKEN }}" |