Skip to content

Commit

Permalink
Added sonarcloud.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
lvukadinovic-ib authored Oct 25, 2024
1 parent c76e11b commit 4f7db7b
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/sonarcloud.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: SonarCloud analysis

on: [push]

jobs:
sonarcloud:
runs-on: ubuntu-latest
strategy:
matrix:
dotnet-version: [6.x, 7.x, 8.x]
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ matrix.dotnet-version }}
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
- name: Run SonarCloud Scan
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
dotnet-sonarscanner begin /k:"${{ secrets.SONAR_PROJECT_KEY }}" /o:"${{ secrets.SONAR_ORG_KEY }}" /d:sonar.login="${{ secrets.SONAR_TOKEN }}"
dotnet build
dotnet-sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}"

0 comments on commit 4f7db7b

Please sign in to comment.