-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
96 lines (79 loc) · 2.28 KB
/
wf-build-release-ci.yml
File metadata and controls
96 lines (79 loc) · 2.28 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
name: Build, test, pack, push (CI)
on:
push:
branches:
- master
- develop
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
runs-on: windows-latest
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
steps:
- uses: actions/checkout@v5
name: Checkout Code
- name: Install additional .NET SDKs
uses: actions/setup-dotnet@v5
with:
dotnet-version: |
3.1.x
6.0.x
8.0.x
- name: Run tests
working-directory: QRCoderTests
run: dotnet test -c Debug --nologo /p:CollectCoverage=true /p:CoverletOutputFormat=opencover
- name: Upload coverage files
uses: actions/upload-artifact@v4
with:
name: coverage-files
path: QRCoderTests/coverage.*.xml
retention-days: 1
overwrite: true
- name: Upload to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
additional-tests:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
name: Checkout Code
- name: Install .NET SDK
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Run trim analysis
working-directory: QRCoderTrimAnalysis
run: dotnet publish -c Release -o bin/publish
- name: Build solution
run: dotnet build -c Release
- name: Run API approval tests
working-directory: QRCoderApiTests
run: dotnet test -c Release --nologo
pack-push-ci:
needs: [test, additional-tests]
runs-on: windows-latest
steps:
- uses: actions/checkout@v5
name: Checkout Code
- name: Install .NET SDK
uses: actions/setup-dotnet@v5
with:
dotnet-version: 8.0.x
source-url: https://nuget.pkg.github.com/Shane32/index.json
env:
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: Build NuGet packages
shell: bash
run: dotnet pack -c Release -p:VersionSuffix=$GITHUB_RUN_NUMBER -o out
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: Nuget packages
path: out/*
- name: Publish packages to Github packages
run: dotnet nuget push "out\*" -k ${{secrets.GITHUB_TOKEN}}