Skip to content

Commit

Permalink
Add website workflows and improve ci workflow filter
Browse files Browse the repository at this point in the history
This configuration mirrors OpenEXR.

Signed-off-by: Cary Phillips <[email protected]>
  • Loading branch information
cary-ilm committed Mar 12, 2024
1 parent 9613093 commit d216952
Show file tree
Hide file tree
Showing 5 changed files with 116 additions and 8 deletions.
24 changes: 18 additions & 6 deletions .github/workflows/ci_workflow.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,31 @@
# SPDX-License-Identifier: BSD-3-Clause
# Copyright Contributors to the OpenEXR Project.
# 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, since yhe website has a separate workflow
# - changes to workflows other than this one

on:
push:
# Jobs are skipped when ONLY Markdown (*.md) files are changed
paths-ignore:
- '**.md'
paths:
- '**'
- '!**.md'
- '!website/**'
- '!.github/workflows/**'
- '.github/workflows/ci_workflow.yml'
pull_request:
paths-ignore:
- '**.md'
paths:
- '**'
- '!**.md'
- '!website/**'
- '!.github/workflows/**'
- '.github/workflows/ci_workflow.yml'

permissions:
contents: read
Expand Down
35 changes: 35 additions & 0 deletions .github/workflows/website_preview_link.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# 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

#
# This action adds a link to the PR description pointing to the
# readthedocs build of the website, for PRs that modify the website.
#
# Note that the link is also available in the PR checks, but it gets
# buried among the output of the checks and isn't obvious.
#

name: Website preview link
on:
pull_request_target:
types:
- opened
paths:
- 'website/**'

permissions:
pull-requests: write

jobs:
pull-request-links:
runs-on: ubuntu-latest
steps:
- uses: readthedocs/actions/preview@v1
with:
project-slug: "openexr"
message-template: "Website preview: {docs-pr-index-url}"


58 changes: 58 additions & 0 deletions .github/workflows/website_workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# 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: Website

# Run only on changes in the "website" directory or workflow file.
# Skip the release branches, since the website is built from main.

on:

push:
branches:-ignore:
- RB-*
paths:
- 'website/**'
- '.github/workflows/website_workflow.yml'

pull_request:
branches:-ignore:
- RB-*
paths:
- 'website/**'
- '.github/workflows/website_workflow.yml'

permissions:
contents: read

jobs:

Website:

# Build the website, using a process that mimics the readthedoc build.

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

steps:
- name: Checkout
uses: actions/checkout@v3
- name: Create build directory
run: mkdir _build
- name: Install doxygen
run: sudo apt-get install -y doxygen
- name: Install sphinx requirements
run: pip3 install -r website/requirements.txt
- name: Configure
run: cmake .. -DBUILD_WEBSITE='ON'
working-directory: _build
- name: Build
run: |
cmake --build . \
--target website \
--config Release
working-directory: _build

5 changes: 4 additions & 1 deletion website/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
# -- General configuration ------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
#needs_sphinx = '1.0'
needs_sphinx = '5.0'

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
Expand Down Expand Up @@ -168,11 +168,14 @@
# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
html_logo = "images/imath-logo-blue.png"
logo_url = "images/imath-logo-blue.png"

# The name of an image file (within the static path) to use as favicon of the
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
# pixels large.
html_favicon = "images/imath-fav.ico"
#favicon_url = "images/imath-fav.ico"
favicon_url = "https://www.python.org/static/favicon.ico"

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
Expand Down
2 changes: 1 addition & 1 deletion website/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# SPDX-License-Identifier: BSD-3-Clause
# Copyright (c) Contributors to the OpenEXR Project.

sphinx >= 5.0
sphinx >=5.0,<6.0
breathe
sphinx-press-theme

0 comments on commit d216952

Please sign in to comment.