-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (54 loc) · 1.6 KB
/
Copy pathbuild.yml
File metadata and controls
60 lines (54 loc) · 1.6 KB
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
59
60
name: build
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
branches:
- '*'
permissions:
contents: read
actions: read
id-token: write
env:
DOTNET_NOLOGO: true
jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v6
- uses: actions/setup-java@v5 #sonar scanner requires jdk
with:
distribution: 'microsoft'
java-version: '17'
- name: Setup dotnet 8.x
uses: actions/setup-dotnet@v5
with:
dotnet-version: 8.x
- name: Setup dotnet 9.x
uses: actions/setup-dotnet@v5
with:
dotnet-version: 9.x
- name: Setup dotnet 10.x
uses: actions/setup-dotnet@v5
with:
dotnet-version: 10.x
- name: Install dotnet-sonarscanner
run: dotnet tool install --global dotnet-sonarscanner
- name: install dotnet-coverage
run: dotnet tool install --global dotnet-coverage
- name: Install dependencies
run: dotnet restore
- name: dotnet build,test and sonar analyze
run: |
dotnet sonarscanner begin \
-k:"marthijn_Sidio.Web.Security" \
-o:"marthijn" \
-d:sonar.token="${{ secrets.SONAR_TOKEN }}" \
-d:sonar.host.url="https://sonarcloud.io/" \
-d:sonar.exclusions=".github/**" \
-d:sonar.cs.vscoveragexml.reportsPaths=coverage.xml
dotnet build --configuration Release
dotnet-coverage collect "dotnet test" -f xml -o "coverage.xml"
dotnet sonarscanner end -d:sonar.token="${{ secrets.SONAR_TOKEN }}"