-
Notifications
You must be signed in to change notification settings - Fork 93
218 lines (206 loc) · 6.97 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
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:
uses: ./.github/workflows/build.yml
build-container:
uses: ./.github/workflows/build-container.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: [ net7.0, net6.0, net462 ]
machine: [ windows-2022, ubuntu-20.04, macos-11 ]
exclude:
- test-tfm: net462
machine: macos-11
- test-tfm: net462
machine: ubuntu-20.04
include:
- machine: windows-2022
containers: none
- machine: ubuntu-20.04
containers: linux
- machine: macos-11
containers: none
runs-on: ${{ matrix.machine }}
steps:
- uses: actions/[email protected]
with:
fetch-depth: 0 # fetching all, needed to correctly calculate version
- uses: actions/[email protected]
with:
dotnet-version: |
6.0.413
7.0.400
- name: Check for NuGet packages cache
uses: actions/[email protected]
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/[email protected]
with:
name: bin-${{ matrix.machine }}
path: bin/tracer-home
- name: Install SQL Server (localdb)
uses: potatoqualitee/[email protected]
if: ${{ runner.os == 'Windows' }}
with:
install: localdb
- run: ./build.cmd --skip NativeTests --target TestWorkflow --test-target-framework ${{ matrix.test-tfm }} --containers ${{ matrix.containers }}
- name: Upload test logs
uses: actions/[email protected]
if: always()
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:
- uses: actions/[email protected]
with:
fetch-depth: 0 # fetching all, needed to correctly calculate version
- uses: actions/[email protected]
with:
dotnet-version: |
6.0.413
7.0.400
- name: Check for NuGet packages cache
uses: actions/[email protected]
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/[email protected]
with:
name: bin-${{ matrix.machine }}
path: bin/tracer-home
- 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:
- uses: actions/[email protected]
with:
fetch-depth: 0 # fetching all, needed to correctly calculate version
- uses: actions/[email protected]
with:
dotnet-version: |
6.0.413
7.0.400
- name: Check for NuGet packages cache
uses: actions/[email protected]
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/[email protected]
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
uses: actions/[email protected]
if: always()
with:
name: test-logs-${{ matrix.machine }}-containers-${{ matrix.containers }}
path: test-artifacts/
test-build-container:
needs: build-container
strategy:
fail-fast: false
matrix:
include:
- base-image: alpine
build-source: alpine
os-type: linux-musl
- base-image: centos
build-source: centos
os-type: linux-glibc
- base-image: debian
build-source: centos
os-type: linux-glibc
runs-on: ubuntu-20.04
timeout-minutes: 60
steps:
- uses: actions/[email protected]
with:
fetch-depth: 0 # fetching all, needed to correctly calculate version
- name: Download Artifacts from build job
uses: actions/[email protected]
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-11
- machine: windows-2022
runs-on: ${{ matrix.machine }}
steps:
- uses: actions/[email protected]
with:
fetch-depth: 0 # fetching all, needed to correctly calculate version
- uses: actions/[email protected]
with:
dotnet-version: |
6.0.413
7.0.400
- name: Check for NuGet packages cache
uses: actions/[email protected]
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/[email protected]
with:
name: bin-nuget-packages
path: bin/nuget-artifacts/
- name: Test NuGet Packages
run: ./build.cmd TestNuGetPackages