Skip to content

feat: add icon for improved user interface #41

feat: add icon for improved user interface

feat: add icon for improved user interface #41

Workflow file for this run

name: SonarQube Analysis
permissions:
contents: read
# Analyze only the long-lived branch. Community-Edition Sonar has no branch/PR
# support — every analysis writes to the single main branch. PR build/test feedback
# is covered by CI.yml.
on:
push:
branches:
- develop
workflow_dispatch:
jobs:
build:
name: Build and analyze
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Set up JDK 17
uses: actions/setup-java@v5
with:
java-version: 17
distribution: 'zulu'
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: 10.0.x
- name: Cache SonarQube packages
uses: actions/cache@v5
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Cache SonarQube scanner
id: cache-sonar-scanner
uses: actions/cache@v5
with:
path: ./.sonar/scanner
key: ${{ runner.os }}-sonar-scanner
restore-keys: ${{ runner.os }}-sonar-scanner
- name: Install SonarQube scanner
if: steps.cache-sonar-scanner.outputs.cache-hit != 'true'
run: |
mkdir -p ./.sonar/scanner
dotnet tool update dotnet-sonarscanner --tool-path ./.sonar/scanner
- name: Restore dependencies
run: dotnet restore
- name: Build and analyze
run: |
./.sonar/scanner/dotnet-sonarscanner begin /k:"${{ secrets.SONAR_PROJECT_KEY }}" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="${{ secrets.SONAR_HOST_URL }}" /d:sonar.coverage.exclusions="**/tests/**,**/Program.cs,**/Modules/**,**/*ServiceCollectionExtensions.cs,**/DesignTimeDbContextFactory.cs,**/DiscordOptions.cs,**/WorkspaceOptions.cs,**/MapOptions.cs,**/DiscordBotService.cs,**/DiscordUserDmSender.cs,**/DiscordChannelMessenger.cs,**/Discord*ChannelPoster.cs,**/DiscordTeamChatWebhookPoster.cs,**/DiscordWorkspaceGateway.cs" /d:sonar.cs.opencover.reportsPaths="**/coverage.opencover.xml" /d:sonar.cpd.exclusions="**/Migrations/*.cs" /d:sonar.exclusions="**/Migrations/*.cs,**/obj/**,**/bin/**"
dotnet build --no-restore --configuration Release
dotnet test --no-build --configuration Release --collect:"XPlat Code Coverage;Format=opencover" --blame-hang-timeout 60s
./.sonar/scanner/dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v7
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/codecov-action@v7
with:
token: ${{ secrets.CODECOV_TOKEN }}
report_type: test_results