1- name : CI (conda + mamba via setup-miniconda)
1+ name : CI
22
33on :
44 push :
99jobs :
1010 test :
1111 runs-on : ubuntu-latest
12+ defaults :
13+ run :
14+ shell : bash -l {0} # Use login shell for all steps
15+
1216 steps :
13- - uses : actions/checkout@v4
17+ - name : Checkout repository
18+ uses : actions/checkout@v4
1419
15- - name : Set up Miniconda (with conda-forge channel)
16- uses : conda-incubator/setup-miniconda@v2
20+ - name : Set up Mambaforge
21+ uses : conda-incubator/setup-miniconda@v3
1722 with :
1823 python-version : " 3.11"
19- channels : " conda-forge,defaults"
24+ environment-file : environment.yml # Use the main environment file
25+ mamba-version : " *"
26+ activate-environment : planetquery
2027 auto-update-conda : true
21- # do not pin mamba-version to avoid "package not found" errors
22-
23- - name : Create CI conda env with mamba
24- shell : bash -l {0}
25- run : |
26- # create an environment with mamba (conda-forge)
27- mamba create -n ci-env -y -c conda-forge \
28- python=3.11 ipywidgets ipyleaflet pytest ruff pip \
29- numpy pandas xarray rioxarray rasterio geopandas shapely matplotlib
30- source "$(conda info --base)/etc/profile.d/conda.sh"
31- conda activate ci-env
32- python -m pip install -e .
33-
34- - name : Lint (ruff)
35- shell : bash -l {0}
36- run : |
37- source "$(conda info --base)/etc/profile.d/conda.sh"
38- conda activate ci-env
39- python -m ruff check .
40-
41- - name : Run tests (pytest)
42- shell : bash -l {0}
43- run : |
44- source "$(conda info --base)/etc/profile.d/conda.sh"
45- conda activate ci-env
46- pytest -q
28+ channel-priority : " strict"
29+
30+ - name : Install test dependencies
31+ run : mamba install -y pytest ruff
32+
33+ - name : Install local package
34+ run : python -m pip install -e . --no-deps
35+
36+ - name : Lint with Ruff
37+ run : ruff check .
38+
39+ - name : Run tests with Pytest
40+ run : pytest
0 commit comments