Update dependency Microsoft.Extensions.DependencyInjection.Abstractions to v9 #196
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 Analysis | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
types: [opened, synchronize, reopened] | |
workflow_dispatch: | |
jobs: | |
build-test-analyze: | |
name: Build, test & analyze | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: | | |
8.0.x | |
- name: Set up Java | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: 17 | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis | |
- name: Cache SonarCloud packages | |
uses: actions/cache@v4 | |
with: | |
path: ~\sonar\cache | |
key: ${{ runner.os }}-sonar | |
restore-keys: ${{ runner.os }}-sonar | |
- name: Install SonarCloud scanners | |
run: | | |
dotnet tool install --global dotnet-sonarscanner | |
- name: Set up Kafka | |
uses: ybyzek/[email protected] | |
with: | |
service: broker | |
- name: Build & Test | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
run: | | |
dotnet-sonarscanner begin /k:"Altinn_altinn-notifications-sms" /o:"altinn" /d:sonar.login="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.vstest.reportsPaths="**/*.trx" /d:sonar.cs.opencover.reportsPaths="**/coverage.opencover.xml" | |
dotnet build Altinn.Notifications.Sms.sln -v q | |
dotnet test Altinn.Notifications.Sms.sln \ | |
-v q \ | |
--collect:"XPlat Code Coverage" \ | |
--results-directory TestResults/ \ | |
--logger "trx;" \ | |
--configuration release \ | |
-- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=opencover | |
- name: Complete sonar analysis | |
if: always() | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
run: | | |
dotnet-sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}" | |
- name: Process .NET test result | |
if: ${{ failure() }} | |
uses: NasAmin/[email protected] | |
with: | |
TRX_PATH: ${{ github.workspace }}/TestResults | |
REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |