Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test Images page for website #1372

Merged
merged 14 commits into from
Apr 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 37 additions & 30 deletions .github/workflows/ci_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ jobs:
C++${{ matrix.cxx-standard }},
config=${{ matrix.build-type }},
shared=${{ matrix.build-shared }},
threads=${{ matrix.threads-enabled }},
docs=${{ matrix.build-docs }}>'
threads=${{ matrix.threads-enabled }}>'
# GH-hosted VM. The build runs in CentOS 7 'container' defined below.
runs-on: ubuntu-latest
container:
Expand All @@ -74,7 +73,6 @@ jobs:
label:
threads-enabled: 'ON'
vfx-cy: 2022
build-docs: 'ON'
exclude-tests:

# Shared, Release, Threads OFF
Expand All @@ -88,7 +86,6 @@ jobs:
label:
threads-enabled: 'OFF'
vfx-cy: 2022
build-docs: 'OFF'
exclude-tests:

# Shared, Debug
Expand All @@ -102,7 +99,6 @@ jobs:
label:
threads-enabled: 'ON'
vfx-cy: 2022
build-docs: 'OFF'
exclude-tests:

# Static, Release
Expand All @@ -116,7 +112,6 @@ jobs:
label:
threads-enabled: 'ON'
vfx-cy: 2022
build-docs: 'OFF'
exclude-tests:

# Static, Debug
Expand All @@ -130,7 +125,6 @@ jobs:
label:
threads-enabled: 'ON'
vfx-cy: 2022
build-docs: 'OFF'
exclude-tests:

# -------------------------------------------------------------------
Expand All @@ -147,7 +141,6 @@ jobs:
label:
threads-enabled: 'ON'
vfx-cy: 2022
build-docs: 'OFF'
exclude-tests:

# Debug
Expand All @@ -161,7 +154,6 @@ jobs:
label:
threads-enabled: 'ON'
vfx-cy: 2022
build-docs: 'OFF'
exclude-tests:

# Static, Release
Expand All @@ -175,7 +167,6 @@ jobs:
label:
threads-enabled: 'ON'
vfx-cy: 2022
build-docs: 'OFF'
exclude-tests:

# Static, Debug
Expand All @@ -188,7 +179,6 @@ jobs:
compiler-desc: clang10
label:
threads-enabled: 'ON'
build-docs: 'OFF'
vfx-cy: 2022
exclude-tests:

Expand All @@ -205,7 +195,6 @@ jobs:
compiler-desc: gcc9.3.1
label:
threads-enabled: 'ON'
build-docs: 'OFF'
vfx-cy: 2021
exclude-tests:

Expand All @@ -222,7 +211,6 @@ jobs:
compiler-desc: gcc6.3.1
label:
threads-enabled: 'ON'
build-docs: 'OFF'
vfx-cy: 2020
exclude-tests:

Expand All @@ -239,7 +227,6 @@ jobs:
compiler-desc: gcc6.3.1
label:
threads-enabled: 'ON'
build-docs: 'OFF'
vfx-cy: 2019
exclude-tests:

Expand All @@ -256,7 +243,6 @@ jobs:
compiler-desc: gcc6.3.1
label: 'Legacy '
threads-enabled: 'ON'
build-docs: 'OFF'
vfx-cy: 2019
exclude-tests:

Expand All @@ -271,9 +257,6 @@ jobs:
mkdir _install
mkdir _build
mkdir _examples
- name: Install docs env
run: share/ci/scripts/linux/yum/install_docs_env.sh
if: matrix.build-docs == 'ON'
- name: Configure
run: |
cmake .. \
Expand All @@ -283,7 +266,6 @@ jobs:
-DCMAKE_CXX_FLAGS=${{ matrix.cxx-flags }} \
-DCMAKE_VERBOSE_MAKEFILE:BOOL='OFF' \
-DBUILD_SHARED_LIBS=${{ matrix.build-shared }} \
-DBUILD_DOCS=${{ matrix.build-docs }} \
-DOPENEXR_BUILD_TOOLS='ON' \
-DOPENEXR_RUN_FUZZ_TESTS='OFF' \
-DOPENEXR_ENABLE_THREADING=${{ matrix.threads-enabled }}
Expand Down Expand Up @@ -332,8 +314,7 @@ jobs:
C++${{ matrix.cxx-standard }},
config=${{ matrix.build-type }},
shared=${{ matrix.build-shared }},
cxx=${{ matrix.cxx-standard }},
docs=${{ matrix.build-docs }}>'
cxx=${{ matrix.cxx-standard }}>'
runs-on: macos-${{ matrix.osver }}
strategy:
matrix:
Expand All @@ -346,7 +327,6 @@ jobs:
- build: 1
build-type: Release
build-shared: 'ON'
build-docs: 'OFF'
compiler-desc: AppleClang11.0
cxx-standard: 17
osver: 10.15
Expand All @@ -356,7 +336,6 @@ jobs:
- build: 2
build-type: Release
build-shared: 'OFF'
build-docs: 'OFF'
compiler-desc: AppleClang11.0
cxx-standard: 17
osver: 10.15
Expand All @@ -366,7 +345,6 @@ jobs:
- build: 3
build-type: Debug
build-shared: 'ON'
build-docs: 'OFF'
compiler-desc: AppleClang11.0
cxx-standard: 17
osver: 10.15
Expand Down Expand Up @@ -430,8 +408,7 @@ jobs:
<${{ matrix.compiler-desc }},
config=${{ matrix.build-type }},
shared=${{ matrix.build-shared }},
cxx=${{ matrix.cxx-standard }},
docs=${{ matrix.build-docs }}>'
cxx=${{ matrix.cxx-standard }}>'
runs-on: windows-${{ matrix.osver }}
strategy:
matrix:
Expand All @@ -444,7 +421,6 @@ jobs:
- build: 1
build-type: Release
build-shared: 'ON'
build-docs: 'OFF'
compiler-desc: msvc16.11
cxx-standard: 17
vfx-cy: 2021
Expand All @@ -455,7 +431,6 @@ jobs:
- build: 2
build-type: Release
build-shared: 'OFF'
build-docs: 'OFF'
compiler-desc: msvc16.11
cxx-standard: 17
vfx-cy: 2021
Expand All @@ -469,7 +444,6 @@ jobs:
- build: 3
build-type: Release
build-shared: 'ON'
build-docs: 'OFF'
compiler-desc: msvc17.1
cxx-standard: 17
vfx-cy: 2021
Expand All @@ -480,7 +454,6 @@ jobs:
- build: 4
build-type: Release
build-shared: 'OFF'
build-docs: 'OFF'
compiler-desc: msvc17.1
cxx-standard: 17
vfx-cy: 2021
Expand Down Expand Up @@ -547,3 +520,37 @@ jobs:
-VV
shell: bash
working-directory: _build

