34 lines (31 loc) · 1.29 KB
/
ci.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
name: Continuous integration
on:
push:
branches:
- "*"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
# Disabling shallow clone is recommended for improving relevancy of reporting
fetch-depth: 0
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.101
- name: Install SonarCloud dotnet
run: dotnet tool install --global dotnet-sonarscanner
- name: Start SonarCloud analysis
run: dotnet sonarscanner begin -k:Sirups.Essentials.Mvc -d:sonar.host.url="https://sonarcloud.io" -o:sirups -d:sonar.login=${{secrets.SONAR_KEY}} -d:sonar.branch.name=${GITHUB_REF##*/} -v:${GITHUB_RUN_NUMBER} -d:sonar.cs.opencover.reportsPaths=./testresults/*/coverage.opencover.xml
- name: Install dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore
- name: Test
run: dotnet test --no-restore --verbosity normal --collect:"XPlat Code Coverage" -r ./testresults -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=opencover
- name: End SonarCloud analysis
run: dotnet sonarscanner end -d:sonar.login=${{secrets.SONAR_KEY}}
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}