Skip to content

Bump the microsoft group with 7 updates #17

Bump the microsoft group with 7 updates

Bump the microsoft group with 7 updates #17

Workflow file for this run

name: Build & Test
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
name: Build, Test & SonarCloud
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Set up Java 21 (required by SonarScanner)
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 21
- name: Set up .NET 10
uses: actions/setup-dotnet@v4
with:
dotnet-version: 10.x
- name: Cache NuGet packages
uses: actions/cache@v4
with:
path: ~/.nuget/packages
key: nuget-${{ runner.os }}-${{ hashFiles('**/*.csproj') }}
restore-keys: nuget-${{ runner.os }}-
- name: Install SonarScanner for .NET
run: dotnet tool install --global dotnet-sonarscanner
- name: Restore dependencies
run: dotnet restore
- name: Begin SonarCloud analysis
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
dotnet sonarscanner begin \
/k:"guibranco_grimoire-api" \
/o:"guibranco" \
/d:sonar.token="${{ secrets.SONAR_TOKEN }}" \
/d:sonar.host.url="https://sonarcloud.io" \
/d:sonar.cs.opencover.reportsPaths="**/coverage.opencover.xml" \
/d:sonar.exclusions="**/Migrations/**,**/obj/**,**/bin/**" \
/d:sonar.coverage.exclusions="**/Migrations/**,**/Program.cs"
- name: Build
run: dotnet build --no-restore --configuration Release
- name: Run tests with coverage
run: |
dotnet test --no-build --configuration Release \
--collect:"XPlat Code Coverage" \
--results-directory ./coverage \
-- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=opencover
- name: End SonarCloud analysis
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: dotnet sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"