-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (54 loc) · 1.76 KB
/
dotnet-desktop-build.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
59
60
61
62
63
64
65
66
67
name: Build pull requests
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
on:
push:
branches: [ "main" ]
paths-ignore:
- 'tools/**'
- '.github/**'
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: windows-latest
steps:
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 17
distribution: 'zulu'
- name: Setup dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.201
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install SonarCloud scanner
run: |
dotnet tool install --global dotnet-sonarscanner
dotnet tool install --global dotnet-coverage
- name: Start sonarcloud scanner
run: |
dotnet sonarscanner begin /k:"alexsee_bsh3" /o:"alexsee" /d:sonar.login="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.vscoveragexml.reportsPaths=coverage.xml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
working-directory: ./src
- name: Build application
run: |
dotnet build --configuration Release
working-directory: ./src
- name: Test application and collect coverage
run: |
dotnet-coverage collect 'dotnet test' -f xml -o 'coverage.xml'
working-directory: ./src
- name: Finish the sonar cloud scanner
run: dotnet sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
working-directory: ./src