backport #1907 #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# SPDX-License-Identifier: BSD-3-Clause | |
# Copyright Contributors to the OpenColorIO Project. | |
# | |
# GitHub Actions workflow file | |
# https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions | |
name: CI | |
on: | |
push: | |
# Versioned branches and tags are ignored for OCIO <= 1.x.x | |
branches-ignore: | |
- RB-0.* | |
- RB-1.* | |
- gh-pages | |
tags-ignore: | |
- v0.* | |
- v1.* | |
pull_request: | |
branches-ignore: | |
- RB-0.* | |
- RB-1.* | |
- gh-pages | |
tags-ignore: | |
- v0.* | |
- v1.* | |
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. | |
# --------------------------------------------------------------------------- | |
# Linux | |
# --------------------------------------------------------------------------- | |
linux: | |
name: 'Linux CentOS 7 VFX CY${{ matrix.vfx-cy }} | |
<${{ matrix.compiler-desc }} | |
config=${{ matrix.build-type }}, | |
shared=${{ matrix.build-shared }}, | |
sse=${{ matrix.use-sse }}, | |
cxx=${{ matrix.cxx-standard }}, | |
docs=${{ matrix.build-docs }}>' | |
# Avoid duplicated checks when a pull_request is opened from a local branch. | |
if: | | |
github.event_name == 'push' || | |
github.event.pull_request.head.repo.full_name != github.repository | |
# 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-ocio:${{ matrix.vfx-cy }} | |
strategy: | |
matrix: | |
build: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13] | |
include: | |
# ------------------------------------------------------------------- | |
# VFX CY2022 (Python 3.9) | |
# ------------------------------------------------------------------- | |
# C++17, Clang, Debug, OpenFX | |
- build: 13 | |
build-type: Debug | |
build-shared: 'ON' | |
build-docs: 'OFF' | |
build-openfx: 'ON' | |
use-sse: 'ON' | |
use-openexr-half: 'OFF' | |
cxx-standard: 17 | |
cxx-compiler: clang++ | |
cc-compiler: clang | |
compiler-desc: Clang 9 | |
vfx-cy: 2022 | |
# C++17, GCC, no SSE, OpenFX | |
- build: 12 | |
build-type: Release | |
build-shared: 'ON' | |
build-docs: 'OFF' | |
build-openfx: 'ON' | |
use-sse: 'OFF' | |
use-openexr-half: 'OFF' | |
cxx-standard: 17 | |
cxx-compiler: g++ | |
cc-compiler: gcc | |
compiler-desc: GCC 9.3.1 | |
vfx-cy: 2022 | |
# C++14, GCC, static, docs | |
- build: 11 | |
build-type: Release | |
build-shared: 'OFF' | |
build-docs: 'ON' | |
build-openfx: 'OFF' | |
use-sse: 'ON' | |
use-openexr-half: 'OFF' | |
cxx-standard: 14 | |
cxx-compiler: g++ | |
cc-compiler: gcc | |
compiler-desc: GCC 9.3.1 | |
vfx-cy: 2022 | |
# C++11, GCC, static | |
- build: 10 | |
build-type: Release | |
build-shared: 'OFF' | |
build-docs: 'OFF' | |
build-openfx: 'OFF' | |
use-sse: 'ON' | |
use-openexr-half: 'OFF' | |
cxx-standard: 11 | |
cxx-compiler: g++ | |
cc-compiler: gcc | |
compiler-desc: GCC 9.3.1 | |
vfx-cy: 2022 | |
# ------------------------------------------------------------------- | |
# VFX CY2021 (Python 3.7) | |
# ------------------------------------------------------------------- | |
# C++17, Clang | |
- build: 9 | |
build-type: Release | |
build-shared: 'ON' | |
build-docs: 'OFF' | |
build-openfx: 'OFF' | |
use-sse: 'ON' | |
use-openexr-half: 'ON' | |
cxx-standard: 17 | |
cxx-compiler: clang++ | |
cc-compiler: clang | |
compiler-desc: Clang 9 | |
vfx-cy: 2021 | |
# C++14, Clang, static, no SSE, OpenFX | |
- build: 8 | |
build-type: Release | |
build-shared: 'OFF' | |
build-docs: 'OFF' | |
build-openfx: 'ON' | |
use-sse: 'OFF' | |
use-openexr-half: 'ON' | |
cxx-standard: 14 | |
cxx-compiler: clang++ | |
cc-compiler: clang | |
compiler-desc: Clang 9 | |
vfx-cy: 2021 | |
# C++11, GCC, Debug | |
- build: 7 | |
build-type: Debug | |
build-shared: 'ON' | |
build-docs: 'OFF' | |
build-openfx: 'OFF' | |
use-sse: 'ON' | |
use-openexr-half: 'ON' | |
cxx-standard: 11 | |
cxx-compiler: g++ | |
cc-compiler: gcc | |
compiler-desc: GCC 9.3.1 | |
vfx-cy: 2021 | |
# ------------------------------------------------------------------- | |
# VFX CY2020 (Python 3.7) | |
# ------------------------------------------------------------------- | |
# C++14, Clang, OpenFX | |
- build: 6 | |
build-type: Release | |
build-shared: 'ON' | |
build-docs: 'OFF' | |
build-openfx: 'ON' | |
use-sse: 'OFF' | |
use-openexr-half: 'ON' | |
cxx-standard: 14 | |
cxx-compiler: clang++ | |
cc-compiler: clang | |
compiler-desc: Clang 7 | |
vfx-cy: 2020 | |
# C++14, GCC, static, Debug, OpenFX | |
- build: 5 | |
build-type: Debug | |
build-shared: 'OFF' | |
build-docs: 'OFF' | |
build-openfx: 'ON' | |
use-sse: 'ON' | |
use-openexr-half: 'ON' | |
cxx-standard: 14 | |
cxx-compiler: g++ | |
cc-compiler: gcc | |
compiler-desc: GCC 6.3.1 | |
vfx-cy: 2020 | |
# C++11, GCC, no SSE | |
- build: 4 | |
build-type: Release | |
build-shared: 'ON' | |
build-docs: 'OFF' | |
build-openfx: 'OFF' | |
use-sse: 'ON' | |
use-openexr-half: 'ON' | |
cxx-standard: 11 | |
cxx-compiler: g++ | |
cc-compiler: gcc | |
compiler-desc: GCC 6.3.1 | |
vfx-cy: 2020 | |
# ------------------------------------------------------------------- | |
# VFX CY2019 (Python 2.7) | |
# ------------------------------------------------------------------- | |
# C++11, Clang, static | |
- build: 3 | |
build-type: Release | |
build-shared: 'OFF' | |
# Doc build requires Python 3 | |
build-docs: 'OFF' | |
build-openfx: 'OFF' | |
use-sse: 'ON' | |
use-openexr-half: 'ON' | |
cxx-standard: 11 | |
cxx-compiler: clang++ | |
cc-compiler: clang | |
compiler-desc: Clang 7 | |
vfx-cy: 2019 | |
# C++11, Clang, Debug, no SSE | |
- build: 2 | |
build-type: Debug | |
build-shared: 'ON' | |
# Doc build requires Python 3 | |
build-docs: 'OFF' | |
build-openfx: 'OFF' | |
use-sse: 'OFF' | |
use-openexr-half: 'ON' | |
cxx-standard: 11 | |
cxx-compiler: clang++ | |
cc-compiler: clang | |
compiler-desc: Clang 7 | |
vfx-cy: 2019 | |
# C++11, GCC, OpenFX | |
- build: 1 | |
build-type: Release | |
build-shared: 'ON' | |
# Doc build requires Python 3 | |
build-docs: 'OFF' | |
build-openfx: 'ON' | |
use-sse: 'ON' | |
use-openexr-half: 'ON' | |
cxx-standard: 11 | |
cxx-compiler: g++ | |
cc-compiler: gcc | |
compiler-desc: GCC 6.3.1 | |
vfx-cy: 2019 | |
env: | |
CXX: ${{ matrix.cxx-compiler }} | |
CC: ${{ matrix.cc-compiler }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Install docs env | |
run: share/ci/scripts/linux/yum/install_docs_env.sh | |
if: matrix.build-docs == 'ON' | |
- name: Install tests env | |
run: share/ci/scripts/linux/yum/install_tests_env.sh | |
- name: Create build directories | |
run: | | |
mkdir _install | |
mkdir _build | |
- name: Configure | |
run: | | |
cmake ../. \ | |
-DCMAKE_INSTALL_PREFIX=../_install \ | |
-DCMAKE_BUILD_TYPE=${{ matrix.build-type }} \ | |
-DCMAKE_CXX_STANDARD=${{ matrix.cxx-standard }} \ | |
-DBUILD_SHARED_LIBS=${{ matrix.build-shared }} \ | |
-DOCIO_BUILD_DOCS=${{ matrix.build-docs }} \ | |
-DOCIO_BUILD_OPENFX=${{ matrix.build-openfx }} \ | |
-DOCIO_BUILD_GPU_TESTS=OFF \ | |
-DOCIO_USE_SSE=${{ matrix.use-sse }} \ | |
-DOCIO_USE_OPENEXR_HALF=${{ matrix.use-openexr-half }} \ | |
-DOCIO_INSTALL_EXT_PACKAGES=ALL \ | |
-DOCIO_WARNING_AS_ERROR=ON \ | |
-DPython_EXECUTABLE=$(which python) | |
working-directory: _build | |
- name: Build | |
run: | | |
cmake --build . \ | |
--target install \ | |
--config ${{ matrix.build-type }} \ | |
-- -j$(nproc) | |
working-directory: _build | |
- name: Test | |
run: ctest -V -C ${{ matrix.build-type }} | |
working-directory: _build | |
- name: Test CMake Consumer | |
if: matrix.build-shared == 'ON' | |
run: | | |
cmake . \ | |
-DCMAKE_PREFIX_PATH=../../../_install \ | |
-DCMAKE_BUILD_TYPE=${{ matrix.build-type }} | |
cmake --build . \ | |
--config ${{ matrix.build-type }} | |
./consumer | |
working-directory: _build/tests/cmake-consumer-dist | |
# --------------------------------------------------------------------------- | |
# macOS | |
# --------------------------------------------------------------------------- | |
macos: | |
name: 'macOS 10.15 | |
<AppleClang 11.0 | |
config=${{ matrix.build-type }}, | |
shared=${{ matrix.build-shared }}, | |
sse=${{ matrix.use-sse }}, | |
cxx=${{ matrix.cxx-standard }}, | |
python=${{ matrix.python-version }}, | |
docs=${{ matrix.build-docs }}>' | |
# Avoid duplicated checks when a pull_request is opened from a local branch. | |
if: | | |
github.event_name == 'push' || | |
github.event.pull_request.head.repo.full_name != github.repository | |
runs-on: macos-10.15 | |
strategy: | |
matrix: | |
build: [1, 2, 3, 4, 5, 6] | |
include: | |
# C++17, OpenFX | |
- build: 6 | |
build-type: Release | |
build-shared: 'ON' | |
build-docs: 'OFF' | |
build-openfx: 'ON' | |
use-sse: 'ON' | |
use-openexr-half: 'OFF' | |
cxx-standard: 17 | |
python-version: 3.9 | |
# C++11, Python 3.7 | |
- build: 5 | |
build-type: Release | |
build-shared: 'ON' | |
build-docs: 'ON' | |
build-openfx: 'OFF' | |
use-sse: 'ON' | |
use-openexr-half: 'OFF' | |
cxx-standard: 11 | |
python-version: 3.7 | |
# Debug, OpenFX | |
- build: 4 | |
build-type: Debug | |
build-shared: 'ON' | |
build-docs: 'OFF' | |
build-openfx: 'ON' | |
use-sse: 'ON' | |
use-openexr-half: 'OFF' | |
cxx-standard: 11 | |
python-version: 3.7 | |
# C++14, OpenEXR, OpenFX | |
- build: 3 | |
build-type: Release | |
build-shared: 'ON' | |
build-docs: 'OFF' | |
build-openfx: 'ON' | |
use-sse: 'ON' | |
use-openexr-half: 'ON' | |
cxx-standard: 14 | |
python-version: 3.7 | |
# Static, no SSE | |
- build: 2 | |
build-type: Release | |
build-shared: 'OFF' | |
build-docs: 'OFF' | |
build-openfx: 'OFF' | |
use-sse: 'OFF' | |
use-openexr-half: 'OFF' | |
cxx-standard: 11 | |
python-version: 3.7 | |
# Python 2.7 | |
- build: 1 | |
build-type: Release | |
build-shared: 'ON' | |
# Doc build requires Python 3 | |
build-docs: 'OFF' | |
build-openfx: 'OFF' | |
use-sse: 'ON' | |
use-openexr-half: 'OFF' | |
cxx-standard: 11 | |
python-version: 2.7 | |
steps: | |
- name: Setup Python | |
uses: actions/setup-python@v1 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Install docs env | |
run: share/ci/scripts/macos/install_docs_env.sh | |
if: matrix.build-docs == 'ON' | |
- name: Install tests env | |
run: share/ci/scripts/macos/install_tests_env.sh | |
- name: Create build directories | |
run: | | |
mkdir _install | |
mkdir _build | |
- name: Configure | |
run: | | |
cmake ../. \ | |
-DCMAKE_INSTALL_PREFIX=../_install \ | |
-DCMAKE_BUILD_TYPE=${{ matrix.build-type }} \ | |
-DCMAKE_CXX_STANDARD=${{ matrix.cxx-standard }} \ | |
-DBUILD_SHARED_LIBS=${{ matrix.build-shared }} \ | |
-DOCIO_BUILD_DOCS=${{ matrix.build-docs }} \ | |
-DOCIO_BUILD_OPENFX=${{ matrix.build-openfx }} \ | |
-DOCIO_BUILD_GPU_TESTS=OFF \ | |
-DOCIO_USE_SSE=${{ matrix.use-sse }} \ | |
-DOCIO_USE_OPENEXR_HALF=${{ matrix.use-openexr-half }} \ | |
-DOCIO_INSTALL_EXT_PACKAGES=ALL \ | |
-DOCIO_WARNING_AS_ERROR=ON \ | |
-DPython_EXECUTABLE=$(which python) | |
working-directory: _build | |
- name: Build | |
run: | | |
cmake --build . \ | |
--target install \ | |
--config ${{ matrix.build-type }} \ | |
-- -j$(sysctl -n hw.ncpu) | |
working-directory: _build | |
- name: Test | |
run: ctest -V -C ${{ matrix.build-type }} | |
working-directory: _build | |
- name: Test CMake Consumer | |
if: matrix.build-shared == 'ON' | |
run: | | |
cmake . \ | |
-DCMAKE_PREFIX_PATH=../../../_install \ | |
-DCMAKE_BUILD_TYPE=${{ matrix.build-type }} | |
cmake --build . \ | |
--config ${{ matrix.build-type }} | |
./consumer | |
working-directory: _build/tests/cmake-consumer-dist | |
# --------------------------------------------------------------------------- | |
# Windows | |
# --------------------------------------------------------------------------- | |
# TODO: Install pythonXX_d.lib (or work around it being needed) to support | |
# Debug build testing with Python bindings and docs enabled. | |
windows: | |
name: 'Windows 2019 | |
<MSVC 16.4 | |
config=${{ matrix.build-type }}, | |
shared=${{ matrix.build-shared }}, | |
sse=${{ matrix.use-sse }}, | |
cxx=${{ matrix.cxx-standard }}, | |
python=${{ matrix.python-version }}, | |
docs=${{ matrix.build-docs }}>' | |
# Avoid duplicated checks when a pull_request is opened from a local branch. | |
if: | | |
github.event_name == 'push' || | |
github.event.pull_request.head.repo.full_name != github.repository | |
runs-on: windows-2019 | |
strategy: | |
matrix: | |
build: [1, 2, 3, 4, 5, 6] | |
include: | |
# C++17, OpenFX | |
- build: 6 | |
build-type: Release | |
build-shared: 'ON' | |
build-docs: 'OFF' | |
build-openfx: 'ON' | |
use-sse: 'ON' | |
use-openexr-half: 'OFF' | |
cxx-standard: 17 | |
python-version: 3.9 | |
# C++11, Python 3.7 | |
- build: 5 | |
build-type: Release | |
build-shared: 'ON' | |
build-docs: 'OFF' | |
build-openfx: 'OFF' | |
use-sse: 'ON' | |
use-openexr-half: 'OFF' | |
cxx-standard: 11 | |
python-version: 3.7 | |
# Debug | |
- build: 4 | |
build-type: Debug | |
build-shared: 'ON' | |
build-docs: 'OFF' | |
build-openfx: 'OFF' | |
use-sse: 'ON' | |
use-openexr-half: 'OFF' | |
cxx-standard: 11 | |
python-version: 3.7 | |
# C++14, OpenEXR, OpenFX | |
- build: 3 | |
build-type: Release | |
build-shared: 'ON' | |
build-docs: 'OFF' | |
build-openfx: 'ON' | |
use-sse: 'ON' | |
use-openexr-half: 'ON' | |
cxx-standard: 14 | |
python-version: 3.7 | |
# Static, no SSE, OpenFX | |
- build: 2 | |
build-type: Release | |
build-shared: 'OFF' | |
build-docs: 'OFF' | |
build-openfx: 'ON' | |
use-sse: 'OFF' | |
use-openexr-half: 'OFF' | |
cxx-standard: 11 | |
python-version: 3.7 | |
# Python 2.7 | |
- build: 1 | |
build-type: Release | |
build-shared: 'ON' | |
# Doc build requires Python 3 | |
build-docs: 'OFF' | |
build-openfx: 'OFF' | |
use-sse: 'ON' | |
use-openexr-half: 'OFF' | |
cxx-standard: 11 | |
python-version: 2.7 | |
steps: | |
- name: Setup Python | |
uses: actions/setup-python@v1 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Install docs env | |
run: share/ci/scripts/windows/install_docs_env.sh | |
shell: bash | |
if: matrix.build-docs == 'ON' | |
- name: Install tests env | |
run: share/ci/scripts/windows/install_tests_env.sh | |
shell: bash | |
- name: Create build directories | |
run: | | |
mkdir _install | |
mkdir _build | |
shell: bash | |
- name: Configure | |
run: | | |
cmake ../. \ | |
-DCMAKE_INSTALL_PREFIX=../_install \ | |
-DCMAKE_BUILD_TYPE=${{ matrix.build-type }} \ | |
-DCMAKE_CXX_STANDARD=${{ matrix.cxx-standard }} \ | |
-DCMAKE_GENERATOR_PLATFORM=x64 \ | |
-DBUILD_SHARED_LIBS=${{ matrix.build-shared }} \ | |
-DOCIO_BUILD_DOCS=${{ matrix.build-docs }} \ | |
-DOCIO_BUILD_OPENFX=${{ matrix.build-openfx }} \ | |
-DOCIO_BUILD_GPU_TESTS=OFF \ | |
-DOCIO_USE_SSE=${{ matrix.use-sse }} \ | |
-DOCIO_USE_OPENEXR_HALF=${{ matrix.use-openexr-half }} \ | |
-DOCIO_INSTALL_EXT_PACKAGES=ALL \ | |
-DOCIO_WARNING_AS_ERROR=ON \ | |
-DPython_EXECUTABLE=$(which python) | |
shell: bash | |
working-directory: _build | |
- name: Build | |
run: | | |
cmake --build . \ | |
--target install \ | |
--config ${{ matrix.build-type }} | |
shell: bash | |
working-directory: _build | |
- name: Test | |
run: ctest -V -C ${{ matrix.build-type }} | |
shell: bash | |
working-directory: _build | |
- name: Test CMake Consumer | |
if: matrix.build-shared == 'ON' | |
run: | | |
cmake . \ | |
-DCMAKE_PREFIX_PATH=../../../_install \ | |
-DCMAKE_BUILD_TYPE=${{ matrix.build-type }} | |
cmake --build . \ | |
--config ${{ matrix.build-type }} | |
export PATH=../../../_install/bin:$PATH | |
./${{ matrix.build-type }}/consumer | |
shell: bash | |
working-directory: _build/tests/cmake-consumer-dist |