Skip to content

Commit

Permalink
Add Rose and Cylc to testing dependencies for RTW (#3625)
Browse files Browse the repository at this point in the history
  • Loading branch information
ehogan authored May 30, 2024
1 parent a6cf0c1 commit a81586d
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 220 deletions.
50 changes: 22 additions & 28 deletions .github/workflows/rtw-tests.yml → .github/workflows/check-rtw.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,27 @@
# This workflow creates the required Conda environment, performs various
# validation steps for Cylc and Rose, and builds and checks the documentation.
name: rtw-tests
# This workflow performs various validation steps for Cylc and Rose, and
# builds and checks the documentation.
name: Check Recipe Test Workflow (RTW)

# Controls when the action will run
on:
# Triggers the workflow on push or pull request events
# Triggers the workflow on push events
push:
pull_request:
paths:
- esmvaltool/utils/recipe_test_workflow/**

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Required shell entrypoint to have properly configured bash shell
defaults:
run:
shell: bash -l {0}

# A workflow run is made up of one or more jobs that can run
# sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# This workflow contains a single job called "check-rtw"
check-rtw:
# The type of runner that the job will run on
runs-on: ubuntu-latest

Expand All @@ -24,57 +30,45 @@ jobs:
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job
# can access it
- uses: actions/checkout@v2

- name: Create environment
run: |
conda update conda
conda create --name rtw --file .github/workflows/rtw-env/rtw-env.lock
eval "$(conda shell.bash hook)"
conda activate rtw
- uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: esmvaltool
environment-file: environment.yml
miniforge-version: "latest"
miniforge-variant: Mambaforge
use-mamba: true

- name: Validate Cylc workflow
run: |
eval "$(conda shell.bash hook)"
conda activate rtw
cd esmvaltool/utils/recipe_test_workflow/recipe_test_workflow
cylc validate . -O metoffice
- name: Run Cylc configuration linter
run: |
eval "$(conda shell.bash hook)"
conda activate rtw
cd esmvaltool/utils/recipe_test_workflow/recipe_test_workflow
cylc lint
- name: Validate format of Rose configuration files
run: |
eval "$(conda shell.bash hook)"
conda activate rtw
cd esmvaltool/utils/recipe_test_workflow/recipe_test_workflow
output="$(rose config-dump)"
msg="Run 'rose config-dump' to re-dump the Rose configuration files"
msg="${msg} in the common format, then commit the changes."
# The '-z' option returns true if 'output' is empty.
if [[ -z "${output}" ]]; then exit 0; else echo "${msg}" && exit 1; fi
if [[ -z "${output}" ]]; then true; else echo "${msg}" && exit 1; fi
- name: Validate Rose configuration metadata
run: |
eval "$(conda shell.bash hook)"
conda activate rtw
cd esmvaltool/utils/recipe_test_workflow/recipe_test_workflow
rose metadata-check -C meta/
- name: Build documentation
run: |
eval "$(conda shell.bash hook)"
conda activate rtw
cd esmvaltool/utils/recipe_test_workflow/doc
make html
- name: Check for broken links in the documentation
run: |
eval "$(conda shell.bash hook)"
conda activate rtw
cd esmvaltool/utils/recipe_test_workflow/doc
make linkcheck
179 changes: 0 additions & 179 deletions .github/workflows/rtw-env/rtw-env.lock

This file was deleted.

12 changes: 0 additions & 12 deletions .github/workflows/rtw-env/rtw-env.yml

This file was deleted.

3 changes: 3 additions & 0 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ dependencies:
- pytest-metadata >=1.5.1
- pytest-mock
- pytest-xdist
- cylc-flow >=8.2
- cylc-rose
- metomi-rose
# Python packages needed for building docs
- autodocsumm >=0.2.2
- nbsphinx
Expand Down
2 changes: 1 addition & 1 deletion esmvaltool/utils/recipe_test_workflow/doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'sphinx_rtd_theme'
html_theme = 'pydata_sphinx_theme'

# 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
4 changes: 4 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
],
# Test dependencies (unit tests)
# Execute `pip install .[test]` once and then use `pytest` to run tests
# or the Recipe Test Workflow (RTW) to run the recipe tests
'test': [
'flake8',
'pytest>=3.9,!=6.0.0rc1,!=6.0.0',
Expand All @@ -86,6 +87,9 @@
'pytest-metadata>=1.5.1',
'pytest-mock',
'pytest-xdist',
'cylc-flow>=8.2',
'cylc-rose',
'metomi-rose',
],
# Documentation dependencies
'doc': [
Expand Down

0 comments on commit a81586d

Please sign in to comment.