Skip to content

Commit

Permalink
Replace miniconda by micromamba in CI (#257)
Browse files Browse the repository at this point in the history
Use mamba-org/provision-with-micromamba@main action to avoid installing miniconda, and then install mamba.
  • Loading branch information
aperezhortal committed Jan 28, 2022
1 parent 672a5cc commit 5f162d4
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 28 deletions.
38 changes: 10 additions & 28 deletions .github/workflows/test_pysteps.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
name: Test pysteps

env:
MINIMAL_DEPENDENCIES: cython numpy jsmin jsonschema matplotlib netCDF4 opencv pillow pyproj scipy dask
OPTIONAL_DEPENDENCIES: pyfftw cartopy h5py PyWavelets pandas scikit-image
TEST_DEPENDENCIES: pytest pytest-cov

on:
# Triggers the workflow on push or pull request events but only for the master branch
# Triggers the workflow on push or pull request events to the master branch
push:
branches: [ master ]
pull_request:
Expand Down Expand Up @@ -34,26 +29,16 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Setup Miniconda
uses: conda-incubator/setup-miniconda@v2.0.0
- name: Install mamba and create environment
uses: mamba-org/provision-with-micromamba@main
with:
python-version: ${{ matrix.python-version }}
mamba-version: "*"
auto-update-conda: true
channels: conda-forge
channel-priority: flexible
activate-environment: test-environment
environment-file: ci/ci_test_env.yml
environment-name: test_environment
extra-specs: python=${{ matrix.python-version }}

- name: Install dependencies
env:
PACKAGES: ${{env.MINIMAL_DEPENDENCIES}} ${{env.OPTIONAL_DEPENDENCIES}} ${{env.TEST_DEPENDENCIES}}
run: |
if [ "$RUNNER_OS" == "Windows" ]; then
mamba.bat install --quiet ${{env.PACKAGES}}
else
mamba install --quiet ${{env.PACKAGES}}
fi
pip install -U cookiecutter
- name: Install pygrib (not win)
if: matrix.os != 'windows-latest'
run: mamba install --quiet pygrib

- name: Install pysteps for MacOS
if: matrix.os == 'macos-latest'
Expand All @@ -69,10 +54,6 @@ jobs:
gcc-9 --version || brew install gcc@9
pip install .
- name: Install pygrib (not win)
if: matrix.os != 'windows-latest'
run: conda install --quiet pygrib

- name: Install pysteps
if: matrix.os != 'macos-latest'
working-directory: ${{github.workspace}}
Expand All @@ -87,6 +68,7 @@ jobs:
- name: Check imports
working-directory: ${{github.workspace}}/pysteps_data
run: |
python --version
python -c "import pysteps; print(pysteps.__file__)"
python -c "from pysteps import motion"
python -c "from pysteps.motion import vet"
Expand Down
33 changes: 33 additions & 0 deletions ci/ci_test_env.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# pysteps development environment
name: test_environment
channels:
- conda-forge
- defaults
dependencies:
- python>=3.7
- pip
- mamba
# Minimal dependencies
- numpy
- cython
- jsmin
- jsonschema
- matplotlib
- netCDF4
- opencv
- pillow
- pyproj
- scipy
# Optional dependencies
- dask
- pyfftw
- cartopy
- h5py
- PyWavelets
- pandas
- scikit-image
# Test dependencies
- pytest
- pytest-cov
- pip:
- cookiecutter

0 comments on commit 5f162d4

Please sign in to comment.