-
-
Notifications
You must be signed in to change notification settings - Fork 82
55 lines (44 loc) · 1.3 KB
/
Copy pathbuild.yml
File metadata and controls
55 lines (44 loc) · 1.3 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
43
44
45
46
47
48
49
50
51
52
53
54
55
name: build
on:
push:
permissions:
contents: read
env:
DOTNET_VERSION: 10.0.x
SOLUTION: src/MockQueryable/*.sln
CONFIGURATION: Release
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Build
uses: ./.github/actions/dotnet-build
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
solution: ${{ env.SOLUTION }}
configuration: ${{ env.CONFIGURATION }}
- name: Test with coverage
run: |
mkdir -p TestResults
dotnet test ${{ env.SOLUTION }} \
--configuration ${{ env.CONFIGURATION }} \
--no-build \
/p:CollectCoverage=true \
/p:CoverletOutput="$(pwd)/TestResults/coverage.opencover.xml" \
/p:CoverletOutputFormat=opencover
ls -R TestResults
- name: Upload coverage results
uses: actions/upload-artifact@v7
with:
name: code-coverage
path: TestResults
if-no-files-found: error
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v6
with:
files: ./TestResults/coverage.opencover.xml
flags: unittests
fail_ci_if_error: false
disable_search: true
token: ${{ secrets.CODECOV_TOKEN }}