Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 22 additions & 35 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,47 +1,34 @@
name: SonarQube
name: Build and Test
on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened]

jobs:
build:
name: Build and analyze
name: Build and Test
runs-on: windows-latest
permissions:
contents: read

steps:
- name: Set up JDK 17
uses: actions/setup-java@v4
- name: Checkout code
uses: actions/checkout@v4
with:
java-version: 17
distribution: 'zulu' # Alternative distribution options are available.
- uses: actions/checkout@v4
fetch-depth: 0

Copilot AI Jan 24, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fetch-depth: 0 setting fetches the entire Git history and is typically used for SonarCloud analysis to calculate accurate blame information and new code detection. Since SonarCloud has been removed from the CI workflow, this setting is no longer necessary and can be removed or changed to the default shallow clone behavior (fetch-depth: 1) to improve checkout performance.

Suggested change
fetch-depth: 0
fetch-depth: 1

Copilot uses AI. Check for mistakes.

- name: Setup .NET 10 SDK
uses: actions/setup-dotnet@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Cache SonarQube Cloud packages
uses: actions/cache@v4
with:
path: ~\sonar\cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Cache SonarQube Cloud scanner
id: cache-sonar-scanner
uses: actions/cache@v4
with:
path: .\.sonar\scanner
key: ${{ runner.os }}-sonar-scanner
restore-keys: ${{ runner.os }}-sonar-scanner
- name: Install SonarQube Cloud scanner
if: 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
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
shell: powershell
run: |
.\.sonar\scanner\dotnet-sonarscanner begin /k:"rrusson_DarkClippy" /o:"rrusson" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io"
dotnet build
.\.sonar\scanner\dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"
dotnet-version: '10.0.x'

- name: Restore dependencies
run: dotnet restore

- name: Build
run: dotnet build --no-restore -c Release

- name: Run tests
run: dotnet test --no-build -c Release --verbosity normal