-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (70 loc) · 2.52 KB
/
ci.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
71
72
73
74
name: CI
on:
push:
branches:
- "main"
tags:
- "McPride.Markdig*-v[0-9]+.[0-9]+.[0-9]+"
- "McPride.Markdig*-v[0-9]+.[0-9]+.[0-9]+-alpha[0-9]+.[0-9]+"
- "McPride.Markdig*-v[0-9]+.[0-9]+.[0-9]+-beta[0-9]+.[0-9]+"
- "McPride.Markdig*-v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+.[0-9]+"
- "McPride.Markdig*-v[0-9]+.[0-9]+.[0-9]+-preview[0-9]+.[0-9]+"
- "McPride.Markdig*-v[0-9]+.[0-9]+.[0-9]+-prerelease[0-9]+.[0-9]+"
- "McPride.Markdig*-v[0-9]+.[0-9]+.[0-9]+-pre[0-9]+.[0-9]+"
paths-ignore:
- '**/README.md'
pull_request:
branches: [ "main" ]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
- name: Restore dependencies
run: dotnet restore src/mcpride-markdig-extensions.sln
- name: Build Debug
run: dotnet build src/mcpride-markdig-extensions.sln --no-restore --configuration Debug
- name: Test
run: dotnet test src/mcpride-markdig-extensions.sln --no-build --verbosity normal --collect:"XPlat Code Coverage" --logger trx --results-directory ./coverage
- name: Code Coverage Summary Report
uses: irongut/CodeCoverageSummary@v1.3.0
with:
filename: coverage/*/coverage.cobertura.xml
badge: true
fail_below_min: false
format: markdown
hide_branch_rate: false
hide_complexity: false
indicators: true
output: both
thresholds: '60 80'
- 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: Write to Job Summary
run: cat code-coverage-results.md >> $GITHUB_STEP_SUMMARY
release:
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/')
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
- name: Restore dependencies
run: dotnet restore src/mcpride-markdig-extensions.sln
- name: Build release
run: dotnet build src/mcpride-markdig-extensions.sln --no-restore --configuration Release
- name: Push packages to nuget.org
run: dotnet nuget push ./**/Release/McPride.Markdig.*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_PUSH_API_KEY }}