-
Notifications
You must be signed in to change notification settings - Fork 8
38 lines (38 loc) · 1.3 KB
/
dotnet-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
name: .NET build
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Git Checkout
uses: actions/checkout@v3
with:
ref: ${{github.event.pull_request.head.ref}}
repository: ${{github.event.pull_request.head.repo.full_name}}
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
dotnet-quality: ga
- name: Setup Report Generator
run: dotnet tool install --global dotnet-reportgenerator-globaltool
- name: MongoDB in GitHub Actions
uses: supercharge/[email protected]
with:
mongodb-version: '4.4'
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore -c Release
# Generate code coverage reports, which are recovered by Codacy afterwards.
- name: Test
run: dotnet test --no-build --verbosity normal -m:1 -c Release --collect:"XPlat Code Coverage" --results-directory:"../../coverage-outputs"
- name: Merge coverage results
run: |
reportgenerator -reports:"../../coverage-outputs/**/*.xml" -targetdir:"../../coverage-outputs" -reporttypes:Cobertura
rm -rfv ../../coverage-outputs/*/
ls -la ../../coverage-outputs