forked from AcademySoftwareFoundation/openexr
-
Notifications
You must be signed in to change notification settings - Fork 0
492 lines (450 loc) · 18.7 KB
/
ci_workflow.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
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
# SPDX-License-Identifier: BSD-3-Clause
# Copyright (c) Contributors to the OpenEXR Project.
#
# GitHub Actions workflow file
# https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions
name: CI
# Run on all changes except:
# - doc file changes
# - changes to the website, *except* for "website/src", since that
# code needs validation. The website has a separate workflow
# - changes to the bazel config, since it has its own workflow
# - changes to the python bindings
# - changes to workflows other than this one
on:
push:
paths:
- '**'
- '!**.md'
- '!website/**'
- 'website/src/**'
- '!bazel/**'
- '!src/wrappers/**'
- '!.github/workflows/**'
- '.github/workflows/ci_workflow.yml'
pull_request:
paths:
- '**'
- '!**.md'
- '!website/**'
- 'website/src/**'
- '!bazel/**'
- '!src/wrappers/**'
- '!.github/workflows/**'
- '.github/workflows/ci_workflow.yml'
permissions:
contents: read
jobs:
# Linux jobs run in Docker containers, so the latest OS version is OK. macOS
# and Windows jobs need to be locked to specific virtual environment
# versions to mitigate issues from OS updates, and will require maintenance
# as OS versions are retired.
#
# GH Actions (Free plan) supports 20 concurrent jobs, with 5 concurrent macOS
# jobs. This workflow tries to utilize (but not exceed) that budget to
# promote timely CI.
# Each job validates that the proper files have been installed by
# checking the contents of CMake's install_manifest.txt file. The
# exact contents vary depending o the build options, so this
# validates both that the settings have the expected effect, and
# that the CMake configuration does what is expected. Each job
# compares to a version of the install_manifest.txt archived in
# share/ci/install_manifest with the expected context for that
# build.
# ---------------------------------------------------------------------------
# Linux
# ---------------------------------------------------------------------------
# TODO: Add ARM build. Add sanitize build.
linux:
if: false
name: '${{ matrix.build}}. Linux ${{ matrix.vfx-cy }}
${{ matrix.compiler-desc }}
C++${{ matrix.cxx-standard }}
${{ matrix.build-type }}
${{ matrix.label }}'
# GH-hosted VM. The build runs in CentOS 7 'container' defined below.
runs-on: ubuntu-latest
container:
# DockerHub: https://hub.docker.com/u/aswf
# Source: https://github.com/AcademySoftwareFoundation/aswf-docker
image: aswf/ci-openexr:${{ matrix.vfx-cy }}
strategy:
matrix:
build: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
include:
# defaults for the builds below
- vfx-cy: 2024
- compiler-desc: gcc11.2.1
- cxx-compiler: g++
- cc-compiler: gcc
- cxx-standard: 17
- build-type: Release
- BUILD_SHARED_LIBS: 'ON'
- OPENEXR_ENABLE_THREADING: 'ON'
- OPENEXR_INSTALL_PKG_CONFIG: 'ON'
- OPENEXR_INSTALL_DOCS: 'ON'
- OPENEXR_BUILD_EXAMPLES: 'ON'
- OPENEXR_BUILD_TOOLS: 'ON'
- OPENEXR_BUILD_PYTHON: 'OFF'
- OPENEXR_FORCE_INTERNAL_IMATH: 'OFF'
- OPENEXR_FORCE_INTERNAL_DEFLATE: 'OFF'
- BUILD_TESTING: 'OFF'
- build: 1
build-type: Debug
- build: 2
- build: 3
label: Static
BUILD_SHARED_LIBS: 'OFF'
- build: 4
label: threads=OFF
OPENEXR_ENABLE_THREADING: 'OFF'
- build: 5
label: pkgconfig=OFF, examples=OFF, tools=OFF, docs=OFF, internal deflate
OPENEXR_INSTALL_PKG_CONFIG: 'OFF'
OPENEXR_INSTALL_DOCS: 'OFF'
OPENEXR_BUILD_EXAMPLES: 'OFF'
OPENEXR_BUILD_TOOLS: 'OFF'
OPENEXR_FORCE_INTERNAL_IMATH: 'ON'
OPENEXR_FORCE_INTERNAL_DEFLATE: 'ON'
BUILD_TESTING: 'OFF'
- build: 6
compiler-desc: clang15.0
cxx-compiler: clang++
cc-compiler: clang
- build: 7
compiler-desc: clang14.0
cxx-compiler: clang++
cc-compiler: clang
- build: 8
vfx-cy: 2023
- build: 9
vfx-cy: 2022
compiler-desc: gcc9.3.1
- build: 10
vfx-cy: 2021
compiler-desc: gcc9.3.1
env:
CXX: ${{ matrix.cxx-compiler }}
CC: ${{ matrix.cc-compiler }}
ACTIONS_RUNNER_FORCE_ACTIONS_NODE_VERSION: node16
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
steps:
- name: Checkout
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
- name: Install Dependencies
run: |
share/ci/scripts/install_imath.sh main
share/ci/scripts/install_libdeflate.sh master
share/ci/scripts/linux/install_help2man.sh
- name: Create build directories
run: |
mkdir _install
mkdir _build
mkdir _examples
- name: Construct CMake command and save it to environment
run: |
# Save the cmake command, so it can be recorded in the install manifest below.
CMAKE_COMMAND="cmake -B _build -S . \
-DCMAKE_INSTALL_PREFIX=_install \
-DCMAKE_BUILD_TYPE=${{ matrix.build-type }} \
-DOPENEXR_CXX_STANDARD=${{ matrix.cxx-standard }} \
-DCMAKE_CXX_FLAGS='${{ matrix.cxx-flags }}' \
-DBUILD_SHARED_LIBS=${{ matrix.BUILD_SHARED_LIBS }} \
-DOPENEXR_ENABLE_THREADING=${{ matrix.OPENEXR_ENABLE_THREADING }} \
-DOPENEXR_INSTALL_PKG_CONFIG=${{ matrix.OPENEXR_INSTALL_PKG_CONFIG }} \
-DOPENEXR_INSTALL_DOCS=${{ matrix.OPENEXR_INSTALL_DOCS }} \
-DOPENEXR_BUILD_EXAMPLES=${{ matrix.OPENEXR_BUILD_EXAMPLES }} \
-DOPENEXR_BUILD_TOOLS=${{ matrix.OPENEXR_BUILD_TOOLS }} \
-DOPENEXR_BUILD_PYTHON=${{ matrix.OPENEXR_BUILD_PYTHON }} \
-DOPENEXR_FORCE_INTERNAL_IMATH=${{ matrix.OPENEXR_FORCE_INTERNAL_IMATH }} \
-DOPENEXR_FORCE_INTERNAL_DEFLATE=${{ matrix.OPENEXR_FORCE_INTERNAL_DEFLATE }} \
-DBUILD_TESTING=${{ matrix.BUILD_TESTING }} \
-DOPENEXR_RUN_FUZZ_TESTS='OFF' \
-DCMAKE_VERBOSE_MAKEFILE:BOOL='ON'"
echo "CMAKE_COMMAND=$CMAKE_COMMAND" >> $GITHUB_ENV
- name: Configure
run: $CMAKE_COMMAND
- name: Build
run: |
cmake --build _build \
--target install \
--config ${{ matrix.build-type }}
- name: Prepare install_manifest-<build#>.txt
run: |
# Put the full cmake command at the top of the install
# manifest, and remove the install prefix from the
# filenames. Also, substitute lib/ for lib64/, since that
# distinction is not significant for validation that the
# files have been installed correctly.
echo "# $CMAKE_COMMAND" > _build/install_manifest-${{ matrix.build }}.txt
sort _build/install_manifest.txt | sed -e "s:^.*/_install/::" -e ":lib64/:lib/:" >> _build/install_manifest-${{ matrix.build }}.txt
- name: Upload install_manifest-<build#>.txt
uses: actions/upload-artifact@v3
with:
name: install_manifest-${{ matrix.build }}
path: _build/install_manifest-${{ matrix.build }}.txt
- name: Validate install
run: |
# share/ci/scripts/linux/validate_openexr_libs.sh _install
share/ci/scripts/validate_install.py \
_build/install_manifest-${{ matrix.build }}.txt \
share/ci/install_manifest/install_manifest-${{ matrix.build }}.txt
- name: Test
run: |
echo ctest -T Test ${{ matrix.exclude-tests }} \
-C ${{ matrix.build-type }} \
--timeout 7200 \
--output-on-failure \
-VV
working-directory: _build
# ---------------------------------------------------------------------------
# macOS
# ---------------------------------------------------------------------------
# TODO: Add ARM64/x86_64 (universal 2) build
macOS:
if: false
name: '${{ matrix.build}}. macOS-${{ matrix.osver }} ${{ matrix.vfx-cy }}
${{ matrix.compiler-desc }}
C++${{ matrix.cxx-standard }}
${{ matrix.build-type }}
${{ matrix.label }}'
runs-on: macos-${{ matrix.osver }}
strategy:
matrix:
build: [1, 2, 3, 4, 5, 6]
include:
# defaults settings. These are inherited for each build below.
- vfx-cy: 2024
- osver: 12.0
- compiler-desc: AppleClang11.0
- cxx-standard: 17
- build-type: Release
- BUILD_SHARED_LIBS: 'ON'
- OPENEXR_ENABLE_THREADING: 'ON'
- OPENEXR_INSTALL_PKG_CONFIG: 'ON'
- OPENEXR_INSTALL_DOCS: 'ON'
- OPENEXR_BUILD_EXAMPLES: 'ON'
- OPENEXR_BUILD_TOOLS: 'ON'
- OPENEXR_BUILD_PYTHON: 'OFF'
- OPENEXR_FORCE_INTERNAL_IMATH: 'OFF'
- OPENEXR_FORCE_INTERNAL_DEFLATE: 'OFF'
- BUILD_TESTING: 'OFF'
- build: 1
build-type: Debug
- build: 2
- build: 3
label: Static
BUILD_SHARED_LIBS: 'OFF'
- build: 4
label: threads=OFF
OPENEXR_ENABLE_THREADING: 'OFF'
- build: 5
label: pkgconfig=OFF, examples=OFF, tools=OFF, docs=OFF, internal imath+deflate
OPENEXR_INSTALL_PKG_CONFIG: 'OFF'
OPENEXR_INSTALL_DOCS: 'OFF'
OPENEXR_BUILD_EXAMPLES: 'OFF'
OPENEXR_BUILD_TOOLS: 'OFF'
OPENEXR_FORCE_INTERNAL_IMATH: 'ON'
OPENEXR_FORCE_INTERNAL_DEFLATE: 'ON'
BUILD_TESTING: 'OFF'
- build: 6
osver: 11.0
steps:
- name: Checkout
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
- name: Install Dependencies
run: |
share/ci/scripts/install_imath.sh main
share/ci/scripts/install_libdeflate.sh master
share/ci/scripts/linux/install_help2man.sh
- name: Create build directories
run: |
mkdir _install
mkdir _build
mkdir _examples
- name: Construct CMake command and save it to environment
run: |
# Save the cmake command, so it can be recorded in the install manifest below.
CMAKE_COMMAND="cmake -B _build -S . \
-DCMAKE_INSTALL_PREFIX=_install \
-DCMAKE_BUILD_TYPE=${{ matrix.build-type }} \
-DOPENEXR_CXX_STANDARD=${{ matrix.cxx-standard }} \
-DCMAKE_CXX_FLAGS='${{ matrix.cxx-flags }}' \
-DBUILD_SHARED_LIBS=${{ matrix.BUILD_SHARED_LIBS }} \
-DOPENEXR_ENABLE_THREADING=${{ matrix.OPENEXR_ENABLE_THREADING }} \
-DOPENEXR_INSTALL_PKG_CONFIG=${{ matrix.OPENEXR_INSTALL_PKG_CONFIG }} \
-DOPENEXR_INSTALL_DOCS=${{ matrix.OPENEXR_INSTALL_DOCS }} \
-DOPENEXR_BUILD_EXAMPLES=${{ matrix.OPENEXR_BUILD_EXAMPLES }} \
-DOPENEXR_BUILD_TOOLS=${{ matrix.OPENEXR_BUILD_TOOLS }} \
-DOPENEXR_BUILD_PYTHON=${{ matrix.OPENEXR_BUILD_PYTHON }} \
-DOPENEXR_FORCE_INTERNAL_IMATH=${{ matrix.OPENEXR_FORCE_INTERNAL_IMATH }} \
-DOPENEXR_FORCE_INTERNAL_DEFLATE=${{ matrix.OPENEXR_FORCE_INTERNAL_DEFLATE }} \
-DBUILD_TESTING=${{ matrix.BUILD_TESTING }} \
-DOPENEXR_RUN_FUZZ_TESTS='OFF' \
-DCMAKE_VERBOSE_MAKEFILE:BOOL='ON'"
echo "CMAKE_COMMAND=$CMAKE_COMMAND" >> $GITHUB_ENV
- name: Configure
run: $CMAKE_COMMAND
- name: Build
run: |
cmake --build _build \
--target install \
--config ${{ matrix.build-type }}
- name: Prepare install_manifest-<build#>.txt
run: |
# Put the full cmake command at the top of the install
# manifest, and remove the install prefix from the
# filenames. Also, substitute lib/ for lib64/, since that
# distinction is not significant for validation that the
# files have been installed correctly.
echo "# $CMAKE_COMMAND" > _build/install_manifest-${{ matrix.build }}.txt
sort _build/install_manifest.txt | sed -e "s:^.*/_install/::" -e ":lib64/:lib/:" >> _build/install_manifest-${{ matrix.build }}.txt
- name: Upload install_manifest-<build#>.txt
uses: actions/upload-artifact@v3
with:
name: install_manifest-${{ matrix.build }}
path: _build/install_manifest-${{ matrix.build }}.txt
- name: Validate install
run: |
# share/ci/scripts/linux/validate_openexr_libs.sh _install
share/ci/scripts/validate_install.py \
_build/install_manifest-${{ matrix.build }}.txt \
share/ci/install_manifest/install_manifest-${{ matrix.build }}.txt
- name: Test
run: |
echo ctest -T Test ${{ matrix.exclude-tests }} \
-C ${{ matrix.build-type }} \
--timeout 7200 \
--output-on-failure \
-VV
working-directory: _build
Windows:
name: '${{ matrix.build}}. Windows-${{ matrix.osver }} ${{ matrix.vfx-cy }}
${{ matrix.compiler-desc }}
C++${{ matrix.cxx-standard }}
${{ matrix.build-type }}
${{ matrix.label }}'
runs-on: windows-${{ matrix.osver }}
strategy:
matrix:
build: [1, 2, 3, 4, 5, 6]
include:
# defaults settings. These are inherited for each build below.
- vfx-cy: 2023
- osver: 2022
- compiler-desc: msvc17.5
- cxx-standard: 17
- build-type: Release
- BUILD_SHARED_LIBS: 'ON'
- OPENEXR_ENABLE_THREADING: 'ON'
- OPENEXR_INSTALL_PKG_CONFIG: 'ON'
- OPENEXR_INSTALL_DOCS: 'ON'
- OPENEXR_BUILD_EXAMPLES: 'ON'
- OPENEXR_BUILD_TOOLS: 'ON'
- OPENEXR_BUILD_PYTHON: 'OFF'
- OPENEXR_FORCE_INTERNAL_IMATH: 'OFF'
- OPENEXR_FORCE_INTERNAL_DEFLATE: 'OFF'
- BUILD_TESTING: 'OFF'
- build: 1
build-type: Debug
- build: 2
- build: 3
label: Static
BUILD_SHARED_LIBS: 'OFF'
- build: 4
label: threads=OFF
OPENEXR_ENABLE_THREADING: 'OFF'
- build: 5
label: pkgconfig=OFF, examples=OFF, tools=OFF, docs=OFF, internal imath+deflate
OPENEXR_INSTALL_PKG_CONFIG: 'OFF'
OPENEXR_INSTALL_DOCS: 'OFF'
OPENEXR_BUILD_EXAMPLES: 'OFF'
OPENEXR_BUILD_TOOLS: 'OFF'
OPENEXR_FORCE_INTERNAL_IMATH: 'ON'
OPENEXR_FORCE_INTERNAL_DEFLATE: 'ON'
BUILD_TESTING: 'OFF'
- build: 6
vfx-cy: 2022
compiler-desc: msvc16.11
osver: 2019
- build: 6
vfx-cy: 2022
compiler-desc: msvc16.11
osver: 2019
BUILD_SHARED_LIBS: 'OFF'
steps:
- name: Checkout
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
- name: Install Dependencies
run: |
share/ci/scripts/install_imath.sh main
share/ci/scripts/install_libdeflate.sh master
share/ci/scripts/linux/install_help2man.sh
shell: bash
- name: Create build directories
run: |
mkdir _install
mkdir _build
mkdir _examples
shell: bash
- name: Construct CMake command and save it to environment
run: |
# Save the cmake command, so it can be recorded in the install manifest below.
CMAKE_COMMAND="cmake -B _build -S . \
-DCMAKE_INSTALL_PREFIX=_install \
-DCMAKE_BUILD_TYPE=${{ matrix.build-type }} \
-DOPENEXR_CXX_STANDARD=${{ matrix.cxx-standard }} \
-DCMAKE_CXX_FLAGS='${{ matrix.cxx-flags }}' \
-DBUILD_SHARED_LIBS=${{ matrix.BUILD_SHARED_LIBS }} \
-DOPENEXR_ENABLE_THREADING=${{ matrix.OPENEXR_ENABLE_THREADING }} \
-DOPENEXR_INSTALL_PKG_CONFIG=${{ matrix.OPENEXR_INSTALL_PKG_CONFIG }} \
-DOPENEXR_INSTALL_DOCS=${{ matrix.OPENEXR_INSTALL_DOCS }} \
-DOPENEXR_BUILD_EXAMPLES=${{ matrix.OPENEXR_BUILD_EXAMPLES }} \
-DOPENEXR_BUILD_TOOLS=${{ matrix.OPENEXR_BUILD_TOOLS }} \
-DOPENEXR_BUILD_PYTHON=${{ matrix.OPENEXR_BUILD_PYTHON }} \
-DOPENEXR_FORCE_INTERNAL_IMATH=${{ matrix.OPENEXR_FORCE_INTERNAL_IMATH }} \
-DOPENEXR_FORCE_INTERNAL_DEFLATE=${{ matrix.OPENEXR_FORCE_INTERNAL_DEFLATE }} \
-DBUILD_TESTING=${{ matrix.BUILD_TESTING }} \
-DOPENEXR_RUN_FUZZ_TESTS='OFF' \
-DCMAKE_VERBOSE_MAKEFILE:BOOL='ON'"
echo "CMAKE_COMMAND=$CMAKE_COMMAND" >> $GITHUB_ENV
shell: bash
- name: Configure
run: $CMAKE_COMMAND
shell: bash
- name: Build
run: |
cmake --build _build \
--target install \
--config ${{ matrix.build-type }}
shell: bash
- name: Prepare install_manifest-<build#>.txt
run: |
# Put the full cmake command at the top of the install
# manifest, and remove the install prefix from the
# filenames. Also, substitute lib/ for lib64/, since that
# distinction is not significant for validation that the
# files have been installed correctly.
echo "# $CMAKE_COMMAND" > _build/install_manifest-${{ matrix.build }}.txt
sort _build/install_manifest.txt | sed -e "s:^.*/_install/::" -e ":lib64/:lib/:" >> _build/install_manifest-${{ matrix.build }}.txt
- name: Upload install_manifest-<build#>.txt
uses: actions/upload-artifact@v3
with:
name: install_manifest-${{ matrix.build }}
path: _build/install_manifest-${{ matrix.build }}.txt
- name: Validate install
run: |
# share/ci/scripts/linux/validate_openexr_libs.sh _install
share/ci/scripts/validate_install.py \
_build/install_manifest-${{ matrix.build }}.txt \
share/ci/install_manifest/install_manifest-${{ matrix.build }}.txt
shell: bash
- name: Test
run: |
echo ctest -T Test ${{ matrix.exclude-tests }} \
-C ${{ matrix.build-type }} \
--timeout 7200 \
--output-on-failure \
-VV
shell: bash
working-directory: _build