Skip to content

Commit ef41f68

Browse files
committed
Move testing.sh to its own workflow.
1 parent 4607389 commit ef41f68

3 files changed

Lines changed: 56 additions & 10 deletions

File tree

.github/workflows/docs-common.yml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,3 @@ jobs:
7676
else
7777
cd doc && ./build_docs -b ${PWD}/_build -c
7878
fi
79-
80-
# TODO: Split testing.sh tests into their own steps in this job
81-
- name: Text Sphinx builds with omnibus script
82-
if: success() || failure()
83-
run: |
84-
if ${{ inputs.use_conda }}; then
85-
cd doc && conda run -n ${{ inputs.conda_env_name }} ./testing.sh
86-
else
87-
cd doc && ./testing.sh
88-
fi

.github/workflows/docs-omnibus.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Run an omnibus test script for the docs
2+
3+
on:
4+
push:
5+
# 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.
6+
branches: ['*']
7+
paths:
8+
- 'doc/**'
9+
- '!doc/*ChangeLog*'
10+
- '!doc/*ChangeSum*'
11+
- '!doc/UpdateChangelog.pl'
12+
13+
pull_request:
14+
# Run on pull requests that change the listed files
15+
paths:
16+
- 'doc/**'
17+
- '!doc/*ChangeLog*'
18+
- '!doc/*ChangeSum*'
19+
- '!doc/UpdateChangelog.pl'
20+
21+
workflow_dispatch:
22+
23+
jobs:
24+
build-docs-omnibus-test:
25+
runs-on: ubuntu-latest
26+
steps:
27+
- uses: actions/checkout@v4
28+
with:
29+
fetch-depth: 0
30+
lfs: true
31+
32+
- name: Checkout doc-builder external
33+
run: |
34+
bin/git-fleximod update doc-builder
35+
36+
# Set up conda
37+
- name: Set up conda environment
38+
uses: conda-incubator/setup-miniconda@v3
39+
with:
40+
activate-environment: ctsm_pylib
41+
environment-file: python/conda_env_ctsm_py.yml
42+
channels: conda-forge
43+
auto-activate-base: false
44+
45+
# TODO: Split testing.sh tests into their own steps in this job
46+
- name: Text Sphinx builds with omnibus script
47+
if: success() || failure()
48+
run: |
49+
cd doc && conda run -n ctsm_pylib ./testing.sh

doc/testing.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ set -x
55
rm -rf _publish*
66

77
# Build all docs using container
8+
echo "~~~~~ Build all docs using container"
89
# Also do a custom --conf-py-path
910
rm -rf _build _publish
1011
d1="$PWD/_publish_container"
@@ -13,29 +14,35 @@ d1="$PWD/_publish_container"
1314
cp -a _publish "${d1}"
1415

1516
# Build all docs using ctsm_pylib
17+
echo "~~~~~ Build all docs using ctsm_pylib"
1618
rm -rf _build _publish
1719
d2="$PWD/_publish_nocontainer"
1820
conda run -n ctsm_pylib ./build_docs_to_publish -r _build --site-root "$PWD/_publish"
1921
# VERSION LINKS WILL NOT RESOLVE IN _publish_nocontainer
2022
cp -a _publish "${d2}"
2123

2224
# Make sure container version is identical to no-container version
25+
echo "~~~~~ Make sure container version is identical to no-container version"
2326
diff -qr "${d1}" "${d2}"
2427

2528
# Check that -r -v works
29+
echo "~~~~~ Check that -r -v works"
2630
# Also do a custom --conf-py-path
2731
rm -rf _build_docker
2832
./build_docs -r _build_docker -v latest -d -c --conf-py-path doc-builder/test/conf.py --static-path ../_static --templates-path ../_templates
2933

3034
# Check that Makefile method works
35+
echo "~~~~~ Check that Makefile method works"
3136
rm -rf _build
3237
make SPHINXOPTS="-W --keep-going" BUILDDIR=${PWD}/_build html
3338

3439
# Check that -b works
40+
echo "~~~~~ Check that -b works"
3541
rm -rf _build_docker
3642
./build_docs -b _build_docker -d -c
3743

3844
# Check that doc-builder tests pass
45+
echo "~~~~~ Check that doc-builder tests pass"
3946
cd doc-builder/test
4047
conda run -n ctsm_pylib make test
4148

0 commit comments

Comments
 (0)