8
8
branches : [ main ]
9
9
10
10
jobs :
11
- win :
12
-
13
- runs-on : windows-latest
14
-
15
- permissions :
16
- checks : write
17
-
18
- steps :
19
- - uses : actions/checkout@v4
20
- - name : Setup .NET Core
21
- uses : actions/setup-dotnet@v4
22
- with :
23
- dotnet-version : |
24
- 3.1.x
25
- 6.0.x
26
- 8.0.x
27
- 9.0.x
28
- - name : Install dependencies
29
- run : dotnet restore
30
- - name : Build
31
- run : dotnet build --configuration Release --no-restore
32
-
33
- - name : Test (4.8)
34
- run : dotnet test --no-restore --verbosity normal -f net48 --logger "trx;LogFileName=results4.trx"
35
- - name : Upload test results (4.8)
36
- uses : actions/upload-artifact@v4 # upload test results
37
- if : success() || failure() # run this step even if previous step failed
38
- with :
39
- name : test-results-win48
40
- path : BitFaster.Caching.UnitTests/TestResults/results4.trx
41
-
42
- - name : Test (3.1)
43
- run : dotnet test --no-restore --verbosity normal -f netcoreapp3.1 /p:CollectCoverage=true /p:CoverletOutput=TestResults/ /p:CoverletOutputFormat=lcov --logger "trx;LogFileName=results3.trx"
44
- - name : Upload test results (3.1)
45
- uses : actions/upload-artifact@v4 # upload test results
46
- if : success() || failure() # run this step even if previous step failed
47
- with :
48
- name : test-results-win3
49
- path : BitFaster.Caching.UnitTests/TestResults/results3.trx
50
- - name : Publish coverage report to coveralls.io (3.1)
51
- uses : coverallsapp/github-action@master
52
- with :
53
- github-token : ${{ secrets.GITHUB_TOKEN }}
54
- path-to-lcov : BitFaster.Caching.UnitTests/TestResults/coverage.netcoreapp3.1.info
55
- flag-name : win3
56
- parallel : true
57
-
58
- - name : Test (6.0)
59
- run : dotnet test --no-restore --verbosity normal -f net6.0 /p:CollectCoverage=true /p:CoverletOutput=TestResults/ /p:CoverletOutputFormat=lcov --logger "trx;LogFileName=results6.trx"
60
- - name : Upload test results (6.0)
61
- uses : actions/upload-artifact@v4 # upload test results
62
- if : success() || failure() # run this step even if previous step failed
63
- with :
64
- name : test-results-win6
65
- path : BitFaster.Caching.UnitTests/TestResults/results6.trx
66
- - name : Upload test results (6.0 .NET Std)
67
- uses : actions/upload-artifact@v4
68
- if : success() || failure()
69
- with :
70
- name : test-results-win6-std
71
- path : BitFaster.Caching.UnitTests.Std/TestResults/results6.trx
72
-
73
- - name : Publish coverage report to coveralls.io (6.0)
74
- uses : coverallsapp/github-action@master
75
- with :
76
- github-token : ${{ secrets.GITHUB_TOKEN }}
77
- path-to-lcov : BitFaster.Caching.UnitTests/TestResults/coverage.net6.0.info
78
- flag-name : win6
79
- parallel : true
80
-
81
- - name : Publish NuGet artifacts
82
- uses : actions/upload-artifact@v4
83
- with :
84
- name : NuGet package
85
- path : BitFaster.Caching/bin/Release/
86
-
87
- mac :
88
-
89
- runs-on : macos-latest
90
-
11
+ build :
12
+ name : ${{ matrix.framework }} ${{ matrix.os }}
13
+ runs-on : ${{ matrix.os }}
91
14
permissions :
92
15
checks : write
16
+ strategy :
17
+ fail-fast : false
18
+ matrix :
19
+ include :
20
+ # Windows
21
+ - os : windows-latest
22
+ framework : net48
23
+ coverage : false
24
+ results : results4.trx
25
+ artifact : test-results-win48
26
+ std : false
27
+ flag : net48
28
+ publish_nuget : true
29
+
30
+ - os : windows-latest
31
+ framework : netcoreapp3.1
32
+ coverage : true
33
+ results : results3.trx
34
+ artifact : test-results-win3
35
+ std : false
36
+ flag : win3
37
+ publish_nuget : false
38
+
39
+ - os : windows-latest
40
+ framework : net6.0
41
+ coverage : true
42
+ results : results6.trx
43
+ artifact : test-results-win6
44
+ std : true
45
+ flag : win6
46
+ publish_nuget : false
47
+
48
+ - os : windows-latest
49
+ framework : net9.0
50
+ coverage : true
51
+ results : results9.trx
52
+ artifact : test-results-win9
53
+ std : true
54
+ flag : win9
55
+ publish_nuget : false
56
+
57
+ # macOS
58
+ - os : macos-latest
59
+ framework : net6.0
60
+ coverage : true
61
+ results : results.trx
62
+ artifact : test-results-mac
63
+ std : true
64
+ flag : mac
65
+ publish_nuget : false
66
+
67
+ # Linux
68
+ - os : ubuntu-latest
69
+ framework : net6.0
70
+ coverage : true
71
+ results : results.trx
72
+ artifact : test-results-linux
73
+ std : true
74
+ flag : linux
75
+ publish_nuget : false
93
76
94
77
steps :
95
- - uses : actions/checkout@v4
96
- - name : Setup .NET Core
97
- uses : actions/setup-dotnet@v4
98
- with :
99
- dotnet-version : |
100
- 6.0.x
101
- 8.0.x
102
- 9.0.x
103
- - name : Install dependencies
104
- run : dotnet restore
105
- - name : Build
106
- run : dotnet build --configuration Release --no-restore
107
- - name : Test
108
- run : dotnet test --no-restore --verbosity normal -f net6.0 /p:CollectCoverage=true /p:CoverletOutput=TestResults/ /p:CoverletOutputFormat=lcov --logger "trx;LogFileName=results.trx"
109
- - name : Publish coverage report to coveralls.io
110
- uses : coverallsapp/github-action@master
111
- with :
112
- github-token : ${{ secrets.GITHUB_TOKEN }}
113
- path-to-lcov : BitFaster.Caching.UnitTests/TestResults/coverage.net6.0.info
114
- flag-name : mac
115
- parallel : true
116
- - name : Upload test results (6.0)
117
- uses : actions/upload-artifact@v4
118
- if : success() || failure()
119
- with :
120
- name : test-results-mac
121
- path : BitFaster.Caching.UnitTests/TestResults/results.trx
122
- - name : Upload test results (6.0 .NET Std)
123
- uses : actions/upload-artifact@v4
124
- if : success() || failure()
125
- with :
126
- name : test-results-mac-std
127
- path : BitFaster.Caching.UnitTests.Std/TestResults/results.trx
128
-
129
- linux :
130
-
131
- runs-on : ubuntu-latest
132
-
133
- permissions :
134
- checks : write
135
-
136
- steps :
137
- - uses : actions/checkout@v4
138
- - name : Setup .NET Core
139
- uses : actions/setup-dotnet@v4
140
- with :
141
- dotnet-version : |
142
- 6.0.x
143
- 8.0.x
144
- 9.0.x
145
- - name : Install dependencies
146
- run : dotnet restore
147
- - name : Build
148
- run : dotnet build --configuration Release --no-restore
149
- - name : Test
150
- run : dotnet test --no-restore --verbosity normal -f net6.0 /p:CollectCoverage=true /p:CoverletOutput=TestResults/ /p:CoverletOutputFormat=lcov --logger "trx;LogFileName=results.trx"
151
- - name : Publish coverage report to coveralls.io
152
- uses : coverallsapp/github-action@master
153
- with :
154
- github-token : ${{ secrets.GITHUB_TOKEN }}
155
- path-to-lcov : BitFaster.Caching.UnitTests/TestResults/coverage.net6.0.info
156
- flag-name : linux
157
- parallel : true
158
- - name : Upload test results (6.0)
159
- uses : actions/upload-artifact@v4
160
- if : success() || failure()
161
- with :
162
- name : test-results-linux
163
- path : BitFaster.Caching.UnitTests/TestResults/results.trx
164
- - name : Upload test results (6.0 .NET Std)
165
- uses : actions/upload-artifact@v4
166
- if : success() || failure()
167
- with :
168
- name : test-results-linux-std
169
- path : BitFaster.Caching.UnitTests.Std/TestResults/results.trx
78
+ - uses : actions/checkout@v4
79
+
80
+ - name : Setup .NET Core
81
+ uses : actions/setup-dotnet@v4
82
+ with :
83
+ dotnet-version : |
84
+ 3.1.x
85
+ 6.0.x
86
+ 8.0.x
87
+ 9.0.x
88
+
89
+ - name : Install dependencies
90
+ run : dotnet restore
91
+
92
+ - name : Build
93
+ run : dotnet build --configuration Release --no-restore
94
+
95
+ - name : Test
96
+ run : |
97
+ dotnet test --no-restore --verbosity normal -f ${{ matrix.framework }} \
98
+ ${{ matrix.coverage && '-p:CollectCoverage=true' || '' }} \
99
+ ${{ matrix.coverage && '-p:CoverletOutput=TestResults/' || '' }} \
100
+ ${{ matrix.coverage && '-p:CoverletOutputFormat=lcov' || '' }} \
101
+ --logger "trx;LogFileName=${{ matrix.results }}"
102
+ shell : bash
103
+
104
+ - name : Upload test results
105
+ uses : actions/upload-artifact@v4
106
+ if : success() || failure()
107
+ with :
108
+ name : ${{ matrix.artifact }}
109
+ path : BitFaster.Caching.UnitTests/TestResults/${{ matrix.results }}
110
+
111
+ - name : Upload test results (.NET Std)
112
+ if : ${{ matrix.std }}
113
+ uses : actions/upload-artifact@v4
114
+ with :
115
+ name : ${{ matrix.artifact }}-std
116
+ path : BitFaster.Caching.UnitTests.Std/TestResults/${{ matrix.results }}
117
+
118
+ - name : Publish coverage report to coveralls.io
119
+ if : ${{ matrix.coverage && matrix.flag != '' }}
120
+ uses : coverallsapp/github-action@master
121
+ with :
122
+ github-token : ${{ secrets.GITHUB_TOKEN }}
123
+ path-to-lcov : BitFaster.Caching.UnitTests/TestResults/coverage.${{ matrix.framework }}.info
124
+ flag-name : ${{ matrix.flag }}
125
+ parallel : true
126
+
127
+ - name : Publish NuGet artifacts
128
+ if : ${{ matrix.publish_nuget }}
129
+ uses : actions/upload-artifact@v4
130
+ with :
131
+ name : NuGet package
132
+ path : BitFaster.Caching/bin/Release/
170
133
171
134
coverage :
172
-
173
- needs : [win, mac, linux]
174
-
135
+ name : Coveralls Finished
136
+ needs : build
175
137
runs-on : ubuntu-latest
176
-
177
138
steps :
178
- - name : Coveralls Finished
179
- uses : coverallsapp/github-action@master
180
- with :
181
- github-token : ${{ secrets.GITHUB_TOKEN }}
182
- parallel-finished : true
139
+ - name : Coveralls Finished
140
+ uses : coverallsapp/github-action@master
141
+ with :
142
+ github-token : ${{ secrets.GITHUB_TOKEN }}
143
+ parallel-finished : true
0 commit comments