-
Notifications
You must be signed in to change notification settings - Fork 93
320 lines (276 loc) · 10.5 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
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
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
name: ci
on:
push:
branches: [ main ]
pull_request:
merge_group:
workflow_dispatch:
env:
NUGET_PACKAGES: ${{ github.workspace }}/packages
DOTNET_CLI_TELEMETRY_OPTOUT: 1
jobs:
build-container:
uses: ./.github/workflows/build-container.yml
build-centos-native:
uses: ./.github/workflows/build-centos-native-container.yml
build:
needs: build-centos-native
uses: ./.github/workflows/build.yml
build-nuget-packages:
needs: [ build, build-container ]
uses: ./.github/workflows/build-nuget-packages.yml
test-build-managed:
needs: build
strategy:
fail-fast: false
matrix:
test-tfm: [ net8.0, net7.0, net6.0, net462 ]
machine: [ windows-2022, ubuntu-20.04, macos-12, otel-linux-arm64 ]
exclude:
- test-tfm: net462
machine: macos-12
- test-tfm: net462
machine: ubuntu-20.04
- test-tfm: net462
machine: otel-linux-arm64
include:
- machine: windows-2022
containers: none
- machine: ubuntu-20.04
containers: linux
- machine: macos-12
containers: none
- machine: otel-linux-arm64
containers: linux
runs-on: ${{ matrix.machine }}
steps:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # tag: v4.1.7
with:
fetch-depth: 0 # fetching all, needed to correctly calculate version
- name: Setup ARM64 Environment Variables
if: ${{ matrix.machine == 'otel-linux-arm64' }}
run: |
echo "DOTNET_INSTALL_DIR=~/.dotnet" >> $GITHUB_ENV
- name: Setup .NET
uses: actions/setup-dotnet@6bd8b7f7774af54e05809fcc5431931b3eb1ddee # tag: v4.0.1
with:
dotnet-version: |
6.0.425
7.0.410
8.0.401
- name: Check for NuGet packages cache
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # tag: v4.0.2
id: nuget-cache
with:
key: ${{ hashFiles('**/Directory.packages.props', './build/LibraryVersions.g.cs', '**/packages.config' ) }}
path: ${{ env.NUGET_PACKAGES }}
- name: Download Artifacts from build job
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # tag: v4.1.8
with:
name: bin-${{ matrix.machine }}
path: bin/tracer-home
- name: Install SQL Server (localdb)
if: ${{ runner.os == 'Windows' }}
uses: potatoqualitee/mssqlsuite@9a0136e208df60b8ecb62909f076bc34854fa55a # tag: v1.7
with:
install: localdb
- name: Setup ARM64 Machine
if: ${{ matrix.machine == 'otel-linux-arm64' }}
run: |
sudo apt-get update && \
sudo apt-get install -y \
cmake \
clang \
make
- name: Run TestWorkflow
run: ./build.cmd --skip NativeTests --target TestWorkflow --test-target-framework ${{ matrix.test-tfm }} --containers ${{ matrix.containers }}
- name: Upload test logs
if: always()
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # tag: v4.4.0
with:
name: test-logs-${{ matrix.machine }}-${{ matrix.test-tfm }}-containers-${{ matrix.containers }}
path: test-artifacts/
- name: Delete SQL Server MSI
if: ${{ runner.os == 'Windows' }}
shell: bash
run: rm SqlLocalDB.msi
test-build-native:
needs: build
strategy:
fail-fast: false
matrix:
machine: [ windows-2022 ]
runs-on: ${{ matrix.machine }}
steps:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # tag: v4.1.7
with:
fetch-depth: 0 # fetching all, needed to correctly calculate version
- name: Setup .NET
uses: actions/setup-dotnet@6bd8b7f7774af54e05809fcc5431931b3eb1ddee # tag: v4.0.1
with:
dotnet-version: |
6.0.425
7.0.410
8.0.401
- name: Check for NuGet packages cache
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # tag: v4.0.2
id: nuget-cache
with:
key: ${{ hashFiles('**/Directory.packages.props', './build/LibraryVersions.g.cs', '**/packages.config' ) }}
path: ${{ env.NUGET_PACKAGES }}
- name: Download Artifacts from build job
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # tag: v4.1.8
with:
name: bin-${{ matrix.machine }}
path: bin/tracer-home
- name: Run NativeTests
run: ./build.cmd NativeTests
test-build-windows-container-tests:
needs: build
strategy:
fail-fast: false
matrix:
include:
- machine: windows-2022
containers: windows-only
runs-on: ${{ matrix.machine }}
steps:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # tag: v4.1.7
with:
fetch-depth: 0 # fetching all, needed to correctly calculate version
- name: Setup .NET
uses: actions/setup-dotnet@6bd8b7f7774af54e05809fcc5431931b3eb1ddee # tag: v4.0.1
with:
dotnet-version: |
6.0.425
7.0.410
8.0.401
- name: Check for NuGet packages cache
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # tag: v4.0.2
id: nuget-cache
with:
key: ${{ hashFiles('**/Directory.packages.props', './build/LibraryVersions.g.cs', '**/packages.config' ) }}
path: ${{ env.NUGET_PACKAGES }}
- name: Download Artifacts from build job
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # tag: v4.1.8
with:
name: bin-${{ matrix.machine }}
path: bin/tracer-home
- name: Build artifacts required for the test (no native tests)
run: ./build.cmd --skip RunManagedTests --target ManagedTests --containers ${{ matrix.containers }}
- name: Run the integration tests
run: ./build.cmd --target RunManagedIntegrationTests --containers ${{ matrix.containers }}
- name: Upload test logs
if: always()
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # tag: v4.4.0
with:
name: test-logs-${{ matrix.machine }}-containers-${{ matrix.containers }}
path: test-artifacts/
test-build-container:
needs: [build, build-container]
strategy:
fail-fast: false
matrix:
include:
- machine: ubuntu-20.04
base-image: alpine
build-source: alpine-x64
os-type: linux-musl
- machine: ubuntu-20.04
base-image: centos
build-source: ubuntu-20.04
os-type: linux-glibc
- machine: ubuntu-20.04
base-image: debian
build-source: ubuntu-20.04
os-type: linux-glibc
- machine: otel-linux-arm64
base-image: alpine
build-source: alpine-arm64
os-type: linux-musl
- machine: otel-linux-arm64
base-image: debian-arm64
build-source: otel-linux-arm64
os-type: linux-glibc
runs-on: ${{ matrix.machine }}
timeout-minutes: 60
steps:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # tag: v4.1.7
with:
fetch-depth: 0 # fetching all, needed to correctly calculate version
- name: Download Artifacts from build job
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # tag: v4.1.8
with:
name: bin-${{ matrix.build-source }}
path: bin/tracer-home
- name: Build in Docker container
run: |
set -e
docker build -t mybuildimage -f "./docker/${{ matrix.base-image }}.dockerfile" ./docker
docker run -e OS_TYPE=${{ matrix.os-type }} --rm --mount type=bind,source="${GITHUB_WORKSPACE}",target=/project mybuildimage \
/bin/sh -c 'git config --global --add safe.directory /project && ./build.sh TestWorkflow --containers none'
test-nuget-packages:
needs: build-nuget-packages
strategy:
fail-fast: false
matrix:
include:
- machine: ubuntu-20.04
- machine: macos-12
- machine: windows-2022
- machine: otel-linux-arm64
runs-on: ${{ matrix.machine }}
steps:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # tag: v4.1.7
with:
fetch-depth: 0 # fetching all, needed to correctly calculate version
- name: Setup ARM64 Environment Variables
if: ${{ matrix.machine == 'otel-linux-arm64' }}
run: |
echo "DOTNET_INSTALL_DIR=~/.dotnet" >> $GITHUB_ENV
- name: Setup .NET
uses: actions/setup-dotnet@6bd8b7f7774af54e05809fcc5431931b3eb1ddee # tag: v4.0.1
with:
dotnet-version: |
6.0.425
7.0.410
8.0.401
- name: Check for NuGet packages cache
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # tag: v4.0.2
id: nuget-cache
with:
key: ${{ hashFiles('**/Directory.packages.props', './build/LibraryVersions.g.cs', '**/packages.config' ) }}
path: ${{ env.NUGET_PACKAGES }}
- name: Download NuGet Artifacts from build-nuget-packages job
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # tag: v4.1.8
with:
name: bin-nuget-packages
path: bin/nuget-artifacts/
- name: Test NuGet Packages
run: ./build.cmd TestNuGetPackages
test-jobs:
runs-on: ubuntu-20.04
needs:
- test-build-managed
- test-build-native
- test-build-container
- test-nuget-packages
- test-build-windows-container-tests
steps:
- name: Test if test jobs passed
run: |
echo ${{ needs.test-build-managed.result }}
test ${{ needs.test-build-managed.result }} == "success"
echo ${{ needs.test-build-native.result }}
test ${{ needs.test-build-native.result }} == "success"
echo ${{ needs.test-build-container.result }}
test ${{ needs.test-build-container.result }} == "success"
echo ${{ needs.test-nuget-packages.result }}
test ${{ needs.test-nuget-packages.result }} == "success"
echo ${{ needs.test-build-windows-container-tests.result }}
test ${{ needs.test-build-windows-container-tests.result }} == "success"