Skip to content

Commit 6dce8bc

Browse files
authored
Merge branch 'main' into cmorize_esacci_permafrost
2 parents b2c0e99 + 6e3d065 commit 6dce8bc

166 files changed

Lines changed: 40751 additions & 3364 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: 50 additions & 202 deletions
Original file line numberDiff line numberDiff line change
@@ -2,58 +2,43 @@
22
version: 2.1
33

44
orbs:
5-
coverage-reporter: codacy/coverage-reporter@13.13.0
5+
pixi: prefix-dev/pixi@0.1.0
66

7-
commands:
8-
check_changes:
7+
jobs:
8+
tests:
9+
# Run tests
10+
docker:
11+
- image: cimg/base:current
12+
resource_class: large
913
steps:
14+
- checkout
15+
- pixi/pixi_setup
1016
- run:
11-
name: Check whether or not installation tests are needed
12-
command: |
13-
if (test "$CIRCLE_BRANCH" = main ||
14-
git --no-pager diff --name-only origin/main... |
15-
grep -q -E -f .circleci/install_triggers)
16-
then
17-
echo Running installation tests
18-
else
19-
echo Skipping installation tests
20-
circleci step halt
21-
fi
22-
23-
log_versions:
24-
steps:
17+
name: Check dependencies are compatible
18+
command: pixi run --as-is pip check
2519
- run:
26-
name: Log versions
27-
command: |
28-
. /opt/conda/etc/profile.d/conda.sh
29-
conda env export --name base > /logs/base_environment.yml
30-
conda activate esmvaltool
31-
esmvaltool version
32-
dpkg -l > /logs/versions.txt
33-
conda env export > /logs/environment.yml
34-
pip freeze > /logs/requirements.txt
35-
36-
test_and_report:
37-
steps:
20+
name: Check code formatting and mistakes
21+
command: pixi run --as-is pre-commit run --all
3822
- run:
3923
name: Run tests
4024
command: |
41-
. /opt/conda/etc/profile.d/conda.sh
42-
conda activate esmvaltool
43-
pip check
44-
pytest -n 4 --junitxml=test-reports/report.xml
25+
pixi run --as-is test -n 4 --durations=10 --junitxml=test-reports/report.xml
26+
- run:
27+
name: Check the command line interface
28+
command: |
29+
source <(pixi shell-hook --as-is)
4530
esmvaltool version
4631
esmvaltool -- --help
4732
esmvaltool develop compare -- --help
48-
ncl -V
49-
cdo --version
5033
- store_test_results:
5134
path: test-reports/report.xml
52-
- store_artifacts:
53-
path: /logs
35+
- run:
36+
# Documentation available at https://docs.codacy.com/coverage-reporter/
37+
name: Upload coverage report to Codacy
38+
command: bash <(curl -Ls https://coverage.codacy.com/get.sh) report -s -r test-reports/coverage.xml
5439
- run:
5540
name: Compress pytest artifacts
56-
command: tar -cvzf pytest.tar.gz -C /tmp/pytest-of-root/ .
41+
command: tar -cvzf pytest.tar.gz -C /tmp/pytest-of-$(whoami)/ .
5742
when: always
5843
- store_artifacts:
5944
path: pytest.tar.gz
@@ -64,161 +49,43 @@ commands:
6449
- store_artifacts:
6550
path: test-reports.tar.gz
6651

67-
test_installation_from_source:
68-
parameters:
69-
extra:
70-
type: string
71-
flags:
72-
type: string
73-
default: ""
74-
steps:
75-
- run:
76-
name: Install git+ssh
77-
environment:
78-
DEBIAN_FRONTEND: noninteractive # needed to install tzdata
79-
command: apt update && apt install -y git ssh
80-
- checkout
81-
- check_changes
82-
- run:
83-
name: Generate cache key
84-
command: date '+%Y-%V' | tee cache_key.txt
85-
- restore_cache:
86-
key: install-<< parameters.extra >>-{{ .Branch }}-{{ checksum "cache_key.txt" }}
87-
- run:
88-
name: Install dependencies
89-
no_output_timeout: 30m
90-
command: |
91-
# Install
92-
. /opt/conda/etc/profile.d/conda.sh
93-
mkdir /logs
94-
mamba --version
95-
conda env create -n esmvaltool -f environment.yml --verbose
96-
conda activate esmvaltool
97-
mamba list >> /logs/conda.txt
98-
pip install --no-deps << parameters.flags >> ".[<<parameters.extra>>]"> /logs/install.txt 2>&1
99-
if [[ "<<parameters.flags>>" != *'--editable'* ]]
100-
then
101-
rm -r esmvaltool
102-
fi
103-
- log_versions
104-
- run:
105-
name: Lint source code
106-
command: |
107-
. /opt/conda/etc/profile.d/conda.sh
108-
conda activate esmvaltool
109-
pre-commit run --all
110-
- test_and_report
111-
- save_cache:
112-
key: install-<< parameters.extra >>-{{ .Branch }}-{{ checksum "cache_key.txt" }}
113-
paths:
114-
- /opt/conda/pkgs
115-
- /root/.cache/pip
116-
- .pytest_cache
117-
118-
jobs:
119-
run_tests:
120-
# Run tests
121-
docker:
122-
- image: esmvalgroup/esmvaltool:development
123-
resource_class: large
124-
steps:
125-
- checkout
126-
- run:
127-
name: Generate cache key
128-
command: date '+%Y-%V' | tee cache_key.txt
129-
- restore_cache:
130-
key: test-{{ .Branch }}-{{ checksum "cache_key.txt" }}
131-
- run:
132-
name: Install dependencies
133-
command: |
134-
set -x
135-
. /opt/conda/etc/profile.d/conda.sh
136-
conda activate esmvaltool
137-
mkdir /logs
138-
pip install --no-deps .[test] > /logs/install.txt 2>&1
139-
- run:
140-
name: Check Python code style and mistakes
141-
command: |
142-
. /opt/conda/etc/profile.d/conda.sh
143-
conda activate esmvaltool
144-
pre-commit run --all
145-
- run:
146-
name: Remove source code to test the installed software
147-
command: rm -r esmvaltool
148-
- test_and_report
149-
- save_cache:
150-
key: test-{{ .Branch }}-{{ checksum "cache_key.txt" }}
151-
paths:
152-
- /root/.cache/pip
153-
- .pytest_cache
154-
- coverage-reporter/send_report:
155-
coverage-reports: "test-reports/coverage.xml"
156-
project-token: $CODACY_PROJECT_TOKEN
157-
skip: true # skip if project-token is not defined (i.e. on a fork)
158-
159-
test_installation_from_source_test_mode:
160-
# Test installation from source
161-
docker:
162-
- image: condaforge/miniforge3:latest
163-
resource_class: large
164-
steps:
165-
- test_installation_from_source:
166-
extra: test
167-
168-
test_installation_from_source_develop_mode:
169-
# Test development installation
170-
docker:
171-
- image: condaforge/miniforge3:latest
172-
resource_class: large
173-
steps:
174-
- test_installation_from_source:
175-
extra: develop
176-
flags: "--editable"
177-
17852
test_upstream_development:
17953
# Test running recipes with the development version of ESMValCore. The
18054
# purpose of this test to discover backward-incompatible changes early on in
18155
# the development cycle.
18256
docker:
183-
- image: condaforge/miniforge3:latest
57+
- image: cimg/base:current
18458
resource_class: large
18559
steps:
186-
- run:
187-
name: Install git and ssh
188-
environment:
189-
DEBIAN_FRONTEND: noninteractive # needed to install tzdata
190-
command: apt update && apt install -y git ssh
19160
- checkout
19261
- run:
19362
name: Generate cache key
19463
command: echo $(date '+%Y')-$(expr $(date '+%V') / 2) | tee cache_key.txt
19564
- restore_cache:
19665
key: test-upstream-{{ .Branch }}-{{ checksum "cache_key.txt" }}
66+
- pixi/pixi_setup:
67+
env: esmvalcore-dev
19768
- run:
198-
name: Install
199-
no_output_timeout: 30m
69+
name: Run tests
20070
command: |
201-
# Install according to instructions on readthedocs with the
202-
# development version of ESMValTool and ESMValCore:
203-
# https://docs.esmvaltool.org/en/latest/quickstart/installation.html#install-from-source
204-
. /opt/conda/etc/profile.d/conda.sh
205-
mkdir /logs
206-
# Temporarily install intake-esgf here until it is an ESMValCore dependency in v2.14.
207-
echo " - intake-esgf" >> environment.yml
208-
conda env create -n esmvaltool -f environment.yml --verbose
209-
conda activate esmvaltool
210-
mamba list >> /logs/conda.txt
211-
pip install --no-deps --editable .[develop]
212-
git clone https://github.com/ESMValGroup/ESMValCore $HOME/ESMValCore
213-
pip install --no-deps --editable $HOME/ESMValCore[develop]
214-
- log_versions
215-
- test_and_report
71+
pixi run --as-is --environment esmvalcore-dev test -n 4 --junitxml=test-reports/report.xml
72+
- store_test_results:
73+
path: test-reports/report.xml
21674
- run:
21775
name: Run recipes
21876
command: |
219-
. /opt/conda/etc/profile.d/conda.sh
220-
conda activate esmvaltool
221-
esmvaltool config copy data-esmvalcore-esgf.yml
77+
source <(pixi shell-hook --as-is --environment esmvalcore-dev)
78+
# Temporarily install intake-esgf here until there is a new release
79+
# that includes https://github.com/esgf2-us/intake-esgf/pull/160.
80+
pip install git+https://github.com/esgf2-us/intake-esgf@main
81+
esmvaltool version
82+
esmvaltool config copy data-intake-esgf.yml
83+
python -c '
84+
import intake_esgf
85+
intake_esgf.conf["solr_indices"]["esgf.ceda.ac.uk"] = True
86+
intake_esgf.conf["solr_indices"]["esgf-data.dkrz.de"] = True
87+
intake_esgf.conf.save()
88+
'
22289
for recipe in esmvaltool/recipes/testing/recipe_*.yml; do
22390
esmvaltool run --max-parallel-tasks=2 "$recipe"
22491
done
@@ -227,34 +94,19 @@ jobs:
22794
- save_cache:
22895
key: test-upstream-{{ .Branch }}-{{ checksum "cache_key.txt" }}
22996
paths:
230-
- /opt/conda/pkgs
231-
- /root/.cache/pip
23297
- /root/climate_data
23398

23499
build_documentation:
235100
# Test building documentation
236101
docker:
237-
- image: condaforge/miniforge3:latest
238-
resource_class: medium
102+
- image: cimg/base:current
103+
resource_class: medium+
239104
steps:
240105
- checkout
106+
- pixi/pixi_setup
241107
- run:
242-
command: |
243-
mkdir /logs
244-
. /opt/conda/etc/profile.d/conda.sh
245-
# Install
246-
conda env create -n esmvaltool -f environment_python.yml
247-
conda activate esmvaltool
248-
pip install --no-deps .[doc]
249-
pip check
250-
# Log versions
251-
dpkg -l > /logs/versions.txt
252-
conda env export > /logs/environment.yml
253-
pip freeze > /logs/requirements.txt
254-
# Test building documentation
255-
MPLBACKEND=Agg sphinx-build -W doc/sphinx/source doc/spinx/build
256-
- store_artifacts:
257-
path: /logs
108+
name: Build documentation
109+
command: pixi run --as-is doc --fail-on-warning --show-traceback
258110

259111
test_installation_from_conda:
260112
# Test conda package installation
@@ -269,7 +121,7 @@ jobs:
269121
# Install prerequisites
270122
mkdir /logs
271123
# Install ESMValTool in a new conda environment
272-
mamba create -y --name esmvaltool -c conda-forge esmvaltool 'python=3.12' >> /logs/conda.txt 2>&1
124+
mamba create -y --name esmvaltool -c conda-forge esmvaltool 'python=3.13' >> /logs/conda.txt 2>&1
273125
# Activate the environment
274126
set +x; conda activate esmvaltool; set -x
275127
# Log versions
@@ -285,9 +137,7 @@ jobs:
285137
workflows:
286138
commit:
287139
jobs:
288-
- run_tests
289-
- test_installation_from_source_test_mode
290-
- test_installation_from_source_develop_mode
140+
- tests
291141
nightly:
292142
triggers:
293143
- schedule:
@@ -297,9 +147,7 @@ workflows:
297147
only:
298148
- main
299149
jobs:
300-
- run_tests
301-
- test_installation_from_source_test_mode
302-
- test_installation_from_source_develop_mode
150+
- tests
303151
- test_upstream_development
304152
- build_documentation
305153
- test_installation_from_conda

.circleci/install_triggers

Lines changed: 0 additions & 6 deletions
This file was deleted.

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# SCM syntax highlighting & preventing 3-way merges
2+
pixi.lock merge=binary linguist-language=YAML linguist-generated=true -diff

.github/dependabot.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ updates:
1212
directory: "/"
1313
schedule:
1414
interval: "weekly"
15+
cooldown:
16+
default-days: 7
1517
labels:
1618
- dependencies
1719
- github_actions

.github/workflows/check-rtw.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# This workflow performs various validation steps for Cylc and Rose.
22
name: Check Recipe Test Workflow (RTW)
33

4+
permissions: {}
5+
46
# Controls when the action will run
57
on:
68
# Triggers the workflow on push events
@@ -36,10 +38,12 @@ jobs:
3638
# Checks-out your repository under $GITHUB_WORKSPACE, so your job
3739
# can access it
3840
- name: Checkout repository
39-
uses: actions/checkout@v6
41+
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
42+
with:
43+
persist-credentials: false
4044

4145
- name: Setup Cylc
42-
uses: cylc/setup-cylc@v1
46+
uses: cylc/setup-cylc@99ce72c7841aa3f222420d2df16fa31a31f76fde # v1.0.1
4347
with:
4448
cylc_rose: true
4549

0 commit comments

Comments
 (0)