Skip to content
Merged
Show file tree
Hide file tree
Changes from 29 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
8c30d15
docs: Move testing.sh to its own dir.
samsrabin Jun 5, 2025
c2600a1
testing.sh: cd to script dir.
samsrabin Jun 5, 2025
244da83
Break up testing.sh into subscripts.
samsrabin Jun 5, 2025
d15df4a
docs-omnibus.yml: Use new script location.
samsrabin Jun 5, 2025
4b37557
docs-omnibus.yml: Check out all submodules.
samsrabin Jun 5, 2025
fe02184
docs-omnibus.yml: Only run one of the testing scripts is changed.
samsrabin Jun 5, 2025
628d3f9
docs-omnibus.yml: Also run when docs/Makefile is updated.
samsrabin Jun 5, 2025
e86ffe5
docs-ctsm_pylib.yml: Also trigger on docs container requirements.txt.
samsrabin Jun 5, 2025
3631ee0
Add GitHub workflows to run when docs dependencies update.
samsrabin Jun 5, 2025
40dc05d
Dont run some jobs on forks.
samsrabin Jun 5, 2025
cf6acee
Fix test-rv-setup.
samsrabin Jun 5, 2025
115491f
test-rv-setup: Use Docker.
samsrabin Jun 5, 2025
00fd3bf
testing.sh: Remove emoji from comments.
samsrabin Jun 5, 2025
1dbd0f4
docs.yml: Don't run if just testing scripts were updated.
samsrabin Jun 5, 2025
e0ceb1d
Run docs workflows if included file in doc/testing/ updates.
samsrabin Jun 5, 2025
2453199
Trying to fix docs-omnibus workflow.
samsrabin Jun 5, 2025
53d034b
Reduce docs-update-ctsm_pylib runs.
samsrabin Jun 5, 2025
cd22a34
Docs workflows: Always checkout all submodules.
samsrabin Jun 5, 2025
4848e21
Bump docs container version to satisfy workflow check.
samsrabin Jun 6, 2025
d5b7f1e
docker-image-build.yml: Remove nonexistent file from triggers.
samsrabin Jun 6, 2025
50fe21e
Add some EOF blank lines.
samsrabin Jun 9, 2025
802cb48
Merge branch 'b4b-dev' into break-up-omnibus-docs-test
samsrabin Jun 18, 2025
4fd500c
Move a "don't run on forks" conditional.
samsrabin Jun 24, 2025
eb8f83f
Delete an unnecessary "don't run on forks."
samsrabin Jun 24, 2025
722d5a5
Better explain use of one "don't run on forks."
samsrabin Jun 24, 2025
3fa38aa
docs-update-dependency-common.yml: Set default conda variables.
samsrabin Jun 24, 2025
4a7d411
docs-update-dependency-common.yml: Add comment re: inputs.
samsrabin Jun 24, 2025
0799aeb
Combine ctsm_pylib docs workflow files.
samsrabin Jun 24, 2025
345145f
Rename ctsm_pylib docs workflow file.
samsrabin Jun 24, 2025
67394de
Improve workflow job names.
samsrabin Jun 24, 2025
e168ad3
Rename doc/testing/ to doc/test/.
samsrabin Jun 24, 2025
e0292f4
Finish renaming doc/testing/ to doc/test/.
samsrabin Jun 24, 2025
1cdcafa
Reword a success message.
samsrabin Jun 24, 2025
51c6852
Shorten a workflow title.
samsrabin Jun 24, 2025
ab546d5
docs/test/*sh: Explain "set -e".
samsrabin Jun 24, 2025
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
2 changes: 0 additions & 2 deletions .github/workflows/docker-image-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,13 @@ on:
paths:
- 'doc/ctsm-docs_container/**'
- '!doc/ctsm-docs_container/README.md'
- '.github/workflows/docker-image-ctsm-docs-build.yml'
- '.github/workflows/docker-image-common.yml'

pull_request:
# Run on pull requests that change the listed files
paths:
- 'doc/ctsm-docs_container/**'
- '!doc/ctsm-docs_container/README.md'
- '.github/workflows/docker-image-ctsm-docs-build.yml'
- '.github/workflows/docker-image-common.yml'

workflow_dispatch:
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/docker-image-common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,16 @@ jobs:
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

# Try building our docs using the new container
- name: Checkout doc-builder external
# Check out all submodules because we might :literalinclude: something from one
- name: Checkout all submodules
run: |
bin/git-fleximod update doc-builder
bin/git-fleximod update -o
- name: Set image tag for docs build
id: set-image-tag
run: |
echo "IMAGE_TAG=$(echo '${{ steps.meta.outputs.tags }}' | head -n 1 | cut -d',' -f1)" >> $GITHUB_ENV
- name: Build docs using Docker (Podman has trouble on GitHub runners)
id: build-docs
run: |
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/docs-build-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@ on:
branches: ['master', 'release-clm5.0']
paths:
- 'doc/**'
- '!doc/testing/*'
- '!doc/*ChangeLog*'
- '!doc/*ChangeSum*'
- '!doc/UpdateChangelog.pl'
# Include all include::ed files outside doc/ directory!
- 'src/README.unit_testing'
- 'tools/README'
- 'doc/testing/test_container_eq_ctsm_pylib.sh'

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
Expand Down Expand Up @@ -46,10 +48,14 @@ jobs:
- name: Setup Pages
uses: actions/configure-pages@v5

# Check out all submodules because we might :literalinclude: something from one
- name: Checkout all submodules
run: |
bin/git-fleximod update -o

- name: Build docs using container
id: build-docs
run: |
bin/git-fleximod update -o
cd doc
./build_docs_to_publish -d --site-root https://escomp.github.io/CTSM

Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/docs-common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,10 @@ jobs:
fetch-depth: 0
lfs: true

- name: Checkout doc-builder external
# Check out all submodules because we might :literalinclude: something from one
- name: Checkout all submodules
run: |
bin/git-fleximod update doc-builder
bin/git-fleximod update -o
# Do this if not using conda
# Based on https://github.com/actions/cache/blob/main/examples.md#python---pip
Expand Down
30 changes: 12 additions & 18 deletions .github/workflows/docs-omnibus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,39 +5,34 @@ on:
# Run when a change to these files is pushed to any branch. Without the "branches:" line, for some reason this will be run whenever a tag is pushed, even if the listed files aren't changed.
branches: ['*']
paths:
- 'doc/**'
- '!doc/*ChangeLog*'
- '!doc/*ChangeSum*'
- '!doc/UpdateChangelog.pl'
# Include all include::ed files outside doc/ directory!
- 'src/README.unit_testing'
- 'tools/README'
- 'doc/testing/*'
- 'doc/Makefile'

pull_request:
# Run on pull requests that change the listed files
paths:
- 'doc/**'
- '!doc/*ChangeLog*'
- '!doc/*ChangeSum*'
- '!doc/UpdateChangelog.pl'
# Include all include::ed files outside doc/ directory!
- 'src/README.unit_testing'
- 'tools/README'
- 'doc/testing/*'
- 'doc/Makefile'

workflow_dispatch:

jobs:
build-docs-omnibus-test:
# Don't run on forks, because part(s) of omnibus testing script will look for
# branch(es) that forks may not have.
if: ${{ github.repository == 'ESCOMP/CTSM' }}

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
lfs: true

- name: Checkout doc-builder external
# Check out all submodules because we might :literalinclude: something from one
- name: Checkout all submodules
run: |
bin/git-fleximod update doc-builder
bin/git-fleximod update -o

# Set up conda
- name: Set up conda environment
Expand All @@ -48,7 +43,6 @@ jobs:
channels: conda-forge
auto-activate-base: false

# TODO: Split testing.sh tests into their own steps in this job
- name: Text Sphinx builds with omnibus script
run: |
cd doc && ./testing.sh
cd doc/testing && ./testing.sh
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
name: Test building docs with ctsm_pylib
name: Docs tests to run when ctsm_pylib is updated

on:
push:
# Run when a change to these files is pushed to any branch. Without the "branches:" line, for some reason this will be run whenever a tag is pushed, even if the listed files aren't changed.
branches: ['*']
paths:
- 'python/conda_env_ctsm_py.txt'
- 'doc/ctsm-docs_container/requirements.txt'
- '.github/workflows/docs-common.yml'
- '.github/workflows/docs-update-dependency-common.yml'

pull_request:
# Run on pull requests that change the listed files
paths:
- 'python/conda_env_ctsm_py.txt'
- 'doc/ctsm-docs_container/requirements.txt'
- '.github/workflows/docs-common.yml'
- '.github/workflows/docs-update-dependency-common.yml'

schedule:
# 8 am every Monday UTC
Expand All @@ -25,14 +29,23 @@ permissions:
jobs:
test-build-docs-ctsm_pylib:
if: ${{ always() }}
name: With ctsm_pylib
name: Build with ctsm_pylib
uses: ./.github/workflows/docs-common.yml
with:
use_conda: true
conda_env_file: python/conda_env_ctsm_py.yml
conda_env_name: ctsm_pylib

# File an issue if the docs build failed during a scheduled run
test-update-dependency:
if: ${{ always() }}
name: Tests for when either docs dependency is updated
uses: ./.github/workflows/docs-update-dependency-common.yml

# File an issue if the docs build failed during a scheduled run.
# The main thing we're concerned about in that case is something having
# changed outside the repository that's causing the ctsm_pylib setup to
# fail. Thus, we don't need this job to wait for BOTH the above jobs---
# if one fails, they both will.
file-issue-on-failure:
if: |
failure() &&
Expand Down
75 changes: 75 additions & 0 deletions .github/workflows/docs-update-dependency-common.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Jobs shared by docs workflows that run when a dependency is updated

on:
workflow_call:
inputs:
# Conda is always needed for both jobs in this workflow. Here,
# we set default values for the variables in case the calling
# workflow doesn't provide them.
conda_env_file:
required: false
type: string
default: "python/conda_env_ctsm_py.yml"
conda_env_name:
required: false
type: string
default: "ctsm_pylib"
secrets: {}

jobs:
compare-docbuilder-vs-ctsmpylib:
# Don't run on forks, because test_container_eq_ctsm_pylib.sh uses
# build_docs_to_publish, which will look for branch(es) that forks
# may not have
if: ${{ github.repository == 'ESCOMP/CTSM' }}

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
lfs: true

# Check out all submodules because we might :literalinclude: something from one
- name: Checkout all submodules
run: |
bin/git-fleximod update -o

- name: Set up conda environment
uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: ${{ inputs.conda_env_name }}
environment-file: ${{ inputs.conda_env_file }}
channels: conda-forge
auto-activate-base: false

- name: Compare docs built with container vs. ctsm_pylib
run: |
cd doc/testing
./test_container_eq_ctsm_pylib.sh

makefile-method:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
lfs: true

# Check out all submodules because we might :literalinclude: something from one
- name: Checkout all submodules
run: |
bin/git-fleximod update -o

- name: Set up conda environment
uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: ${{ inputs.conda_env_name }}
environment-file: ${{ inputs.conda_env_file }}
channels: conda-forge
auto-activate-base: false

- name: Check that Makefile method works
run: |
cd doc/testing
conda run -n ${{ inputs.conda_env_name }} --no-capture-output ./test_makefile_method.sh
43 changes: 43 additions & 0 deletions .github/workflows/docs-update-doc-builder.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Docs tests to run when doc-builder is updated

on:
push:
# Run when a change to these files is pushed to any branch. Without the "branches:" line, for some reason this will be run whenever a tag is pushed, even if the listed files aren't changed.
branches: ['*']
paths:
- 'doc/doc-builder'
- '.github/workflows/docs-update-dependency-common.yml'

pull_request:
# Run on pull requests that change the listed files
paths:
- 'doc/doc-builder'
- '.github/workflows/docs-update-dependency-common.yml'

workflow_dispatch:

permissions:
contents: read
jobs:
test-update-dependency:

name: Tests to run when either docs dependency is updated
uses: ./.github/workflows/docs-update-dependency-common.yml

test-rv-setup:

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
lfs: true

# Check out all submodules because we might :literalinclude: something from one
- name: Checkout all submodules
run: |
bin/git-fleximod update -o

- name: build_docs rv method
run: |
cd doc/testing && ./test_build_docs_-r-v.sh docker
9 changes: 7 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,29 @@ on:
branches: ['*']
paths:
- 'doc/**'
- '!doc/testing/*'
- '!doc/*ChangeLog*'
- '!doc/*ChangeSum*'
- '!doc/UpdateChangelog.pl'
- '.github/workflows/docs-common.yml'
# Include all include::ed files outside doc/ directory!
- 'src/README.unit_testing'
- 'tools/README'
- 'doc/testing/test_container_eq_ctsm_pylib.sh'

pull_request:
# Run on pull requests that change the listed files
paths:
- 'doc/**'
- '!doc/testing/*'
- '!doc/*ChangeLog*'
- '!doc/*ChangeSum*'
- '!doc/UpdateChangelog.pl'
- '.github/workflows/docs-common.yml'
# Include all include::ed files outside doc/ directory!
- 'src/README.unit_testing'
- 'tools/README'
- 'doc/testing/test_container_eq_ctsm_pylib.sh'

workflow_dispatch:

Expand All @@ -49,9 +53,10 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Checkout doc-builder external
# Check out all submodules because we might :literalinclude: something from one
- name: Checkout all submodules
run: |
bin/git-fleximod update doc-builder
bin/git-fleximod update -o

- name: Build docs using Docker (Podman has trouble on GitHub runners)
id: build-docs
Expand Down
2 changes: 1 addition & 1 deletion doc/ctsm-docs_container/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ CMD ["/bin/bash", "-l"]

LABEL org.opencontainers.image.title="Container for building CTSM documentation"
LABEL org.opencontainers.image.source=https://github.com/ESCOMP/CTSM
LABEL org.opencontainers.image.version="v1.0.2c"
LABEL org.opencontainers.image.version="v1.0.2d"
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ There is a menu in the lower left of the webpage that lets readers switch betwee

Note that this is not necessary in order for you to contribute an update to the documentation. GitHub will test this automatically when you open a PR. But if you'd like to try, this will generate a local site for you in ``_publish/`` and then open it:

.. literalinclude:: ../../../testing.sh
.. literalinclude:: ../../../testing/test_container_eq_ctsm_pylib.sh
:start-at: ./build_docs_to_publish
:end-before: VERSION LINKS WILL NOT RESOLVE
:append: CMD _publish/index.html # where CMD is open for Mac or wslview for Windows (Ubuntu VM)
Expand Down
Loading
Loading