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
46 changes: 46 additions & 0 deletions .github/workflows/sonarcloud.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: SonarCloud Analysis

on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened]

jobs:
build-and-analyze:
name: Build and Analyze on SonarCloud
runs-on: ubuntu-latest

steps:
- name: Checkout source code
uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'

- name: Install SonarScanner
run: dotnet tool install --global dotnet-sonarscanner

- name: Restore dependencies
run: dotnet restore src/Faura.sln

- name: Begin SonarCloud Analysis
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
dotnet sonarscanner begin \
/k:"JosepFe_faura" \
/o:"josepfe" \
/d:sonar.login="${SONAR_TOKEN}" \
/d:sonar.host.url="https://sonarcloud.io"

- name: Build solution
run: dotnet build src/Faura.sln --no-restore --no-incremental

- name: End SonarCloud Analysis
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: dotnet sonarscanner end /d:sonar.login="${SONAR_TOKEN}"
Loading