-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (48 loc) · 1.74 KB
/
code-coverage.yml
File metadata and controls
49 lines (48 loc) · 1.74 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
on:
push:
branches:
- main
paths-ignore:
- 'docs/**'
- 'README.md'
pull_request:
branches:
- main
paths-ignore:
- 'docs/**'
- 'README.md'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 5
# Skip for dependabot PRs: they have low impact on code coverage and lack access to CODECOV_TOKEN on protected branches
if: github.actor != 'dependabot[bot]'
permissions:
# Required to allow the codecov action to authenticate via OIDC instead of
# a stored secret token. The id-token: write permission lets the job request
# a short-lived OIDC token from GitHub which Codecov uses to verify the upload.
id-token: write
# Required to allow actions/checkout to read repository contents.
contents: read
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
- name: Build
run: dotnet build
- name: Test
run: |
dotnet test ConsoleMarkdownRenderer.Tests /p:CollectCoverage=true /p:CoverletOutputFormat=opencover
dotnet test ConsoleMarkdownRenderer.ExampleTests /p:CollectCoverage=true /p:CoverletOutputFormat=opencover
- name: Upload Code Coverage
uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1
with:
use_oidc: true
# No explicit files: — let codecov auto-discover the per-target-framework
# coverlet outputs (coverage.net8.0.opencover.xml / coverage.net10.0.opencover.xml)
# produced by both test projects.
name: codecov-umbrella # optional
fail_ci_if_error: true # optional (default = false)
verbose: true # optional (default = false)