-
Notifications
You must be signed in to change notification settings - Fork 13
40 lines (39 loc) · 1.48 KB
/
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
name: Build
on:
push:
branches:
- master
- test
pull_request:
types: [opened, synchronize, reopened]
jobs:
build:
name: Build
runs-on: self-hosted
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1 # Shallow clones should be disabled for a better relevancy of analysis
- name: Test Solution
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
shell: powershell
run: |
$ErrorActionPreference = 'Stop'
dotnet test .\clio.tests\clio.tests.csproj -nowarn:none `
/p:CollectCoverage=true /p:CoverletOutputFormat=opencover `
/p:CoverletOutput=".\..\TestResults\coverage.opencover.xml";
- name: Build and analyze
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_URL: ${{ secrets.SONAR_URL }}
shell: powershell
run: |
dotnet sonarscanner begin /k:"clio" /d:sonar.host.url="${{ secrets.SONAR_URL }}" `
/d:sonar.login="${{ secrets.SONAR_TOKEN }}" `
/d:sonar.cs.opencover.reportsPaths="TestResults\coverage.opencover.xml";
dotnet build .\clio\clio.csproj -c Release --no-incremental;
dotnet sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}"
dotnet build-server shutdown;