Docs:

# Build the documentation, using a process that mimics the readthedoc build.
#
# Note that this job does not actually build OpenEXR libraries or
# programs, it just runs doxygen, sphinx, and the
# docs/script/test_images.py script to generate the "Test Images"
# page.

name: 'Docs'
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3
- name: Create build directory
run: mkdir _build
- name: Install doxygen & imagemagick
# Need imagemagick for convert, to convert "Test Image" exrs to jpgs
# Need openexr for exrheader
run: sudo apt-get install -y doxygen imagemagick openexr
- name: Install sphinx requirements
run: pip3 install -r docs/requirements.txt
- name: Configure
run: cmake .. -DBUILD_DOCS='ON'
working-directory: _build
- name: Build
run: |
cmake --build . \
--target docs \
--config Release
working-directory: _build

3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,5 @@ build/
build-win/
build-nuget/
*~
.vscode
.vscode
docs/_test_images/
25 changes: 25 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# .readthedocs.yml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

build:
os: "ubuntu-22.04"
tools:
python: "3.9"
apt_packages:
- wget # for test images
- imagemagick # for convert, for test images
- openexr # for exrheader, for test images
jobs:
pre_build:
- python docs/scripts/test_images.py

sphinx:
configuration: docs/conf.py

python:
install:
- requirements: docs/requirements.txt
29 changes: 26 additions & 3 deletions docs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@ set(SPHINX_INDEX_FILE ${SPHINX_BUILD}/index.html)

set(SPHINX_OPTS "-W" CACHE STRING "Sphinx build options")

set(OPENEXR_TEST_IMAGE_REPO "https://raw.githubusercontent.com/AcademySoftwareFoundation/openexr-images"
CACHE STRING "Repo for test images")
set(OPENEXR_TEST_IMAGE_TAG "main"
CACHE STRING "Tag for test image repo")

set(TEST_IMAGE_INDEX_FILE ${PROJECT_SOURCE_DIR}/docs/_test_images/index.rst)
set(TEST_IMAGE_PY_FILE ${PROJECT_SOURCE_DIR}/docs/scripts/test_images.py)
set(TEST_IMAGE_INPUT_FILE ${PROJECT_SOURCE_DIR}/docs/test_images.txt)
configure_file(${DOXYFILE_IN} ${DOXYFILE_OUT} @ONLY)

file(MAKE_DIRECTORY ${DOXYGEN_OUTPUT_DIR})
Expand All @@ -31,18 +39,33 @@ add_custom_command(OUTPUT ${DOXYGEN_INDEX_FILE}
COMMENT "Running doxygen"
VERBATIM)

add_custom_command(OUTPUT ${TEST_IMAGE_INDEX_FILE}
# run the test_images.py script with the PATH set
# to include the build's bin directory, to pick up
# the local bin/exrheader executable
COMMAND ${CMAKE_COMMAND} -E env "PATH=${CMAKE_CURRENT_BINARY_DIR}/../bin:$ENV{PATH}"
${Python3_EXECUTABLE} ${TEST_IMAGE_PY_FILE} ${OPENEXR_TEST_IMAGE_REPO} ${OPENEXR_TEST_IMAGE_TAG}
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
DEPENDS
${TEST_IMAGE_PY_FILE} ${TEST_IMAGE_INPUT_FILE}
COMMENT "Generating test image pages"
VERBATIM)

add_custom_command(OUTPUT ${SPHINX_INDEX_FILE}
COMMAND
${SPHINX_EXECUTABLE} -b html ${SPHINX_OPTS}
# Tell Breathe where to find the Doxygen output
-Dbreathe_projects.OpenEXR=${DOXYGEN_OUTPUT_DIR}/xml
${SPHINX_SOURCE} ${SPHINX_BUILD}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
DEPENDS ${DOXYGEN_INDEX_FILE}
MAIN_DEPENDENCY conf.py
DEPENDS ${DOXYGEN_INDEX_FILE} ${TEST_IMAGE_INDEX_FILE} ${TEST_IMAGE_PY_FILE} ${TEST_IMAGE_INPUT_FILE}
MAIN_DEPENDENCY ${SPHINX_CONF_PY_FILE}
COMMENT "Generating documentation with Sphinx")

add_custom_target(docs ALL DEPENDS ${SPHINX_INDEX_FILE} ${DOXYGEN_INDEX_FILE})
add_custom_target(docs ALL DEPENDS
${SPHINX_INDEX_FILE}
${DOXYGEN_INDEX_FILE}
${TEST_IMAGE_INDEX_FILE})

# Add an install target to install the docs
if(INSTALL_DOCS)
Expand Down
Loading