11name : Build, test, pack, push (CI)
2+
23on :
34 push :
45 branches :
56 - master
67 workflow_dispatch :
7- jobs :
8- build :
9- runs-on : windows-latest
8+
9+ jobs :
10+ test :
11+ runs-on : windows-latest
1012 env :
1113 ACTIONS_ALLOW_UNSECURE_COMMANDS : true
1214 steps :
1315 - uses : actions/checkout@v4
1416 name : Checkout Code
15-
16- - name : Install additional .NET SDKs
17- uses : actions/setup-dotnet@v4
18- with :
19- dotnet-version : |
20- 1.0.x
21- 2.0.x
22- 5.0.x
23- 6.0.x
24- 8.0.x
25-
26- - name : Restore NuGet Packages
27- run : dotnet restore
28-
29- - name : Build library
30- run : dotnet build -c Release --no-restore
31-
32- - name : Upload artifacts
33- uses : actions/upload-artifact@v4
34- with :
35- name : Compiled project
36- path : ${{ github.workspace }}
37-
38- test :
39- needs : build
40- runs-on : windows-latest
41- steps :
42- - name : Download artifacts
43- uses : actions/download-artifact@v4
44- with :
45- name : Compiled project
46- path : ${{ github.workspace }}
4717
4818 - name : Install additional .NET SDKs
4919 uses : actions/setup-dotnet@v4
5020 with :
51- dotnet-version : |
52- 1.0 .x
53- 2.0 .x
21+ dotnet-version : |
22+ 2.1 .x
23+ 3.1 .x
5424 5.0.x
5525 6.0.x
5626 8.0.x
5727
58- - name : Run test .NET 3.5
59- working-directory : QRCoderTests
60- run : dotnet test -c Release -f net35 --nologo --no-build # No coverage for NET3.5 because of bug in combination with Coverlet+Stronh naming
61-
62- - name : Run test .NET 4.52
63- working-directory : QRCoderTests
64- run : dotnet test -c Release -f net452 --nologo --no-build # No coverage for NET4.5 because of bug in combination with Coverlet+Strong naming
65-
66- - name : Run test .NET Core 1.1
28+ - name : Run tests
6729 working-directory : QRCoderTests
68- run : dotnet test -c Release -f netcoreapp1.1 -- nologo # No coverage for .NETCORE 1.1 because Coverlet doesn't support it https://github.com/coverlet-coverage/coverlet/issues/466
30+ run : dotnet test -c Debug -- nologo /p:CollectCoverage=true /p:CoverletOutputFormat=opencover
6931
70- - name : Run test .NET Core 2.0
71- working-directory : QRCoderTests
72- run : dotnet test -c Release -f netcoreapp2.0 --nologo /p:CollectCoverage=true /p:CoverletOutputFormat=opencover
73-
74- - name : Run test .NET 5.0
75- working-directory : QRCoderTests
76- run : dotnet test -c Release -f net5.0 --nologo --no-build /p:CollectCoverage=true /p:CoverletOutputFormat=opencover
77-
78- - name : Run test .NET 5.0 Windows
79- working-directory : QRCoderTests
80- run : dotnet test -c Release -f net5.0-windows --nologo --no-build /p:CollectCoverage=true /p:CoverletOutputFormat=opencover
81-
82- - name : Run test .NET 6.0
83- working-directory : QRCoderTests
84- run : dotnet test -c Release -f net6.0 --nologo --no-build /p:CollectCoverage=true /p:CoverletOutputFormat=opencover
85-
86- - name : Run test .NET 6.0 Windows
87- working-directory : QRCoderTests
88- run : dotnet test -c Release -f net6.0-windows --nologo --no-build /p:CollectCoverage=true /p:CoverletOutputFormat=opencover
89-
90- - name : Run API approval tests
91- working-directory : QRCoderApiTests
92- run : dotnet test -c Release --nologo --no-build
93-
94- - name : Codecov update netcoreapp2.0
32+ - name : Codecov update
9533 uses : codecov/codecov-action@v4
9634 with :
9735 token : ${{ secrets.CODECOV_TOKEN }}
9836 disable_search : true
9937 fail_ci_if_error : true
100- files : ./QRCoderTests/coverage.netcoreapp2.0.opencover.xml
101- flags : netcoreapp2.0
38+ files : ./QRCoderTests/coverage.*.opencover.xml
10239
103- - name : Codecov update net5.0
104- uses : codecov/codecov-action@v4
105- with :
106- token : ${{ secrets.CODECOV_TOKEN }}
107- disable_search : true
108- fail_ci_if_error : true
109- files : ./QRCoderTests/coverage.net5.0.opencover.xml
110- flags : net5.0
40+ additional-tests :
41+ runs-on : windows-latest
42+ steps :
43+ - uses : actions/checkout@v4
44+ name : Checkout Code
11145
112- - name : Codecov update net5.0-windows
113- uses : codecov/codecov-action @v4
46+ - name : Install .NET SDK
47+ uses : actions/setup-dotnet @v4
11448 with :
115- token : ${{ secrets.CODECOV_TOKEN }}
116- disable_search : true
117- fail_ci_if_error : true
118- files : ./QRCoderTests/coverage.net5.0-windows.opencover.xml
119- flags : net5.0-windows
49+ dotnet-version : 8.0.x
12050
121- - name : Codecov update net6.0
122- uses : codecov/codecov-action@v4
123- with :
124- token : ${{ secrets.CODECOV_TOKEN }}
125- disable_search : true
126- fail_ci_if_error : true
127- files : ./QRCoderTests/coverage.net5.0.opencover.xml
128- flags : net6.0
51+ - name : Run trim analysis
52+ working-directory : QRCoderTrimAnalysis
53+ run : dotnet publish -c Release -o bin/publish
12954
130- - name : Codecov update net6.0-windows
131- uses : codecov/codecov-action@v4
132- with :
133- token : ${{ secrets.CODECOV_TOKEN }}
134- disable_search : true
135- fail_ci_if_error : true
136- files : ./QRCoderTests/coverage.net5.0-windows.opencover.xml
137- flags : net6.0-windows
55+ - name : Run API approval tests
56+ working-directory : QRCoderApiTests
57+ run : dotnet test -c Debug --nologo
13858
13959
14060 pack-push-ci :
141- needs : test
61+ needs : [ test, additional-tests]
14262 runs-on : windows-latest
14363 env :
14464 GH_PKG_SEC : ${{ secrets.GITHUB_TOKEN }}
145- steps :
146- - name : Download artifacts
147- uses : actions/download-artifact@v4
148- with :
149- name : Compiled project
150- path : ${{ github.workspace }}
65+ steps :
66+ - uses : actions/checkout@v4
67+ name : Checkout Code
15168
152- - name : Install additional .NET SDKs
69+ - name : Install .NET SDK
15370 uses : actions/setup-dotnet@v4
15471 with :
155- dotnet-version : |
156- 1.0.x
157- 2.0.x
158- 5.0.x
159- 6.0.x
160- 8.0.x
72+ dotnet-version : 8.0.x
16173
16274 - name : Restore dependencies
16375 run : dotnet restore
16476
77+ - name : Build library
78+ run : dotnet build -c Release --no-restore
79+
16580 - name : Get assembly version QRCoder
16681 run : echo "ASSEM_VER=$([Reflection.Assembly]::Loadfile( $(-join($pwd,"\QRCoder\bin\Release\net40\QRCoder.dll"))).GetName().version.ToString())" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
16782
@@ -188,14 +103,3 @@ jobs:
188103
189104 - name : Publish QRCoder and QRCoder.Xaml to Github packages
190105 run : dotnet nuget push "**/*.nupkg" --no-symbols --skip-duplicate --api-key $env:GH_PKG_SEC --source https://nuget.pkg.github.com/codebude/index.json
191-
192-
193- clean :
194- needs : [build, test, pack-push-ci]
195- if : always()
196- runs-on : windows-latest
197- steps :
198- - name : Delete artifacts
199- uses : GeekyEggo/delete-artifact@v5
200- with :
201- name : Compiled project
0 commit comments