Skip to content

Commit

Permalink
sonarcloud
Browse files Browse the repository at this point in the history
  • Loading branch information
na1307 committed Dec 28, 2024
1 parent 137692c commit dd3b942
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 12 deletions.
13 changes: 13 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,16 @@ updates:
separator: _
reviewers:
- na1307

- package-ecosystem: github-actions
directory: /
schedule:
interval: monthly
time: "12:00"
timezone: Asia/Seoul
assignees:
- na1307
pull-request-branch-name:
separator: _
reviewers:
- na1307
28 changes: 18 additions & 10 deletions .github/workflows/SonarCloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,15 @@ on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build:
sonarcloud:
name: SonarCloud
runs-on: ubuntu-latest
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository
env:
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages
steps:
Expand All @@ -22,8 +26,6 @@ jobs:
distribution: temurin
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x
- name: Cache NuGet
uses: actions/cache@v4
with:
Expand All @@ -32,13 +34,19 @@ jobs:
restore-keys: ${{ runner.os }}-sonar-nuget-
- name: Install Tools
run: dotnet tool restore
- name: Build and analyze
- name: SonarScanner Begin
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: dotnet sonarscanner begin /k:"na1307_Bluehill.Analyzers" /o:"na1307" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.vscoveragexml.reportsPaths=coverage.xml /d:sonar.scanner.skipJreProvisioning=true
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore --no-incremental
- name: Test
run: dotnet coverage collect 'dotnet test --no-build --verbosity normal' -f xml -o 'coverage.xml'
- name: SonarScanner End
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
dotnet sonarscanner begin /k:"na1307_Bluehill.Analyzers" /o:"na1307" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.vscoveragexml.reportsPaths=coverage.xml /d:sonar.scanner.skipJreProvisioning=true
dotnet restore
dotnet build --no-restore --no-incremental
dotnet coverage collect 'dotnet test --no-build --verbosity normal' -f xml -o 'coverage.xml'
dotnet sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"
run: dotnet sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"
2 changes: 0 additions & 2 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ jobs:
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x
- name: Cache NuGet
uses: actions/cache@v4
with:
Expand Down

0 comments on commit dd3b942

Please sign in to comment.