22version : 2.1
33
44orbs :
5- coverage-reporter : codacy/coverage-reporter@13.13 .0
5+ pixi : prefix-dev/pixi@0.1 .0
66
7- commands :
8-
9- check_changes :
7+ jobs :
8+ tests :
9+ # Run tests
10+ docker :
11+ - image : cimg/base:current
12+ resource_class : large
1013 steps :
14+ - checkout
15+ - pixi/pixi_setup
1116 - run :
12- name : Check whether or not installation tests are needed
13- command : |
14- if (test "$CIRCLE_BRANCH" = main ||
15- git --no-pager diff --name-only origin/main... |
16- grep -q -E -f .circleci/install_triggers)
17- then
18- echo Running installation tests
19- else
20- echo Skipping installation tests
21- circleci step halt
22- fi
23-
24- log_versions :
25- steps :
17+ name : Check dependencies are compatible
18+ command : pixi run --as-is pip check
2619 - run :
27- name : Log versions
28- command : |
29- . /opt/conda/etc/profile.d/conda.sh
30- conda env export --name base > /logs/base_environment.yml
31- conda activate esmvaltool
32- esmvaltool version
33- dpkg -l > /logs/versions.txt
34- conda env export > /logs/environment.yml
35- pip freeze > /logs/requirements.txt
36-
37- test_and_report :
38- steps :
20+ name : Check code formatting and mistakes
21+ command : pixi run --as-is pre-commit run --all
3922 - run :
4023 name : Run tests
4124 command : |
42- . /opt/conda/etc/profile.d/conda.sh
43- conda activate esmvaltool
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,197 +49,64 @@ 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 << 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 .[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- conda env create -n esmvaltool -f environment.yml --verbose
207- conda activate esmvaltool
208- mamba list >> /logs/conda.txt
209- pip install --editable .[develop]
210- git clone https://github.com/ESMValGroup/ESMValCore $HOME/ESMValCore
211- pip install --editable $HOME/ESMValCore[develop]
212- - log_versions
213- - 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
21474 - run :
21575 name : Run recipes
21676 command : |
217- . /opt/conda/etc/profile.d/conda.sh
218- conda activate esmvaltool
219- mkdir -p ~/climate_data
220- esmvaltool config get_config_user
221- echo "search_esgf: when_missing" >> ~/.config/esmvaltool/config-user.yml
222- cat ~/.config/esmvaltool/config-user.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+ '
22389 for recipe in esmvaltool/recipes/testing/recipe_*.yml; do
224- esmvaltool run "$recipe"
90+ esmvaltool run --max-parallel-tasks=2 "$recipe"
22591 done
22692 - store_artifacts :
22793 path : /root/esmvaltool_output
22894 - save_cache :
22995 key : test-upstream-{{ .Branch }}-{{ checksum "cache_key.txt" }}
23096 paths :
231- - /opt/conda/pkgs
232- - /root/.cache/pip
23397 - /root/climate_data
23498
23599 build_documentation :
236100 # Test building documentation
237101 docker :
238- - image : condaforge/miniforge3:latest
239- resource_class : medium
102+ - image : cimg/base:current
103+ resource_class : medium+
240104 steps :
241105 - checkout
106+ - pixi/pixi_setup
242107 - run :
243- command : |
244- mkdir /logs
245- . /opt/conda/etc/profile.d/conda.sh
246- # Install
247- conda env create -n esmvaltool -f environment_python.yml
248- conda activate esmvaltool
249- pip install .[doc]
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.11 ' >> /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:
285137workflows :
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
0 commit comments