Skip to content

Commit

Permalink
try circleci matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
jhkennedy committed Nov 10, 2023
1 parent e17a491 commit 3a2d744
Showing 1 changed file with 44 additions and 25 deletions.
69 changes: 44 additions & 25 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,63 +1,82 @@
version: 2.1

jobs:
build:
docker:
- image: cimg/base:current
user: root
steps:
- checkout

- run:
name: Setup micromamba
shell: /bin/bash -l
command: |
apt update --yes && apt-get upgrade --yes
apt install -y --no-install-recommends wget ca-certificates git
cd $HOME
cd ${HOME}
curl -Ls https://micro.mamba.pm/api/micromamba/linux-64/latest | tar -xvj bin/micromamba
eval "$(${HOME}/bin/micromamba shell hook -s posix)"
PYTHON_VERSION="<< parameters.python-version >>"
sed -i "s/python>=/c python=${PYTHON_VERSION}" environment.yml
micromamba create -f environment.yml
- run:
name: Setup environment
name: Install raider and Check environment
shell: /bin/bash -l
command: |
eval "$($HOME/bin/micromamba shell hook -s posix)"
micromamba create -f environment.yml
micromamba activate RAiDER
pip install coveralls
echo url: https://cds.climate.copernicus.eu/api/v2 > $HOME/.cdsapirc
echo key: $cdsak >> $HOME/.cdsapirc
echo { > $HOME/.ecmwfapirc
echo ' "url": "https://api.ecmwf.int/v1",' >> $HOME/.ecmwfapirc
echo ' "email": "'$ecmwfu'",' >> $HOME/.ecmwfapirc
echo ' "key": "'$ecmwfk'"' >> $HOME/.ecmwfapirc
echo } >> $HOME/.ecmwfapirc
echo url: $NCUMloc > $HOME/.ncmrlogin
echo username: $NCUMu >> $HOME/.ncmrlogin
echo password: $NCUMp >> $HOME/.ncmrlogin
python -m pip install --no-deps .
python -c "import RAiDER; from RAiDER.delay import tropo_delay"
python -c "import RAiDER; from RAiDER.interpolator import interp_along_axis"
python --version
python -c "import numpy; print(numpy.__version__)"
python -c "import pyproj; print(pyproj.__version__)"
- run:
name: Install RAiDER and test the install
name: Setup data stores
shell: /bin/bash -l
command: |
eval "$($HOME/bin/micromamba shell hook -s posix)"
micromamba activate RAiDER
python -m pip install .
python -c "import RAiDER; from RAiDER.delay import tropo_delay"
python -c "import RAiDER; from RAiDER.interpolator import interp_along_axis"
python -c 'from RAiDER.models.credentials import setup_from_env; setup_from_env()'
- run:
name: Run unit tests
shell: /bin/bash -l
command: |
eval "$($HOME/bin/micromamba shell hook -s posix)"
micromamba activate RAiDER
COV_OPTIONS=`python -c "import importlib;print(*(' --cov='+p for p in importlib.util.find_spec('RAiDER').submodule_search_locations))"`
pytest -m "not long" test/ $COV_OPTIONS --cov-report=
- run:
name: Report coverage
shell: /bin/bash -l
command: |
eval "$($HOME/bin/micromamba shell hook -s posix)"
micromamba activate RAiDER
python .circleci/fix_coverage_paths.py .coverage $(pwd)/tools/RAiDER/
coverage report -mi
coveralls
PYTHON_VERSION="<< parameters.python-version >>"
if [ "${PYTHON_VERSION}" == "3.12" ]; then
eval "$($HOME/bin/micromamba shell hook -s posix)"
micromamba activate RAiDER
python -m pip install coveralls
python .circleci/fix_coverage_paths.py .coverage $(pwd)/tools/RAiDER/
coverage report -mi
coveralls
fi
workflows:
all-tests:
jobs:
- build:
matrix:
parameters:
python-version: ["3.9", "3.10", "3.11", "3.12"]

0 comments on commit 3a2d744

Please sign in to comment.