-
Notifications
You must be signed in to change notification settings - Fork 0
264 lines (224 loc) · 13.3 KB
/
BuildAndTest.yml
File metadata and controls
264 lines (224 loc) · 13.3 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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
name: Build and Test
# PREREQUISITES FOR PUSH-BACK OF TEST RESULTS
# Please note: test project usually required nuget package JUnitTestLogger
# to be able to provide JUnit compatible test results XML file (required
# for pushing back details on succeeded/failed tests)
#
# NuGet install command:
# - Install-Package JUnitTestLogger
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [main]
pull_request:
branches: [main]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
env:
# Path to the solution file relative to the root of the project
SOLUTION_FILE_PATH: .
# Configuration type to build
BUILD_CONFIGURATION: CI_CD
jobs:
test:
#needs: build
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
#arch: [x86, x86_64, arm]
os: [windows-latest, ubuntu-latest, macos-latest]
include:
- os: macos-latest
runNetExe: mono
# arch: x86_64
#- os: ubuntu-latest
# arch: x86
#- os: ubuntu-latest
# arch: x86_64
#- os: ubuntu-latest
# arch: arm
#- os: windows-latest
# build_configuration_suffix: "_WIN"
# arch: x86
#- os: windows-latest
# arch: x86_64
# the build-and-test job might be skipped, we don't need to run this job then
#if: success() || failure()
env:
RESULTS_PATH: TestResults.xml
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Clone code+test files for subsequent projects
shell: pwsh
run: ./clone-build-files.ps1
- name: Setup .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Dir Listing (Win)
if: startsWith(matrix.os, 'windows')
run: dir
- name: Dir Listing (Linux/Mac)
if: (!startsWith(matrix.os, 'windows'))
run: ls -la
- name: unixODBC Driver Listing (Linux/Mac)
if: (!startsWith(matrix.os, 'windows'))
continue-on-error: true
run: odbcinst -q -d
- name: Install dependencies
run: dotnet restore /p:Configuration=CI_CD${{matrix.build_configuration_suffix}}
- name: Build
run: dotnet build --configuration=${{env.BUILD_CONFIGURATION}}${{matrix.build_configuration_suffix}} --no-restore
#- name: Run Unit Tests
# run: dotnet test --framework net8.0 --results-directory test-results --logger junit --configuration=${{env.BUILD_CONFIGURATION}}${{matrix.build_configuration_suffix}} --no-restore
- name: Run Unit Tests CompuMaster.MsExcelComInteropTest.dll
run: dotnet test --framework net8.0 --results-directory test-results-CompuMaster.MsExcelComInteropTest.dll --logger junit --configuration=${{env.BUILD_CONFIGURATION}}${{matrix.build_configuration_suffix}} MsExcelComInteropTest/bin/${{env.BUILD_CONFIGURATION}}${{matrix.build_configuration_suffix}}/net8.0/CompuMaster.MsExcelComInteropTest.dll
- name: Run Unit Tests CompuMaster.Excel.Test.dll
run: dotnet test --framework net8.0 --results-directory test-results-CompuMaster.Excel.Test.dll --logger junit --configuration=${{env.BUILD_CONFIGURATION}}${{matrix.build_configuration_suffix}} ExcelOpsTest/bin/${{env.BUILD_CONFIGURATION}}${{matrix.build_configuration_suffix}}/net8.0/CompuMaster.Excel.Test.dll
- name: Run Unit Tests CompuMaster.Excel.TestFreeSpireXls.dll
run: dotnet test --framework net8.0 --results-directory test-results-CompuMaster.Excel.TestFreeSpireXls.dll --logger junit --configuration=${{env.BUILD_CONFIGURATION}}${{matrix.build_configuration_suffix}} ExcelOpsTest-FreeSpireXls/bin/${{env.BUILD_CONFIGURATION}}${{matrix.build_configuration_suffix}}/net8.0/CompuMaster.Excel.TestFreeSpireXls.dll
- name: Run Unit Tests CompuMaster.Excel.TestSpireXls.dll
run: dotnet test --framework net8.0 --results-directory test-results-CompuMaster.Excel.TestSpireXls.dll --logger junit --configuration=${{env.BUILD_CONFIGURATION}}${{matrix.build_configuration_suffix}} ExcelOpsTest-SpireXls/bin/${{env.BUILD_CONFIGURATION}}${{matrix.build_configuration_suffix}}/net8.0/CompuMaster.Excel.TestSpireXls.dll
#- name: Dir Listing (Win) test-results
# if: startsWith(matrix.os, 'windows')
# run: dir test-results
#- name: Dir Listing (Linux/Mac) test-results
# if: (!startsWith(matrix.os, 'windows'))
# run: ls -la test-results
#Following lines maybe required again after test&dev?!
# # the action is useless on pull_request events
# # (it can not create check runs or pull request comments)
# if: always() #&& startsWith(matrix.os, 'ubuntu') #&& github.event_name != 'pull_request'
#- name: Unit Test Results (Linux)
# uses: EnricoMi/publish-unit-test-result-action@v2
# if: always() && startsWith(matrix.os, 'ubuntu')
# with:
# github_token: ${{ secrets.GITHUB_TOKEN }}
# files: "test-results/TestResults.xml"
# check_run_annotations: all tests
# comment_title: Unit Test Statistics (${{matrix.os}})
# check_name: Unit Test Results (${{matrix.os}})
# report_individual_runs: true
#- name: Unit Test Results (Win/Mac)
# uses: EnricoMi/publish-unit-test-result-action/composite@v2
# if: always() && (!(startsWith(matrix.os, 'ubuntu')))
# with:
# github_token: ${{ secrets.GITHUB_TOKEN }}
# files: "test-results/TestResults.xml"
# check_run_annotations: all tests
# comment_title: Unit Test Statistics (${{matrix.os}})
# check_name: Unit Test Results (${{matrix.os}})
# report_individual_runs: true
- name: Unit Test Results (Linux) CompuMaster.MsExcelComInteropTest.dll
uses: EnricoMi/publish-unit-test-result-action@v2
if: always() && startsWith(matrix.os, 'ubuntu')
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
files: "test-results-CompuMaster.MsExcelComInteropTest.dll/TestResults.xml"
check_run_annotations: all tests
comment_title: Unit Test Statistics (${{matrix.os}}) CompuMaster.MsExcelComInteropTest.dll
check_name: Unit Test Results (${{matrix.os}}) CompuMaster.MsExcelComInteropTest.dll
report_individual_runs: true
- name: Unit Test Results (Win/Mac) CompuMaster.MsExcelComInteropTest.dll
uses: EnricoMi/publish-unit-test-result-action/composite@v2
if: always() && (!(startsWith(matrix.os, 'ubuntu')))
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
files: "test-results-CompuMaster.MsExcelComInteropTest.dll/TestResults.xml"
check_run_annotations: all tests
comment_title: Unit Test Statistics (${{matrix.os}}) CompuMaster.MsExcelComInteropTest.dll
check_name: Unit Test Results (${{matrix.os}}) CompuMaster.MsExcelComInteropTest.dll
report_individual_runs: true
- name: Unit Test Results (Linux) CompuMaster.Excel.Test.dll
uses: EnricoMi/publish-unit-test-result-action@v2
if: always() && startsWith(matrix.os, 'ubuntu')
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
files: "test-results-CompuMaster.Excel.Test.dll/TestResults.xml"
check_run_annotations: all tests
comment_title: Unit Test Statistics (${{matrix.os}}) CompuMaster.Excel.Test.dll
check_name: Unit Test Results (${{matrix.os}}) CompuMaster.Excel.Test.dll
report_individual_runs: true
- name: Unit Test Results (Win/Mac) CompuMaster.Excel.Test.dll
uses: EnricoMi/publish-unit-test-result-action/composite@v2
if: always() && (!(startsWith(matrix.os, 'ubuntu')))
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
files: "test-results-CompuMaster.Excel.Test.dll/TestResults.xml"
check_run_annotations: all tests
comment_title: Unit Test Statistics (${{matrix.os}}) CompuMaster.Excel.Test.dll
check_name: Unit Test Results (${{matrix.os}}) CompuMaster.Excel.Test.dll
report_individual_runs: true
- name: Unit Test Results (Linux) CompuMaster.Excel.TestFreeSpireXls.dll
uses: EnricoMi/publish-unit-test-result-action@v2
if: always() && startsWith(matrix.os, 'ubuntu')
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
files: "test-results-CompuMaster.Excel.TestFreeSpireXls.dll/TestResults.xml"
check_run_annotations: all tests
comment_title: Unit Test Statistics (${{matrix.os}}) CompuMaster.Excel.TestFreeSpireXls.dll
check_name: Unit Test Results (${{matrix.os}}) CompuMaster.Excel.TestFreeSpireXls.dll
report_individual_runs: true
- name: Unit Test Results (Win/Mac) CompuMaster.Excel.TestFreeSpireXls.dll
uses: EnricoMi/publish-unit-test-result-action/composite@v2
if: always() && (!(startsWith(matrix.os, 'ubuntu')))
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
files: "test-results-CompuMaster.Excel.TestFreeSpireXls.dll/TestResults.xml"
check_run_annotations: all tests
comment_title: Unit Test Statistics (${{matrix.os}}) CompuMaster.Excel.TestFreeSpireXls.dll
check_name: Unit Test Results (${{matrix.os}}) CompuMaster.Excel.TestFreeSpireXls.dll
report_individual_runs: true
- name: Unit Test Results (Linux) CompuMaster.Excel.TestSpireXls.dll
uses: EnricoMi/publish-unit-test-result-action@v2
if: always() && startsWith(matrix.os, 'ubuntu')
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
files: "test-results-CompuMaster.Excel.TestSpireXls.dll/TestResults.xml"
check_run_annotations: all tests
comment_title: Unit Test Statistics (${{matrix.os}}) CompuMaster.Excel.TestSpireXls.dll
check_name: Unit Test Results (${{matrix.os}}) CompuMaster.Excel.TestSpireXls.dll
report_individual_runs: true
- name: Unit Test Results (Win/Mac) CompuMaster.Excel.TestSpireXls.dll
uses: EnricoMi/publish-unit-test-result-action/composite@v2
if: always() && (!(startsWith(matrix.os, 'ubuntu')))
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
files: "test-results-CompuMaster.Excel.TestSpireXls.dll/TestResults.xml"
check_run_annotations: all tests
comment_title: Unit Test Statistics (${{matrix.os}}) CompuMaster.Excel.TestSpireXls.dll
check_name: Unit Test Results (${{matrix.os}}) CompuMaster.Excel.TestSpireXls.dll
report_individual_runs: true
#- name: Publish Unit Test Results
# uses: actions/upload-artifact@v4
# if: always()
# with:
# name: NUnit Test Results ${{ matrix.os }}
# path: test-results/TestResults.xml
- name: Publish Unit Test Results CompuMaster.MsExcelComInteropTest.dll
uses: actions/upload-artifact@v4
if: always()
with:
name: NUnit Test Results ${{ matrix.os }} - CompuMaster.MsExcelComInteropTest
path: "test-results-CompuMaster.MsExcelComInteropTest.dll/TestResults.xml"
- name: Publish Unit Test Results CompuMaster.Excel.Test.dll
uses: actions/upload-artifact@v4
if: always()
with:
name: NUnit Test Results ${{ matrix.os }} - CompuMaster.Excel.Test
path: "test-results-CompuMaster.Excel.Test.dll/TestResults.xml"
- name: Publish Unit Test Results CompuMaster.Excel.TestFreeSpireXls.dll
uses: actions/upload-artifact@v4
if: always()
with:
name: NUnit Test Results ${{ matrix.os }} - CompuMaster.Excel.TestFreeSpireXls
path: "test-results-CompuMaster.Excel.TestFreeSpireXls.dll/TestResults.xml"
- name: Publish Unit Test Results CompuMaster.Excel.TestSpireXls.dll
uses: actions/upload-artifact@v4
if: always()
with:
name: NUnit Test Results ${{ matrix.os }} - CompuMaster.Excel.TestSpireXls
path: "test-results-CompuMaster.Excel.TestSpireXls.dll/TestResults.xml"