-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (47 loc) · 1.55 KB
/
build-scan.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: .NET Build and SonarCloud scan
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
types: [ "opened", "synchronize", "reopened", "ready_for_review" ]
paths:
- "EntityRepository/**/*"
- "ExtensionMethods/**/*"
- "test/**/*"
- "Sidekick.sln"
- "global.json"
workflow_dispatch:
concurrency:
group: ${{ github.head_ref || github.run_id }}
cancel-in-progress: true
permissions:
pull-requests: read
jobs:
build-scan:
name: Build and scan
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-dotnet@v4
with:
global-json-file: global.json
- name: Cache SonarCloud packages
uses: actions/cache@v4
with:
path: ~\sonar\cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Run dotnet tool restore
run: dotnet tool restore
- name: Run dotnet restore
run: dotnet restore Sidekick.sln
- name: Begin sonar scan
run: dotnet sonarscanner begin /k:"sogustavo_sidekick" /o:"sogustavo" /d:sonar.login="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.vscoveragexml.reportsPaths=coverage.xml
- name: Run dotnet build
run: dotnet build -c Release --no-restore Sidekick.sln
- name: End sonar scan
run: dotnet sonarscanner end /d:sonar.login=${{ secrets.SONAR_TOKEN }}