11---
22version : 2.1
33
4- orbs :
5- coverage-reporter : codacy/coverage-reporter@13.13.0
6-
74commands :
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
0 commit comments