-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (50 loc) · 1.77 KB
/
dotnet.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
name: .NET
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 9.0.x
# run build and test
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
- name: Test and Collect Code Coverage
run: dotnet test -p:CollectCoverage=true -p:CoverletOutput=coverage/
- name: Copy coverage files
run: |
mkdir '${{ github.workspace }}/coverage'
find . -name "*.opencover.xml" -exec sh -c 'cp "$0" "coverage/coverage-$(basename $0)"' {} \;
- name: List coverage files
run: ls '${{ github.workspace }}/coverage/'
- name: SonarCloud Scan
uses: sonarsource/sonarcloud-github-action@master
with:
args: >
-Dsonar.organization=managedcode
-Dsonar.projectKey=managedcode_Together
-Dsonar.token=${{ secrets.SONAR_TOKEN }}
-Dsonar.cs.opencover.reportsPaths=${{ github.workspace }}/coverage/
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
# - name: coveralls
# uses: coverallsapp/github-action@master
# with:
# github-token: ${{secrets.GITHUB_TOKEN }}
# path-to-lcov: coverage/coverage.info