-
Notifications
You must be signed in to change notification settings - Fork 93
331 lines (315 loc) · 12.8 KB
/
build.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
321
322
323
324
325
326
327
328
329
330
331
name: Build and Test
on:
push:
branches: ["**"]
tags: [v**]
paths:
- .github/workflows/*.yml
- build_tooling/**
- cpp/**
- python/**
- setup.*
- pyproject.toml
workflow_dispatch:
inputs:
persistent_storage:
description: Run the persistent storage tests
type: boolean
pypi_publish:
type: boolean
publish_env:
description: Environment to publish to
type: environment
cmake_preset_type:
description: Override CMAKE preset type
type: choice
options: ["-", debug, release]
run-name: Building ${{github.ref_name}} on ${{github.event_name}} by ${{github.actor}}
concurrency:
group: ${{github.ref}}
cancel-in-progress: true
jobs:
cibw_docker_image:
uses: ./.github/workflows/cibw_docker_image.yml
permissions: {packages: write}
with:
cibuildwheel_ver: "2.12.1"
force_update: false
common_config:
needs: [cibw_docker_image]
runs-on: ubuntu-latest
strategy:
matrix:
include:
# Use a matrix to build the common hierarchical structure used by multiple matrix jobs in build_steps.yaml
# Please declare any key you added below in build_steps.yaml's dummy matrix as well to aid the linting tools
- linux_matrix:
- os: linux
distro: ubuntu-latest
cmake_preset_prefix: linux
cibw_build_suffix: manylinux_x86_64
build_dir: /tmp/cpp_build
vcpkg_packages_dir: ""
symbols: "*.gz" # Please update publish.yml when changing this!!
do_not_archive: ["*.so", "*.[ao]", "vcpkg_installed"]
test_services:
mongodb:
image: "mongo:4.4"
mongodb_2:
image: "mongo:4.4"
container:
image: ${{needs.cibw_docker_image.outputs.tag}}
volumes:
- /:/mnt
windows_matrix:
- os: windows
distro: windows-latest
cmake_preset_prefix: windows-cl
cibw_build_suffix: win_amd64
build_dir: C:/cpp_build
vcpkg_packages_dir: C:/vcpkg_packages
symbols: "*.pdb" # Please update publish.yml when changing this!!
do_not_archive: ["*.lib", "*.ilk", "*.pyd", "*.dll", "CMakeFiles/*.dir", "vcpkg_installed"]
test_services: {}
container: null
steps:
- run: |
if ${{startsWith(github.ref, 'refs/tags/v')}}; then
# Can only upload to Pypi once per version, so only auto upload on tag builds:
echo -e "PUBLISH_ENV=ProdPypi\nCMAKE_PRESET_TYPE=release\nPYPI_PUBLISH=1" | tee -a $GITHUB_ENV
elif $GITHUB_REF_PROTECTED || ${{github.ref == 'refs/heads/master'}} ; then
echo -e "PUBLISH_ENV=TestPypi\nCMAKE_PRESET_TYPE=release" | tee -a $GITHUB_ENV
else
echo -e "PUBLISH_ENV=${{vars.DEFAULT_PUBLISH_ENV}}\nCMAKE_PRESET_TYPE=$DEFAULT_PRESET" | tee -a $GITHUB_ENV
fi
env:
DEFAULT_PRESET: ${{startsWith(github.repository, 'man-group/ArcticDB') && 'release' || vars.DEFAULT_CMAKE_PRESET_TYPE || 'debug'}}
outputs:
cibuildwheel_ver: ${{needs.cibw_docker_image.outputs.cibuildwheel_ver}}
publish_env: ${{inputs.publish_env || env.PUBLISH_ENV || ''}}
pypi_publish: ${{inputs.pypi_publish || env.PYPI_PUBLISH}}
cmake_preset_type_resolved: ${{inputs.cmake_preset_type != '-' && inputs.cmake_preset_type || env.CMAKE_PRESET_TYPE}}
linux_matrix: ${{toJson(matrix.linux_matrix)}}
windows_matrix: ${{toJson(matrix.windows_matrix)}}
pre_seed_cleanup:
if: inputs.persistent_storage == true
name: Cleanup persistent storages
uses: ./.github/workflows/persistent_storage.yml
secrets: inherit
with:
job_type: cleanup
persistent_storage_seed_linux:
needs: [common_config, pre_seed_cleanup]
if: inputs.persistent_storage == true
strategy:
fail-fast: false
matrix:
python3: ${{fromJson(vars.LINUX_PYTHON_VERSIONS || '[6, 7, 8, 9, 10, 11]')}}
arcticdb_version: ["oldest", "latest"]
include:
- python_deps_ids: [""]
matrix_override: ${{fromJson(needs.common_config.outputs.linux_matrix)}}
name: Seed Persistent Storage for 3.${{matrix.python3}} Linux with ${{ matrix.arcticdb_version }} ArcticDB package version
uses: ./.github/workflows/persistent_storage.yml
secrets: inherit
permissions: {packages: write}
with:
job_type: seed
python3: ${{matrix.python3}}
arcticdb_version: ${{matrix.arcticdb_version}}
matrix: ${{toJson(matrix.matrix_override)}}
python_deps_ids: ${{toJson(matrix.python_deps_ids)}}
persistent_storage_seed_windows:
needs: [common_config, pre_seed_cleanup]
if: inputs.persistent_storage == true
strategy:
fail-fast: false
matrix:
python3: ${{fromJson(vars.WINDOWS_PYTHON_VERSIONS || '[7, 8, 9, 10, 11]')}}
arcticdb_version: ["oldest", "latest"]
include:
- python_deps_ids: [""]
matrix_override: ${{fromJson(needs.common_config.outputs.windows_matrix)}}
name: Seed Persistent Storage for 3.${{matrix.python3}} Windows with ${{ matrix.arcticdb_version }} ArcticDB package version
uses: ./.github/workflows/persistent_storage.yml
secrets: inherit
permissions: {packages: write}
with:
job_type: seed
python3: ${{matrix.python3}}
arcticdb_version: ${{matrix.arcticdb_version}}
matrix: ${{toJson(matrix.matrix_override)}}
python_deps_ids: ${{toJson(matrix.python_deps_ids)}}
leader-compile-linux:
# First do the C++ core compilation using one Python version to seed the compilation caches (and fail quicker)
needs: [cibw_docker_image, common_config]
name: Linux Compile
uses: ./.github/workflows/build_steps.yml
secrets: inherit
permissions: {packages: write}
with:
job_type: leader-compile
cmake_preset_type: ${{needs.common_config.outputs.cmake_preset_type_resolved}}
cibw_image_tag: ${{needs.cibw_docker_image.outputs.tag}}
matrix: ${{needs.common_config.outputs.linux_matrix}}
leader-cpp-test-linux:
# Compile and run the C++ tests separately concurrently with the following job
needs: [leader-compile-linux, cibw_docker_image, common_config]
name: Linux C++ Tests
uses: ./.github/workflows/build_steps.yml
secrets: inherit
with:
job_type: cpp-tests
cmake_preset_type: ${{needs.common_config.outputs.cmake_preset_type_resolved}}
cibw_image_tag: ${{needs.cibw_docker_image.outputs.tag}}
matrix: ${{needs.common_config.outputs.linux_matrix}}
follower-linux:
# Then use the cached compilation artifacts to build other python versions concurrently in cibuildwheels
needs: [leader-compile-linux, cibw_docker_image, common_config]
strategy:
fail-fast: false
matrix:
python3: ${{fromJson(vars.LINUX_PYTHON_VERSIONS || '[6, 7, 8, 9, 10, 11]')}}
include:
- python_deps_ids: [""]
matrix_override: ${{fromJson(needs.common_config.outputs.linux_matrix)}}
- python3: 6
python_deps_ids: ["", -compat36]
matrix_override:
- ${{fromJson(needs.common_config.outputs.linux_matrix)[0]}}
- python_deps_id: -compat36
python_deps: requirements-compatibility-py36.txt
- python3: 8
python_deps_ids: ["", -compat38]
matrix_override:
- ${{fromJson(needs.common_config.outputs.linux_matrix)[0]}}
- python_deps_id: -compat38
python_deps: requirements-compatibility-py38.txt
name: 3.${{matrix.python3}} Linux
uses: ./.github/workflows/build_steps.yml
secrets: inherit
permissions: {packages: write}
with:
job_type: follower
python3: ${{matrix.python3}}
cibw_image_tag: ${{needs.cibw_docker_image.outputs.tag}}
cibw_version: ${{needs.common_config.outputs.cibuildwheel_ver}}
cmake_preset_type: ${{needs.common_config.outputs.cmake_preset_type_resolved}}
matrix: ${{toJson(matrix.matrix_override)}}
python_deps_ids: ${{toJson(matrix.python_deps_ids)}}
persistent_storage: ${{inputs.persistent_storage}}
leader-compile-windows:
needs: [common_config]
name: Windows Compile
uses: ./.github/workflows/build_steps.yml
secrets: inherit
permissions: {packages: write}
with:
job_type: leader-compile
cmake_preset_type: ${{needs.common_config.outputs.cmake_preset_type_resolved}}
matrix: ${{needs.common_config.outputs.windows_matrix}}
leader-cpp-test-windows:
needs: [leader-compile-windows, common_config]
name: Windows C++ Tests
uses: ./.github/workflows/build_steps.yml
secrets: inherit
with:
job_type: cpp-tests
cmake_preset_type: ${{needs.common_config.outputs.cmake_preset_type_resolved}}
matrix: ${{needs.common_config.outputs.windows_matrix}}
follower-windows:
needs: [leader-compile-windows, common_config]
strategy:
fail-fast: false
matrix:
python3: ${{fromJson(vars.WINDOWS_PYTHON_VERSIONS || '[7, 8, 9, 10, 11]')}}
name: 3.${{matrix.python3}} Windows
uses: ./.github/workflows/build_steps.yml
secrets: inherit
permissions: {packages: write}
with:
job_type: follower
python3: ${{matrix.python3}}
cibw_version: ${{needs.common_config.outputs.cibuildwheel_ver}}
cmake_preset_type: ${{needs.common_config.outputs.cmake_preset_type_resolved}}
matrix: ${{needs.common_config.outputs.windows_matrix}}
persistent_storage: ${{ inputs.persistent_storage }}
persistent_storage_verify_linux:
needs: [common_config, follower-linux, follower-windows]
if: inputs.persistent_storage == true
strategy:
fail-fast: false
matrix:
python3: ${{fromJson(vars.LINUX_PYTHON_VERSIONS || '[6, 7, 8, 9, 10, 11]')}}
arcticdb_version: ["oldest", "latest"]
include:
- python_deps_ids: [""]
matrix_override: ${{fromJson(needs.common_config.outputs.linux_matrix)}}
name: Verify Persistent Storage for 3.${{matrix.python3}} Linux with ${{ matrix.arcticdb_version }} ArcticDB package version
uses: ./.github/workflows/persistent_storage.yml
secrets: inherit
permissions: {packages: write}
with:
job_type: verify
python3: ${{matrix.python3}}
arcticdb_version: ${{matrix.arcticdb_version}}
matrix: ${{toJson(matrix.matrix_override)}}
python_deps_ids: ${{toJson(matrix.python_deps_ids)}}
persistent_storage_verify_windows:
needs: [common_config, follower-windows, follower-linux]
if: inputs.persistent_storage == true
strategy:
fail-fast: false
matrix:
python3: ${{fromJson(vars.WINDOWS_PYTHON_VERSIONS || '[7, 8, 9, 10, 11]')}}
arcticdb_version: ["oldest", "latest"]
include:
- python_deps_ids: [""]
matrix_override: ${{fromJson(needs.common_config.outputs.windows_matrix)}}
name: Verify Persistent Storage for 3.${{matrix.python3}} Windows with ${{ matrix.arcticdb_version }} ArcticDB package version
uses: ./.github/workflows/persistent_storage.yml
secrets: inherit
permissions: {packages: write}
with:
job_type: verify
python3: ${{matrix.python3}}
arcticdb_version: ${{matrix.arcticdb_version}}
matrix: ${{toJson(matrix.matrix_override)}}
python_deps_ids: ${{toJson(matrix.python_deps_ids)}}
post_verify_cleanup:
needs: [persistent_storage_verify_windows, persistent_storage_verify_linux]
if: inputs.persistent_storage == true
name: Cleanup persistent storages
uses: ./.github/workflows/persistent_storage.yml
secrets: inherit
with:
job_type: cleanup
can_merge:
needs: [leader-cpp-test-linux, leader-cpp-test-windows, follower-linux, follower-windows, persistent_storage_verify_linux, persistent_storage_verify_windows]
if: |
always() &&
!failure() &&
!cancelled()
runs-on: ubuntu-latest
steps:
- run: echo Dummy job to simplify PR merge checks configuration
# FUTURE: add some test stats/reporting
publish:
needs: [common_config, can_merge]
if: |
always() &&
!failure() &&
!cancelled() &&
(needs.common_config.outputs.pypi_publish && needs.common_config.outputs.publish_env)
uses: ./.github/workflows/publish.yml
secrets: inherit
permissions: {contents: write}
with:
environment: ${{needs.common_config.outputs.publish_env}}
docs:
if: ${{ false }}
needs: [common_config, follower-linux] # Needs a Linux wheel to build the API docs
uses: ./.github/workflows/docs.yml
secrets: inherit
with:
environment: ${{needs.common_config.outputs.publish_env}}