normie #853
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 (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. | |
# --------------------------------------------------------------------------- | |
# macOS | |
# --------------------------------------------------------------------------- | |
# TODO: Add ARM64/x86_64 (universal 2) build | |
macOS: | |
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 | |