Skip to content

Commit 60034f6

Browse files
authored
Merge branch 'main' into recipe_seaice_areaextents_sh
2 parents f6c682f + 74d7837 commit 60034f6

1,190 files changed

Lines changed: 88051 additions & 40154 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.circleci/config.yml

Lines changed: 42 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
---
22
version: 2.1
33

4-
orbs:
5-
coverage-reporter: codacy/coverage-reporter@13.13.0
6-
74
commands:
8-
95
check_changes:
106
steps:
117
- run:
@@ -41,10 +37,11 @@ commands:
4137
command: |
4238
. /opt/conda/etc/profile.d/conda.sh
4339
conda activate esmvaltool
44-
mamba --version
40+
pip check
4541
pytest -n 4 --junitxml=test-reports/report.xml
4642
esmvaltool version
4743
esmvaltool -- --help
44+
esmvaltool develop compare -- --help
4845
ncl -V
4946
cdo --version
5047
- store_test_results:
@@ -75,7 +72,7 @@ commands:
7572
- run:
7673
name: Install git+ssh
7774
environment:
78-
DEBIAN_FRONTEND: noninteractive # needed to install tzdata
75+
DEBIAN_FRONTEND: noninteractive # needed to install tzdata
7976
command: apt update && apt install -y git ssh
8077
- checkout
8178
- check_changes
@@ -86,14 +83,16 @@ commands:
8683
key: install-<< parameters.extra >>-{{ .Branch }}-{{ checksum "cache_key.txt" }}
8784
- run:
8885
name: Install dependencies
86+
no_output_timeout: 30m
8987
command: |
9088
# Install
9189
. /opt/conda/etc/profile.d/conda.sh
9290
mkdir /logs
93-
mamba env create >> /logs/conda.txt 2>&1
91+
mamba --version
92+
conda env create -n esmvaltool -f environment.yml --verbose
9493
conda activate esmvaltool
95-
pip install << parameters.flags >> ".[<<parameters.extra>>]"> /logs/install.txt 2>&1
96-
esmvaltool install Julia > /logs/install_julia.txt 2>&1
94+
mamba list >> /logs/conda.txt
95+
pip install --no-deps << parameters.flags >> ".[<<parameters.extra>>]"> /logs/install.txt 2>&1
9796
if [[ "<<parameters.flags>>" != *'--editable'* ]]
9897
then
9998
rm -r esmvaltool
@@ -104,7 +103,7 @@ commands:
104103
command: |
105104
. /opt/conda/etc/profile.d/conda.sh
106105
conda activate esmvaltool
107-
flake8 -j 4
106+
pre-commit run --all
108107
- test_and_report
109108
- save_cache:
110109
key: install-<< parameters.extra >>-{{ .Branch }}-{{ checksum "cache_key.txt" }}
@@ -133,32 +132,31 @@ jobs:
133132
. /opt/conda/etc/profile.d/conda.sh
134133
conda activate esmvaltool
135134
mkdir /logs
136-
pip install .[test] > /logs/install.txt 2>&1
137-
esmvaltool install Julia > /logs/install_julia.txt 2>&1
135+
pip install --no-deps .[test] > /logs/install.txt 2>&1
138136
- run:
139137
name: Check Python code style and mistakes
140138
command: |
141139
. /opt/conda/etc/profile.d/conda.sh
142140
conda activate esmvaltool
143-
flake8 -j 4
141+
pre-commit run --all
144142
- run:
145143
name: Remove source code to test the installed software
146144
command: rm -r esmvaltool
147145
- test_and_report
146+
- run:
147+
# Documentation available at https://docs.codacy.com/coverage-reporter/
148+
name: Upload coverage report to Codacy
149+
command: bash <(curl -Ls https://coverage.codacy.com/get.sh) report -s -r test-reports/coverage.xml
148150
- save_cache:
149151
key: test-{{ .Branch }}-{{ checksum "cache_key.txt" }}
150152
paths:
151153
- /root/.cache/pip
152154
- .pytest_cache
153-
- coverage-reporter/send_report:
154-
coverage-reports: 'test-reports/coverage.xml'
155-
project-token: $CODACY_PROJECT_TOKEN
156-
skip: true # skip if project-token is not defined (i.e. on a fork)
157155

158156
test_installation_from_source_test_mode:
159157
# Test installation from source
160158
docker:
161-
- image: condaforge/mambaforge:latest
159+
- image: condaforge/miniforge3:latest
162160
resource_class: large
163161
steps:
164162
- test_installation_from_source:
@@ -167,7 +165,7 @@ jobs:
167165
test_installation_from_source_develop_mode:
168166
# Test development installation
169167
docker:
170-
- image: condaforge/mambaforge:latest
168+
- image: condaforge/miniforge3:latest
171169
resource_class: large
172170
steps:
173171
- test_installation_from_source:
@@ -179,13 +177,13 @@ jobs:
179177
# purpose of this test to discover backward-incompatible changes early on in
180178
# the development cycle.
181179
docker:
182-
- image: condaforge/mambaforge:latest
180+
- image: condaforge/miniforge3:latest
183181
resource_class: large
184182
steps:
185183
- run:
186184
name: Install git and ssh
187185
environment:
188-
DEBIAN_FRONTEND: noninteractive # needed to install tzdata
186+
DEBIAN_FRONTEND: noninteractive # needed to install tzdata
189187
command: apt update && apt install -y git ssh
190188
- checkout
191189
- run:
@@ -195,31 +193,38 @@ jobs:
195193
key: test-upstream-{{ .Branch }}-{{ checksum "cache_key.txt" }}
196194
- run:
197195
name: Install
196+
no_output_timeout: 30m
198197
command: |
199198
# Install according to instructions on readthedocs with the
200199
# development version of ESMValTool and ESMValCore:
201200
# https://docs.esmvaltool.org/en/latest/quickstart/installation.html#install-from-source
202201
. /opt/conda/etc/profile.d/conda.sh
203202
mkdir /logs
204-
mamba env create >> /logs/conda.txt 2>&1
203+
conda env create -n esmvaltool -f environment.yml --verbose
205204
conda activate esmvaltool
206-
pip install --editable .[develop]
207-
esmvaltool install Julia > /logs/install_julia.txt 2>&1
205+
# Temporarily install intake-esgf here until there is a new release
206+
# that includes https://github.com/esgf2-us/intake-esgf/pull/160.
207+
pip install git+https://github.com/esgf2-us/intake-esgf@main
208+
mamba list >> /logs/conda.txt
209+
pip install --no-deps --editable .[develop]
208210
git clone https://github.com/ESMValGroup/ESMValCore $HOME/ESMValCore
209-
pip install --editable $HOME/ESMValCore[develop]
211+
pip install --no-deps --editable $HOME/ESMValCore[develop]
210212
- log_versions
211213
- test_and_report
212214
- run:
213215
name: Run recipes
214216
command: |
215217
. /opt/conda/etc/profile.d/conda.sh
216218
conda activate esmvaltool
217-
mkdir -p ~/climate_data
218-
esmvaltool config get_config_user
219-
echo "search_esgf: when_missing" >> ~/.esmvaltool/config-user.yml
220-
cat ~/.esmvaltool/config-user.yml
219+
esmvaltool config copy data-intake-esgf.yml
220+
python -c '
221+
import intake_esgf
222+
intake_esgf.conf["solr_indices"]["esgf.ceda.ac.uk"] = True
223+
intake_esgf.conf["solr_indices"]["esgf-data.dkrz.de"] = True
224+
intake_esgf.conf.save()
225+
'
221226
for recipe in esmvaltool/recipes/testing/recipe_*.yml; do
222-
esmvaltool run "$recipe"
227+
esmvaltool run --max-parallel-tasks=2 "$recipe"
223228
done
224229
- store_artifacts:
225230
path: /root/esmvaltool_output
@@ -233,18 +238,19 @@ jobs:
233238
build_documentation:
234239
# Test building documentation
235240
docker:
236-
- image: condaforge/mambaforge:latest
237-
resource_class: medium
241+
- image: condaforge/miniforge3:latest
242+
resource_class: medium+
238243
steps:
239244
- checkout
240245
- run:
241246
command: |
242247
mkdir /logs
243248
. /opt/conda/etc/profile.d/conda.sh
244249
# Install
245-
mamba env create
250+
conda env create -n esmvaltool -f environment_python.yml
246251
conda activate esmvaltool
247-
pip install .[doc]
252+
pip install --no-deps .[doc]
253+
pip check
248254
# Log versions
249255
dpkg -l > /logs/versions.txt
250256
conda env export > /logs/environment.yml
@@ -257,7 +263,7 @@ jobs:
257263
test_installation_from_conda:
258264
# Test conda package installation
259265
docker:
260-
- image: condaforge/mambaforge:latest
266+
- image: condaforge/miniforge3:latest
261267
resource_class: large
262268
steps:
263269
- run:
@@ -267,11 +273,9 @@ jobs:
267273
# Install prerequisites
268274
mkdir /logs
269275
# Install ESMValTool in a new conda environment
270-
mamba create -y --name esmvaltool -c conda-forge esmvaltool julia 'python=3.11' >> /logs/conda.txt 2>&1
276+
mamba create -y --name esmvaltool -c conda-forge esmvaltool 'python=3.12' >> /logs/conda.txt 2>&1
271277
# Activate the environment
272278
set +x; conda activate esmvaltool; set -x
273-
# install the Julia dependencies
274-
esmvaltool install Julia > /logs/install_Julia.txt 2>&1
275279
# Log versions
276280
mamba env export > /logs/environment.yml
277281
# Test installation

.circleci/install_triggers

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
^\.circleci/
22
^environment\.yml$
3-
^esmvaltool/install/
43
^pyproject.toml$
54
^setup\.py$
65
^setup\.cfg$

.codacy.yml

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,15 @@
11
# codacy configuration file
2-
32
---
4-
53
engines:
6-
coverage:
7-
enabled: true
8-
exclude_paths: [
9-
'tests',
10-
]
11-
metrics:
12-
enabled: true
13-
duplication:
14-
enabled: true
15-
prospector:
16-
enabled: true
17-
pylint:
18-
enabled: true
19-
python_version: 3
4+
coverage:
5+
exclude_paths: ["tests"]
206

21-
exclude_paths: [
22-
'doc/sphinx/**',
23-
'esmvaltool/cmor/tables/**',
24-
'tests/**'
25-
]
7+
exclude_paths:
8+
[
9+
"archive/**",
10+
"doc/sphinx/**",
11+
"esmvaltool/cmor/tables/**",
12+
"tests/**",
13+
"esmvaltool/utils/recipe_test_workflow/app/configure/bin/test_configure.py",
14+
"esmvaltool/utils/recipe_test_workflow/app/generate_report/bin/test_generate_html_report.py",
15+
]

.dockerignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,3 @@ ESMValTool.egg-info
77

88
!.git
99
!.zenodo.json
10-

.editorconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,3 @@ indent_size = 2
2727

2828
[*.{md,Rmd}]
2929
trim_trailing_whitespace = false
30-

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
esmvaltool/cmorizers @ESMValGroup/obs-maintainers
22
.github/workflows @valeriupredoi
3+
esmvaltool/utils/recipe_test_workflow/ @alistairsellar @ehogan

.github/dependabot.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
5+
6+
version: 2
7+
updates:
8+
# Enable version updates for GitHub Actions
9+
- package-ecosystem: "github-actions"
10+
# Workflow files stored in the default location of `.github/workflows`
11+
# You don't need to specify `/.github/workflows` for `directory`. You can use `directory: "/"`.
12+
directory: "/"
13+
schedule:
14+
interval: "weekly"
15+
labels:
16+
- dependencies
17+
- github_actions
18+
- automatedPR

.github/workflows/check-rtw.yml

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# This workflow performs various validation steps for Cylc and Rose.
2+
name: Check Recipe Test Workflow (RTW)
3+
4+
# Controls when the action will run
5+
on:
6+
# Triggers the workflow on push events
7+
push:
8+
paths:
9+
- esmvaltool/utils/recipe_test_workflow/**
10+
11+
# Schedule this workflow to run at 04:00 every 10 days
12+
schedule:
13+
- cron: '0 4 */10 * *'
14+
15+
# Common variables are defined here
16+
env:
17+
RTW_ROOT_DIR: esmvaltool/utils/recipe_test_workflow
18+
19+
# Required shell entrypoint to have properly configured bash shell
20+
defaults:
21+
run:
22+
shell: bash -l {0}
23+
24+
# A workflow run is made up of one or more jobs that can run
25+
# sequentially or in parallel
26+
jobs:
27+
# This workflow contains a single job called "check-rtw"
28+
check-rtw:
29+
# The type of runner that the job will run on
30+
runs-on: ubuntu-latest
31+
if: github.event_name != 'schedule' || github.repository == 'ESMValGroup/ESMValTool' # avoid scheduled GHAs in forks
32+
33+
# Steps represent a sequence of tasks that will be executed as part
34+
# of the job
35+
steps:
36+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job
37+
# can access it
38+
- name: Checkout repository
39+
uses: actions/checkout@v6
40+
41+
- name: Setup Cylc
42+
uses: cylc/setup-cylc@v1
43+
with:
44+
cylc_rose: true
45+
46+
- name: Validate Cylc workflow
47+
run: |
48+
cd ${RTW_ROOT_DIR}
49+
cylc validate . -O metoffice
50+
51+
- name: Run Cylc configuration linter
52+
run: |
53+
cd ${RTW_ROOT_DIR}
54+
cylc lint
55+
56+
- name: Validate format of Rose configuration files
57+
run: |
58+
cd ${RTW_ROOT_DIR}
59+
output="$(rose config-dump)"
60+
msg="Run 'rose config-dump' to re-dump the Rose configuration files"
61+
msg="${msg} in the common format, then commit the changes."
62+
# The '-z' option returns true if 'output' is empty.
63+
if [[ -z "${output}" ]]; then true; else echo "${msg}" && exit 1; fi
64+
65+
- name: Validate Rose configuration metadata
66+
run: |
67+
cd ${RTW_ROOT_DIR}
68+
rose metadata-check -C meta/
69+
70+
- name: Run Rose configuration validation macros
71+
run: |
72+
cd ${RTW_ROOT_DIR}
73+
rose macro -V
74+
75+
- name: Lint shell scripts
76+
run: |
77+
cd ${RTW_ROOT_DIR}
78+
output=$(find . -name "*.sh" -exec shellcheck {} \;)
79+
if [ "$output" ]; then echo "${output}" && exit 1; fi

0 commit comments

Comments
 (0)