-
Notifications
You must be signed in to change notification settings - Fork 0
Remove SonarCloud from CI workflow #12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
| 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 | ||
|
|
||
| - 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 | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
fetch-depth: 0setting 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.