Skip to content

Commit e33725d

Browse files
author
Alexis Huvier
committed
feat(build): add sonarcloud
1 parent b4d873c commit e33725d

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

.github/workflows/build.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: SonarCloud
2+
on:
3+
push:
4+
branches:
5+
- master
6+
pull_request:
7+
types: [opened, synchronize, reopened]
8+
jobs:
9+
build:
10+
name: Build and analyze
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Set up JDK 17
14+
uses: actions/setup-java@v3
15+
with:
16+
java-version: 17
17+
distribution: 'zulu'
18+
19+
- uses: actions/checkout@v3
20+
with:
21+
fetch-depth: 0
22+
23+
- name: Setup .NET
24+
uses: actions/setup-dotnet@v3
25+
26+
- name: Install SonarCloud scanner
27+
if: steps.cache-sonar-scanner.outputs.cache-hit != 'true'
28+
run: |
29+
dotnet tool install --global dotnet-sonarscanner
30+
31+
- name: Build and analyze
32+
env:
33+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
34+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
35+
run: |
36+
dotnet-sonarscanner begin /k:"SharpEngine_SharpEngine.SQLite" /o:"sharpengine" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io"
37+
dotnet restore
38+
dotnet build SharpEngine.SQLite/SharpEngine.SQLite.csproj -c Release
39+
dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"

0 commit comments

Comments
 (0)