Debian Codegraph @

.github/workflows/ci_workflow.yml

raw
1 # SPDX-License-Identifier: BSD-3-Clause
2 # Copyright (c) Contributors to the OpenEXR Project.
3 #
4 # GitHub Actions workflow file
5 # https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions
6
7 name: CI
8
9 # Run on all changes except:
10 # - doc file changes
11 # - changes to the website, since yhe website has a separate workflow
12 # - changes to workflows other than this one
13
14 on:
15 push:
16 paths:
17 - '**'
18 - '!**.md'
19 - '!website/**'
20 - '!.github/workflows/**'
21 - '.github/workflows/ci_workflow.yml'
22 pull_request:
23 paths:
24 - '**'
25 - '!**.md'
26 - '!website/**'
27 - '!.github/workflows/**'
28 - '.github/workflows/ci_workflow.yml'
29
30 permissions:
31 contents: read
32
33 jobs:
34 # Linux jobs run in Docker containers, so the latest OS version is OK. macOS
35 # and Windows jobs need to be locked to specific virtual environment
36 # versions to mitigate issues from OS updates, and will require maintenance
37 # as OS versions are retired.
38 #
39 # GH Actions (Free plan) supports 20 concurrent jobs, with 5 concurrent macOS
40 # jobs. This workflow tries to utilize (but not exceed) that budget to
41 # promote timely CI.
42
43 # ---------------------------------------------------------------------------
44 # Linux
45 # ---------------------------------------------------------------------------
46 # TODO: Add ARM build. Add sanitize build.
47
48 linux:
49 name: 'Linux CentOS 7 VFX CY${{ matrix.vfx-cy }}
50 <${{ matrix.compiler-desc }} ,
51 ${{ matrix.python-desc }},
52 config=${{ matrix.build-type }},
53 shared=${{ matrix.build-shared }},
54 cxx=${{ matrix.cxx-standard }}>'
55 # GH-hosted VM. The build runs in CentOS 7 'container' defined below.
56 runs-on: ubuntu-latest
57 container:
58 # DockerHub: https://hub.docker.com/u/aswf
59 # Source: https://github.com/AcademySoftwareFoundation/aswf-docker
60 image: aswf/ci-openexr:${{ matrix.vfx-cy }}
61 strategy:
62 matrix:
63 build: [1, 2, 3, 4, 5, 6, 7, 8, 9]
64 include:
65 # -------------------------------------------------------------------
66 # GCC, VFX CY2024
67 # -------------------------------------------------------------------
68 # C++17, Python 3.11
69 - build: 1
70 build-type: Release
71 build-shared: 'ON'
72 cxx-standard: 17
73 cxx-compiler: g++
74 cc-compiler: gcc
75 compiler-desc: gcc11.2.1
76 python: 'ON'
77 python-desc: python3.11
78 vfx-cy: 2024
79
80 # C++17, Python 3.11, Debug
81 - build: 2
82 build-type: Debug
83 build-shared: 'ON'
84 cxx-standard: 17
85 cxx-compiler: g++
86 cc-compiler: gcc
87 compiler-desc: gcc11.2.1
88 python: 'ON'
89 python-desc: python3.11
90 vfx-cy: 2024
91
92 # C++17, Python 3.11, Static
93 - build: 3
94 build-type: Release
95 build-shared: 'OFF'
96 cxx-standard: 17
97 cxx-compiler: g++
98 cc-compiler: gcc
99 compiler-desc: gcc11.2.1
100 python: 'ON'
101 python-desc: python3.11
102 vfx-cy: 2024
103
104 # C++14, Python 3.11
105 - build: 4
106 build-type: Release
107 build-shared: 'ON'
108 cxx-standard: 14
109 cxx-compiler: g++
110 cc-compiler: gcc
111 compiler-desc: gcc11.2.1
112 python: 'ON'
113 python-desc: python3.11
114 vfx-cy: 2024
115
116 # -------------------------------------------------------------------
117 # Clang 15.0, VFX CY2024
118 # -------------------------------------------------------------------
119 # C++17, Python 3.11
120 - build: 5
121 build-type: Release
122 build-shared: 'ON'
123 cxx-standard: 17
124 cxx-compiler: clang++
125 cc-compiler: clang
126 compiler-desc: clang15.0
127 python: 'ON'
128 python-desc: python3.11
129 vfx-cy: 2024
130
131 # -------------------------------------------------------------------
132 # Clang 14.0, VFX CY2024
133 # -------------------------------------------------------------------
134 # C++17, Python 3.11
135 - build: 6
136 build-type: Release
137 build-shared: 'ON'
138 cxx-standard: 17
139 cxx-compiler: clang++
140 cc-compiler: clang
141 compiler-desc: clang14.0
142 python: 'ON'
143 python-desc: python3.11
144 vfx-cy: 2024
145
146 # -------------------------------------------------------------------
147 # GCC, VFX CY2023
148 # -------------------------------------------------------------------
149 # C++17, Python 3.10.9
150 - build: 7
151 build-type: Release
152 build-shared: 'ON'
153 cxx-standard: 17
154 cxx-compiler: g++
155 cc-compiler: gcc
156 compiler-desc: gcc11.2.1
157 python: 'ON'
158 python-desc: python3.10.9
159 vfx-cy: 2023
160
161 # -------------------------------------------------------------------
162 # GCC, VFX CY2022
163 # -------------------------------------------------------------------
164 # C++17, Python 3.9
165 - build: 8
166 build-type: Release
167 build-shared: 'ON'
168 cxx-standard: 17
169 cxx-compiler: g++
170 cc-compiler: gcc
171 compiler-desc: gcc9.3.1
172 python: 'ON'
173 python-desc: python3.9.7
174 vfx-cy: 2022
175
176 # -------------------------------------------------------------------
177 # GCC, VFX CY2021
178 # -------------------------------------------------------------------
179 # C++17, Python 3.7.9
180 - build: 9
181 build-type: Release
182 build-shared: 'ON'
183 cxx-standard: 17
184 cxx-compiler: g++
185 cc-compiler: gcc
186 compiler-desc: gcc9.3.1
187 python: 'ON'
188 python-desc: python3.7.9
189 vfx-cy: 2021
190
191 env:
192 CXX: ${{ matrix.cxx-compiler }}
193 CC: ${{ matrix.cc-compiler }}
194 ACTIONS_RUNNER_FORCE_ACTIONS_NODE_VERSION: node16
195 ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
196 steps:
197 - name: Checkout
198 uses: actions/checkout@v2
199 - name: Create build directories
200 run: |
201 mkdir _install
202 mkdir _build
203 mkdir _examples
204 - name: Configure
205 run: |
206 cmake .. \
207 -DCMAKE_INSTALL_PREFIX=../_install \
208 -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} \
209 -DCMAKE_CXX_STANDARD=${{ matrix.cxx-standard }} \
210 -DCMAKE_CXX_FLAGS=${{ matrix.cxx-flags }} \
211 -DCMAKE_VERBOSE_MAKEFILE:BOOL='OFF' \
212 -DBUILD_SHARED_LIBS=${{ matrix.build-shared }} \
213 -DPYTHON=${{ matrix.python }} \
214 -DUSE_PYTHON2=${{ matrix.use-python2 }}
215 working-directory: _build
216 - name: Build
217 run: |
218 cmake --build . \
219 --target install \
220 --config ${{ matrix.build-type }}
221 working-directory: _build
222 - name: Examples
223 run: |
224 # Confirm the python module loads. Set PYTHONPATH to the
225 # _install directory of the module (better to find it
226 # procedurally than hard code a path).
227 export PYTHONPATH=`find ../_install -name imath.so | xargs dirname`
228 python -c "import imath;print(imath.__version__)"
229
230 # Make sure we can build the tests when configured as a
231 # standalone application linking against the just-installed
232 # Imath library.
233 cmake ../src/ImathTest \
234 -DCMAKE_PREFIX_PATH=../../_install \
235 -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} \
236 -DCMAKE_CXX_STANDARD=${{ matrix.cxx-standard }} \
237 -DCMAKE_CXX_FLAGS=${{ matrix.cxx-flags }}
238 cmake --build . \
239 --config ${{ matrix.build-type }}
240
241 # Confirm the tests run
242 ./bin/ImathTest
243
244 # Confirm the examples compile and execute
245 rm -rf bin CMakeCache.txt CMakeFiles cmake_install.cmake Makefile
246 cmake ../website/examples \
247 -DCMAKE_PREFIX_PATH=../../_install \
248 -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} \
249 -DCMAKE_CXX_STANDARD=${{ matrix.cxx-standard }} \
250 -DCMAKE_CXX_FLAGS=${{ matrix.cxx-flags }}
251 cmake --build . \
252 --config ${{ matrix.build-type }}
253 ctest
254 working-directory: _examples
255 - name: Test
256 run: |
257 ctest -T Test ${{ matrix.exclude-tests }} \
258 -C ${{ matrix.build-type }} \
259 --timeout 7200 \
260 --output-on-failure \
261 -VV
262 working-directory: _build
263
264 # ---------------------------------------------------------------------------
265 # macOS
266 # ---------------------------------------------------------------------------
267
268 macos_no_python:
269 name: 'macOS VFXP-${{matrix.vfx-cy }} macos-${{ matrix.osver }}
270 <AppleClang 11.0
271 config=${{ matrix.build-type }},
272 shared=${{ matrix.build-shared }},
273 cxx=${{ matrix.cxx-standard }}'
274 runs-on: macos-${{ matrix.osver }}
275 strategy:
276 matrix:
277 build: [1, 2, 3, 4, 5, 6, 7]
278 include:
279 # --------------------------------------------------------------------
280 # MacOS 14
281 # --------------------------------------------------------------------
282 # Release
283 - build: 1
284 build-type: Release
285 build-shared: 'ON'
286 cxx-standard: 17
287 exclude-tests:
288 osver: 14
289
290 # Debug
291 - build: 2
292 build-type: Debug
293 build-shared: 'ON'
294 cxx-standard: 17
295 exclude-tests:
296 osver: 14
297
298 # Static
299 - build: 3
300 build-type: Debug
301 build-shared: 'OFF'
302 cxx-standard: 17
303 exclude-tests:
304 osver: 14
305
306 # C++14
307 - build: 4
308 build-type: Release
309 build-shared: 'ON'
310 cxx-standard: 14
311 exclude-tests:
312 osver: 14
313
314 # C++11
315 - build: 5
316 build-type: Release
317 build-shared: 'ON'
318 cxx-standard: 11
319 exclude-tests:
320 osver: 14
321
322 # --------------------------------------------------------------------
323 # MacOS 13
324 # --------------------------------------------------------------------
325 - build: 6
326 build-type: Release
327 build-shared: 'ON'
328 cxx-standard: 17
329 exclude-tests:
330 osver: 13
331
332 # --------------------------------------------------------------------
333 # MacOS 12
334 # --------------------------------------------------------------------
335 - build: 7
336 build-type: Release
337 build-shared: 'ON'
338 cxx-standard: 17
339 exclude-tests:
340 osver: 12
341
342 steps:
343 ## - name: Setup Python
344 ## uses: actions/setup-python@v1
345 ## with:
346 ## python-version: ${{ matrix.python-version }}
347 - name: Checkout
348 uses: actions/checkout@v2
349 - name: Create build directories
350 run: |
351 mkdir _install
352 mkdir _build
353 mkdir _examples
354 ## - name: Install Dependences
355 ## run: |
356 ## share/ci/scripts/macos/install_boost.sh
357 ## shell: bash
358 - name: Configure
359 run: |
360 cmake ../. \
361 -DCMAKE_INSTALL_PREFIX=../_install \
362 -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} \
363 -DCMAKE_CXX_STANDARD=${{ matrix.cxx-standard }} \
364 -DCMAKE_CXX_FLAGS=${{ matrix.cxx-flags }} \
365 -DCMAKE_VERBOSE_MAKEFILE:BOOL='OFF' \
366 -DBUILD_SHARED_LIBS=${{ matrix.build-shared }}
367 working-directory: _build
368 - name: Build
369 run: |
370 cmake --build . \
371 --target install \
372 --config ${{ matrix.build-type }} \
373 -- -j2
374 working-directory: _build
375 - name: Examples
376 run: |
377 # Make sure we can build the tests when configured as a
378 # standalone application linking against the just-installed
379 # Imath library.
380 cmake ../src/ImathTest \
381 -DCMAKE_PREFIX_PATH=../../_install \
382 -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} \
383 -DCMAKE_CXX_STANDARD=${{ matrix.cxx-standard }} \
384 -DCMAKE_CXX_FLAGS=${{ matrix.cxx-flags }}
385 cmake --build . \
386 --config ${{ matrix.build-type }}
387 # Confirm the tests run
388 ./bin/ImathTest
389 working-directory: _examples
390 - name: Test
391 run: |
392 ctest -T Test ${{matrix.exclude-tests }} \
393 -C ${{matrix.build-type}} \
394 --timeout 7200 \
395 --output-on-failure \
396 -VV
397 working-directory: _build
398
399 # ---------------------------------------------------------------------------
400 # Windows
401 # ---------------------------------------------------------------------------
402 # TODO: Figure out how to get CMake to use Python 3.7.7.
403 # Boost 1.70.0 will only make boost python for 3.7.
404 # CMake finds Python 3.8 on the VM when configuring, then does not find
405 # a corresponding boost python38 module.
406 # TODO: Determine why tests hang in Debug job.
407 # TODO: Fix boost script to install from sourceforge.
408
409 windows:
410 name: 'Windows VFXP-${{ matrix.vfx-cy }}
411 <${{ matrix.compiler-desc }},
412 config=${{ matrix.build-type }},
413 shared=${{ matrix.build-shared }},
414 cxx=${{ matrix.cxx-standard }},
415 python=OFF>'
416 runs-on: windows-${{ matrix.osver }}
417 strategy:
418 matrix:
419 build: [1, 3, 4, 6, 7, 8]
420 include:
421 # -------------------------------------------------------------------
422 # VFX CY2023 - C++17 - Windows 2022 runner - MSVC 2022 (17.5)
423 # -------------------------------------------------------------------
424 # C++17, Release Shared
425 - build: 1
426 build-type: Release
427 build-shared: 'ON'
428 compiler-desc: msvc17.5
429 cxx-standard: 17
430 vfx-cy: 2023
431 exclude-tests:
432 osver: 2022
433
434 # C++17, Debug -
435 ## - build: 2
436 ## build-type: Debug
437 ## build-shared: 'ON'
438 ## cxx-standard: 17
439 ## exclude-tests:
440
441 # C++17, Release Static
442 - build: 3
443 build-type: Release
444 build-shared: 'OFF'
445 compiler-desc: msvc17.5
446 cxx-standard: 17
447 vfx-cy: 2023
448 exclude-tests:
449 osver: 2022
450
451 # -------------------------------------------------------------------
452 # VFX CY2022 - C++17 - Windows 2019
453 # -------------------------------------------------------------------
454 # C++17, Release Shared
455 - build: 4
456 build-type: Release
457 build-shared: 'ON'
458 compiler-desc: msvc16.11
459 cxx-standard: 17
460 vfx-cy: 2022
461 exclude-tests:
462 osver: 2019
463
464 # C++17, Debug -
465 ## - build: 5
466 ## build-type: Debug
467 ## build-shared: 'ON'
468 ## cxx-standard: 17
469 ## exclude-tests:
470
471 # C++17, Release Static
472 - build: 6
473 build-type: Release
474 build-shared: 'OFF'
475 compiler-desc: msvc16.11
476 cxx-standard: 17
477 vfx-cy: 2022
478 exclude-tests:
479 osver: 2019
480
481 # -------------------------------------------------------------------
482 # VFX CY2020 - C++14 - Windows 2019
483 # -------------------------------------------------------------------
484 # C++14, Release Shared
485 - build: 7
486 build-type: Release
487 build-shared: 'ON'
488 compiler-desc: msvc16.11
489 cxx-standard: 14
490 vfx-cy: 2020
491 exclude-tests:
492 osver: 2019
493
494 # -------------------------------------------------------------------
495 # VFX CY2019 - C++11 - Windows 2019
496 # -------------------------------------------------------------------
497 # C++11, Release Shared
498 - build: 8
499 build-type: Release
500 build-shared: 'ON'
501 compiler-desc: msvc16.11
502 cxx-standard: 11
503 exclude-tests:
504 osver: 2019
505
506 steps:
507 # - name: Setup Python
508 # uses: actions/setup-python@v1
509 # with:
510 # python-version: ${{ matrix.python-version }}
511 - name: Checkout
512 uses: actions/checkout@v2
513 - name: Create build directories
514 run: |
515 mkdir _install
516 mkdir _build
517 shell: bash
518 # - name: Install Dependences
519 # run: |
520 # share/ci/scripts/windows/install_python.ps1 ${{ matrix.python-version }} $HOME
521 # share/ci/scripts/windows/install_boost.ps1 ${{ matrix.boost-version }} $HOME 3.8
522 # shell: powershell
523 - name: Configure
524 run: |
525 cmake ../. \
526 -DCMAKE_INSTALL_PREFIX=../_install \
527 -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} \
528 -DCMAKE_CXX_STANDARD=${{ matrix.cxx-standard }} \
529 -DCMAKE_CXX_FLAGS=${{ matrix.cxx-flags }} \
530 -DCMAKE_VERBOSE_MAKEFILE:BOOL='OFF' \
531 -DBUILD_SHARED_LIBS=${{ matrix.build-shared }}
532 # NB: removed trailing slash from these lines
533 # -DBOOST_ROOT:FILEPATH=$BOOST_ROOT
534 # -DPYTHON='ON'
535 # -DPython_EXECUTABLE:FILEPATH="$PYTHON_ROOT"
536 # -DPython_INCLUDE_DIR:FILEPATH="$PYTHON_ROOT/include"
537 # -DPython_LIBRARY:"$PYTHON_ROOT\libs"
538 shell: bash
539 working-directory: _build
540 - name: Build
541 run: |
542 cmake --build . \
543 --target install \
544 --config ${{ matrix.build-type }}
545 shell: bash
546 working-directory: _build
547 - name: Test
548 run: |
549 ctest -T Test ${{ matrix.exclude-tests }} \
550 -C ${{ matrix.build-type }} \
551 --timeout 7200 \
552 --output-on-failure \
553 -VV
554 shell: bash
555 working-directory: _build
556
557 Website:
558
559 # Build the documentation, using a process that mimics the readthedoc build.
560 #
561 # Note that this job does not actually build Imath libraries,
562 # it just runs doxygen and sphinx.
563
564 name: 'Website'
565 runs-on: ubuntu-latest
566
567 steps:
568 - name: Checkout
569 uses: actions/checkout@v3
570 - name: Create build directory
571 run: mkdir _build
572 - name: Install doxygen
573 # Need help2man for tool manpages
574 run: sudo apt-get install -y doxygen help2man
575 - name: Install sphinx requirements
576 run: pip3 install -r website/requirements.txt
577 - name: Configure
578 run: cmake .. -DBUILD_WEBSITE='ON'
579 working-directory: _build
580 - name: Build
581 run: |
582 cmake --build . \
583 --target website \
584 --config Release
585 working-directory: _build
586