Skip to content

Commit 5f162d4

Browse files
authored
Replace miniconda by micromamba in CI (#257)
Use mamba-org/provision-with-micromamba@main action to avoid installing miniconda, and then install mamba.
1 parent 672a5cc commit 5f162d4

File tree

2 files changed

+43
-28
lines changed

2 files changed

+43
-28
lines changed

.github/workflows/test_pysteps.yml

Lines changed: 10 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
11
name: Test pysteps
22

3-
env:
4-
MINIMAL_DEPENDENCIES: cython numpy jsmin jsonschema matplotlib netCDF4 opencv pillow pyproj scipy dask
5-
OPTIONAL_DEPENDENCIES: pyfftw cartopy h5py PyWavelets pandas scikit-image
6-
TEST_DEPENDENCIES: pytest pytest-cov
7-
83
on:
9-
# Triggers the workflow on push or pull request events but only for the master branch
4+
# Triggers the workflow on push or pull request events to the master branch
105
push:
116
branches: [ master ]
127
pull_request:
@@ -34,26 +29,16 @@ jobs:
3429
with:
3530
python-version: ${{ matrix.python-version }}
3631

37-
- name: Setup Miniconda
38-
uses: conda-incubator/setup-miniconda@v2.0.0
32+
- name: Install mamba and create environment
33+
uses: mamba-org/provision-with-micromamba@main
3934
with:
40-
python-version: ${{ matrix.python-version }}
41-
mamba-version: "*"
42-
auto-update-conda: true
43-
channels: conda-forge
44-
channel-priority: flexible
45-
activate-environment: test-environment
35+
environment-file: ci/ci_test_env.yml
36+
environment-name: test_environment
37+
extra-specs: python=${{ matrix.python-version }}
4638

47-
- name: Install dependencies
48-
env:
49-
PACKAGES: ${{env.MINIMAL_DEPENDENCIES}} ${{env.OPTIONAL_DEPENDENCIES}} ${{env.TEST_DEPENDENCIES}}
50-
run: |
51-
if [ "$RUNNER_OS" == "Windows" ]; then
52-
mamba.bat install --quiet ${{env.PACKAGES}}
53-
else
54-
mamba install --quiet ${{env.PACKAGES}}
55-
fi
56-
pip install -U cookiecutter
39+
- name: Install pygrib (not win)
40+
if: matrix.os != 'windows-latest'
41+
run: mamba install --quiet pygrib
5742

5843
- name: Install pysteps for MacOS
5944
if: matrix.os == 'macos-latest'
@@ -69,10 +54,6 @@ jobs:
6954
gcc-9 --version || brew install gcc@9
7055
pip install .
7156
72-
- name: Install pygrib (not win)
73-
if: matrix.os != 'windows-latest'
74-
run: conda install --quiet pygrib
75-
7657
- name: Install pysteps
7758
if: matrix.os != 'macos-latest'
7859
working-directory: ${{github.workspace}}
@@ -87,6 +68,7 @@ jobs:
8768
- name: Check imports
8869
working-directory: ${{github.workspace}}/pysteps_data
8970
run: |
71+
python --version
9072
python -c "import pysteps; print(pysteps.__file__)"
9173
python -c "from pysteps import motion"
9274
python -c "from pysteps.motion import vet"

ci/ci_test_env.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# pysteps development environment
2+
name: test_environment
3+
channels:
4+
- conda-forge
5+
- defaults
6+
dependencies:
7+
- python>=3.7
8+
- pip
9+
- mamba
10+
# Minimal dependencies
11+
- numpy
12+
- cython
13+
- jsmin
14+
- jsonschema
15+
- matplotlib
16+
- netCDF4
17+
- opencv
18+
- pillow
19+
- pyproj
20+
- scipy
21+
# Optional dependencies
22+
- dask
23+
- pyfftw
24+
- cartopy
25+
- h5py
26+
- PyWavelets
27+
- pandas
28+
- scikit-image
29+
# Test dependencies
30+
- pytest
31+
- pytest-cov
32+
- pip:
33+
- cookiecutter

0 commit comments

Comments
 (0)