Skip to content

Commit 908397c

Browse files
authored
micromamba in CI (#122)
1 parent 046cf68 commit 908397c

File tree

2 files changed

+54
-145
lines changed

2 files changed

+54
-145
lines changed

.github/workflows/ci-additional.yaml

Lines changed: 0 additions & 105 deletions
This file was deleted.

.github/workflows/ci.yaml

Lines changed: 54 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -32,40 +32,22 @@ jobs:
3232
fetch-depth: 0 # Fetch all history for all branches and tags.
3333
- name: Set environment variables
3434
run: |
35-
echo "CONDA_ENV_FILE=ci/environment.yml" >> $GITHUB_ENV
3635
echo "PYTHON_VERSION=${{ matrix.python-version }}" >> $GITHUB_ENV
37-
- name: Cache conda
38-
uses: actions/cache@v3
39-
with:
40-
path: ~/conda_pkgs_dir
41-
key:
42-
${{ runner.os }}-conda-py${{ matrix.python-version }}-${{
43-
hashFiles('ci/**.yml') }}
44-
- uses: conda-incubator/setup-miniconda@v2
45-
with:
46-
channels: conda-forge
47-
channel-priority: strict
48-
mamba-version: "*"
49-
activate-environment: flox-tests
50-
auto-update-conda: false
51-
python-version: ${{ matrix.python-version }}
52-
use-only-tar-bz2: true
53-
54-
- name: Install conda dependencies
55-
run: |
56-
mamba env update -f $CONDA_ENV_FILE
57-
5836
- name: Set up conda environment
59-
shell: bash -l {0}
37+
uses: mamba-org/provision-with-micromamba@v12
38+
with:
39+
environment-file: ci/environment.yml
40+
environment-name: flox-tests
41+
cache-env: true
42+
extra-specs: |
43+
python="${{ matrix.python-version }}"
44+
- name: Install flox
6045
run: |
6146
python -m pip install -e .
6247
conda list
63-
6448
- name: Run Tests
65-
shell: bash -l {0}
6649
run: |
6750
pytest -n auto --cov=./ --cov-report=xml
68-
6951
- name: Upload code coverage to Codecov
7052
uses: codecov/[email protected]
7153
with:
@@ -75,26 +57,57 @@ jobs:
7557
name: codecov-umbrella
7658
fail_ci_if_error: false
7759

60+
optional-deps:
61+
name: ${{ matrix.env }}
62+
runs-on: ${{ matrix.os }}
63+
defaults:
64+
run:
65+
shell: bash -l {0}
66+
strategy:
67+
fail-fast: false
68+
matrix:
69+
os: ["ubuntu-latest"]
70+
env:
71+
[
72+
"no-xarray",
73+
"no-dask",
74+
"minimal-requirements",
75+
]
76+
steps:
77+
- uses: actions/checkout@v3
78+
with:
79+
fetch-depth: 0 # Fetch all history for all branches and tags.
80+
- name: Set up conda environment
81+
uses: mamba-org/provision-with-micromamba@v12
82+
with:
83+
environment-file: ci/${{ matrix.env }}.yml
84+
environment-name: flox-tests
85+
cache-env: true
86+
extra-specs: |
87+
python="${{ matrix.python-version }}"
88+
- name: Install flox
89+
run: |
90+
python -m pip install --no-deps -e .
91+
- name: Run tests
92+
run: |
93+
python -m pytest -n auto
94+
7895
upstream-dev:
7996
name: upstream-dev
8097
runs-on: ubuntu-latest
98+
defaults:
99+
run:
100+
shell: bash -l {0}
81101
steps:
82102
- uses: actions/checkout@v3
83-
- uses: conda-incubator/setup-miniconda@v2
84-
with:
85-
channels: conda-forge
86-
mamba-version: "*"
87-
activate-environment: flox-tests
88-
auto-update-conda: false
89-
python-version: '3.10'
90103
- name: Set up conda environment
91-
shell: bash -l {0}
92-
run: |
93-
mamba env update -f ci/upstream-dev-env.yml
94-
python -m pip install -e .
95-
conda list
104+
uses: mamba-org/provision-with-micromamba@v12
105+
with:
106+
environment-file: ci/upstream-dev-env.yml
107+
environment-name: flox-tests
108+
extra-specs: |
109+
python="3.10"
96110
- name: Run Tests
97-
shell: bash -l {0}
98111
run: |
99112
pytest -n 2
100113
@@ -110,10 +123,11 @@ jobs:
110123
repository: 'pydata/xarray'
111124
fetch-depth: 0 # Fetch all history for all branches and tags.
112125
- name: Set up conda environment
113-
uses: mamba-org/provision-with-micromamba@de032af7fb3675649f3d4bbdda85178ba412ee41
126+
uses: mamba-org/provision-with-micromamba@v12
114127
with:
115128
environment-file: ci/requirements/environment.yml
116129
environment-name: xarray-tests
130+
cache-env: true
117131
extra-specs: |
118132
python="3.10"
119133
- name: Install xarray

0 commit comments

Comments
 (0)