Skip to content

Add --required-files CLI argument with glob pattern matching and solution reference check #89

Add --required-files CLI argument with glob pattern matching and solution reference check

Add --required-files CLI argument with glob pattern matching and solution reference check #89

Workflow file for this run

name: SonarCloud
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:
jobs:
sonarcloud:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 10.0.x
- name: Install SonarScanner for .NET
run: |
dotnet tool install --global dotnet-sonarscanner
dotnet tool install --global dotnet-coverage
- name: Restore dependencies
run: dotnet restore SLNX-validator.slnx
- name: Begin SonarCloud analysis
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
dotnet sonarscanner begin \
/k:"slnx-validator" \
/o:"304notmodified" \
/d:sonar.token="${SONAR_TOKEN}" \
/d:sonar.host.url="https://sonarcloud.io" \
/d:sonar.cs.vscoveragexml.reportsPaths="coverage.xml"
- name: Build
run: dotnet build SLNX-validator.slnx --no-incremental -c Release
- name: Test with coverage
run: dotnet-coverage collect "dotnet test --solution SLNX-validator.slnx --no-build -c Release --verbosity normal" -f xml -o coverage.xml
- name: End SonarCloud analysis
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: dotnet sonarscanner end /d:sonar.token="${SONAR_TOKEN}"