-
Notifications
You must be signed in to change notification settings - Fork 1
42 lines (39 loc) · 1.37 KB
/
cd.yml
File metadata and controls
42 lines (39 loc) · 1.37 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
name: .net cd workflow
on:
push:
branches: [ master ]
defaults:
run:
working-directory: src
jobs:
cd:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v2
with:
dotnet-version: 6.0.x
- name: Setup JDK
uses: actions/setup-java@v1
with:
java-version: '14.0.1'
- name: Install project dependencies
run: |
dotnet tool install --global dotnet-sonarscanner --version 5.7.2
dotnet restore
- name: Execute tests and generate coverage report
run: dotnet test --no-restore --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover
- name: Prepare and start Sonar scaner
run: dotnet sonarscanner begin /k:"${{ secrets.SONAR_PROJECT_KEY }}"
/d:sonar.host.url="${{ secrets.SONAR_HOST_URL }}"
/o:"${{ secrets.SONAR_ORGANIZATION_KEY }}"
/d:sonar.login="${{ secrets.SONAR_TOKEN }}"
/d:sonar.language="cs"
/d:sonar.cs.opencover.reportsPaths="./GitHubClientTest/coverage.opencover.xml"
- name: Build project
run: dotnet build --configuration Release --no-restore
- name: Send information to Sonar host
run: |
export GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}
dotnet sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}"