-
Notifications
You must be signed in to change notification settings - Fork 6
70 lines (58 loc) · 1.97 KB
/
ci-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
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
66
67
68
69
70
name: CI Build
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:
permissions:
contents: read
pull-requests: write
env:
DOTNET_NOLOGO: true # Disable the .NET logo in the console output
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true # Disable the .NET first time experience to skip caching NuGet packages and speed up the build
DOTNET_CLI_TELEMETRY_OPTOUT: true # Disable sending .NET CLI telemetry to Microsoft
jobs:
build:
runs-on: ubuntu-latest
name: CI Build
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.x
- name: Restore Dependencies
run: dotnet restore src/DocFXExample.sln
- name: Build
run: dotnet build src/DocFXExample.sln --configuration Release --no-restore
- name: Test
run: dotnet test src/DocFXExample.sln --configuration Release --no-build --verbosity normal --collect:"XPlat Code Coverage" --results-directory ./coverage
- name: Copy Coverage To Predictable Location
run: cp coverage/**/coverage.cobertura.xml coverage.cobertura.xml
- name: Coverage Summary Report
uses: irongut/CodeCoverageSummary@v1.2.0
with:
filename: coverage.cobertura.xml
badge: true
format: 'md'
output: 'both'
- name: Add Coverage PR Comment
uses: marocchino/sticky-pull-request-comment@v2
if: github.event_name == 'pull_request'
with:
recreate: true
path: code-coverage-results.md
- name: Upload Coverage Artifact
uses: actions/upload-artifact@v2.3.0
with:
name: test-coverage-report
path: |
coverage.cobertura.xml
code-coverage-results.md
- name: Upload Nuget Artifact
uses: actions/upload-artifact@v2.3.0
with:
name: ci-nugets
path: src/DocFXExample/bin/Release/Taranis.DocFXExample*.nupkg