Skip to content

Commit 22b2716

Browse files
committed
simplify, add more pythons, use faster umamba
1 parent ccb9455 commit 22b2716

4 files changed

Lines changed: 17 additions & 63 deletions

File tree

.github/workflows/test.yaml

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -17,36 +17,32 @@ jobs:
1717
fail-fast: false
1818
matrix:
1919
os: ["macos-latest", "ubuntu-latest", "windows-latest"]
20-
python-version: ["3.8", "3.9", "3.10"]
20+
python-version: [ "3.8", "3.9", "3.10" ,"3.11", "3.12" ]
21+
defaults:
22+
run:
23+
shell: bash -l {0}
24+
2125
steps:
2226
- uses: actions/checkout@v4
23-
- name: Cache conda
24-
uses: actions/cache@v4
25-
env:
26-
# Increase this value to reset cache if ci/environment.yml has not changed
27-
CACHE_NUMBER: 0
28-
with:
29-
path: ~/conda_pkgs_dir
30-
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('ci/environment-py${{ matrix.python-version }}.yml') }}
31-
- uses: conda-incubator/setup-miniconda@v3
27+
28+
- name: Setup Micromamba ${{ matrix.python-version }}
29+
uses: mamba-org/setup-micromamba@v1
3230
with:
33-
# mamba-version: "*" # activate this to build with mamba.
34-
python-version: ${{ matrix.python-version }}
35-
miniforge-variant: Mambaforge
36-
channels: conda-forge, defaults # These need to be specified to use mamba
37-
channel-priority: true
38-
environment-file: ci/environment-py${{ matrix.python-version }}.yml
31+
environment-name: TEST
32+
init-shell: bash
33+
create-args: >-
34+
python=${{ matrix.python-version }} pip
35+
--file requirements.txt
36+
--channel conda-forge
3937
40-
activate-environment: test_env_cmocean
41-
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
4238
- name: Set up conda environment
43-
shell: bash -l {0}
4439
run: |
4540
python -m pip install -e . --no-deps --force-reinstall
41+
4642
- name: Run Tests
47-
shell: bash -l {0}
4843
run: |
49-
pytest --cov=./ --cov-report=xml
44+
python -m pytest -rxs --cov=./ --cov-report=xml
45+
5046
- name: Upload code coverage to Codecov
5147
uses: codecov/codecov-action@v4
5248
with:

ci/environment-py3.10.yml

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

ci/environment-py3.8.yml

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

ci/environment-py3.9.yml

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

0 commit comments

Comments
 (0)