Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
41a66fa
Update conf.py
lee1043 Sep 25, 2024
adf7510
Update and rename utils.rst to api.rst
lee1043 Sep 25, 2024
837733c
Merge pull request #1142 from PCMDI/lee1043-patch-2
lee1043 Sep 25, 2024
61ff114
Update resources.rst
lee1043 Sep 25, 2024
b3f3ca4
Update dev.yml
lee1043 Sep 25, 2024
9162158
Update conf.py
lee1043 Sep 25, 2024
368d278
Update conf.py
lee1043 Sep 25, 2024
78259e5
Update documentation.yaml
lee1043 Sep 25, 2024
0a2f881
Update conf.py
lee1043 Sep 25, 2024
82f68ae
Update documentation.yaml
lee1043 Sep 25, 2024
9b75c64
Update documentation.yaml
lee1043 Sep 25, 2024
b935330
Update api.rst
lee1043 Sep 25, 2024
92d8eeb
Update api.rst
lee1043 Sep 25, 2024
de4b4a9
remove readthedocs components
lee1043 Sep 25, 2024
9ff48bf
add import pcmdi_metrics
lee1043 Sep 25, 2024
1591361
run only when PR merged; add steps to get pcmdi_metrics installed so …
lee1043 Sep 25, 2024
f5b9c6e
refer dev.yml when generating conda env
lee1043 Sep 25, 2024
02825d6
update
lee1043 Sep 25, 2024
a57d7cd
combined to build_workflow.yml
lee1043 Sep 25, 2024
3540742
clean up
lee1043 Sep 25, 2024
901fd59
orgarnize functions into categories
lee1043 Sep 25, 2024
bf3d378
separate ci.yml from dev.yml to make lighter env for build
lee1043 Sep 25, 2024
5dc94cb
add docstrings
lee1043 Sep 25, 2024
f3468f6
add more functions to the list
lee1043 Sep 25, 2024
0130387
add docstrings
lee1043 Sep 25, 2024
867620c
add more functions to the list
lee1043 Sep 25, 2024
d99cf17
rewrite docstring to scipy style
lee1043 Sep 25, 2024
9ea275a
clean up
lee1043 Sep 25, 2024
79e5355
test
lee1043 Sep 25, 2024
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
44 changes: 41 additions & 3 deletions .github/workflows/documentation.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Docs
on: [push, pull_request, workflow_dispatch]
on: [pull_request, workflow_dispatch]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, you will need the push still because push is considered merging a pull request to main via a commit.

A few issues I found:

  1. The current documentation.yaml will rebuild the documentation every time, which overwrites the latest stable version -- set this job to only run when push is initiated (example in e3sm_diags)
  2. There is no versioning of documentation by branch and package version -- consider Read The Docs for this. e3sm_diags uses sphinx-multiversion which involves a complex setup process

Other suggestions:

  1. You can combine documentation.yaml into build_workflow.yaml by creating a separate publish-docs job that only runs with push (example in e3sm_diags)

permissions:
contents: write
jobs:
Expand All @@ -8,9 +8,47 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- name: Install dependencies

- name: Set up Conda Environment
uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: "pcmdi_metrics_dev"
miniforge-variant: Mambaforge
miniforge-version: latest
use-mamba: true
mamba-version: "*"
channel-priority: strict
auto-update-conda: true

# Used for refreshing the cache every 24 hours to avoid inconsistencies of package
# versions between the CI pipeline and local installations.
- name: Get Date
id: get-date
run: echo "today=$(/bin/date -u '+%Y%m%d')" >> $GITHUB_OUTPUT
shell: bash

- name: Cache Conda
uses: actions/cache@v3
with:
path: ${{ env.CONDA }}/envs
key:
conda-${{ runner.os }}--${{ runner.arch }}--${{
steps.get-date.outputs.today }}-${{
hashFiles('conda-env/dev.yml') }}-${{ env.CACHE_NUMBER}}
env:
# Increase this value to reset cache if conda/dev.yml has not changed in the workflow
CACHE_NUMBER: 0

- name: Update environment
run:
mamba env update -n pcmdi_metrics_dev -f conda-env/dev.yml
if: steps.cache.outputs.cache-hit != 'true'

- name: Install pcmdi_metrics
# Source: https://github.com/conda/conda-build/issues/4251#issuecomment-1053460542
run: |
pip install sphinx sphinx_rtd_theme sphinx_book_theme sphinx_autosummary_accessors sphinx-copybutton sphinx-design nbsphinx
python -m pip install --no-build-isolation --no-deps -e .

- name: Sphinx build
run: |
sphinx-build docs _build
Expand Down
Loading