Skip to content

Bump Microsoft.NET.Test.Sdk from 17.12.0 to 17.13.0 #23

Bump Microsoft.NET.Test.Sdk from 17.12.0 to 17.13.0

Bump Microsoft.NET.Test.Sdk from 17.12.0 to 17.13.0 #23

Workflow file for this run

name: CI
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened]
jobs:
build:
name: Test dotnet ${{ matrix.dotnet-version }} on ${{ matrix.operating-system }}
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
operating-system: ['ubuntu-latest', 'windows-latest']
dotnet-version: ['9.0.x']
include:
- operating-system: 'windows-latest'
dotnet-version: '9.0.x'
run-sonarqube-analysis: true
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up JDK 17 for SonarQube
if: matrix.run-sonarqube-analysis
uses: actions/setup-java@v4
with:
java-version: 17
distribution: 'zulu'
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ matrix.dotnet-version }}
- name: Cache SonarCloud packages
uses: actions/cache@v4
if: matrix.run-sonarqube-analysis
with:
path: ~\sonar\cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Cache SonarCloud scanner
id: cache-sonar-scanner
if: matrix.run-sonarqube-analysis
uses: actions/cache@v4
with:
path: .\.sonar\scanner
key: ${{ runner.os }}-sonar-scanner
restore-keys: ${{ runner.os }}-sonar-scanner
- name: Install SonarCloud scanner
if: matrix.run-sonarqube-analysis && steps.cache-sonar-scanner.outputs.cache-hit != 'true'
shell: powershell
run: |
New-Item -Path .\.sonar\scanner -ItemType Directory
dotnet tool update dotnet-sonarscanner --tool-path .\.sonar\scanner
- name: Build and analyze
if: matrix.run-sonarqube-analysis
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
shell: powershell
run: |
.\.sonar\scanner\dotnet-sonarscanner begin `
/k:"Namoshek_Shouldly.Json" `
/o:"namoshek" `
/d:sonar.host.url="https://sonarcloud.io" `
/d:sonar.token="${{ secrets.SONAR_TOKEN }}" `
/d:sonar.cs.opencover.reportsPaths=**/coverage.opencover.xml
dotnet build --configuration "Release" --no-incremental
dotnet test --collect:"XPlat Code Coverage;Format=opencover"
.\.sonar\scanner\dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"
- name: Build package
if: matrix.run-sonarqube-analysis != true
run: dotnet build --configuration 'Release'
- name: Run tests
if: matrix.run-sonarqube-analysis != true
run: dotnet test --configuration 'Debug'