Skip to content

Commit 7687b15

Browse files
committed
add ci/requirements/environment.yml
1 parent edbb6b4 commit 7687b15

File tree

2 files changed

+69
-98
lines changed

2 files changed

+69
-98
lines changed

.github/workflows/ci.yaml

Lines changed: 17 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
pull_request:
77
branches:
88
- "main"
9-
workflow_dispatch: # allows you to trigger manually
9+
workflow_dispatch: # Allows manual trigger
1010

1111
concurrency:
1212
group: ${{ github.workflow }}-${{ github.ref }}
@@ -17,7 +17,7 @@ env:
1717

1818
jobs:
1919
detect-ci-trigger:
20-
name: detect ci trigger
20+
name: Detect CI Trigger
2121
runs-on: ubuntu-latest
2222
if: |
2323
github.repository == 'simonbesnard1/gedidb'
@@ -32,96 +32,28 @@ jobs:
3232
id: detect-trigger
3333
with:
3434
keyword: "[skip-ci]"
35+
3536
test:
36-
name: ${{ matrix.os }} py${{ matrix.python-version }} ${{ matrix.env }}
37-
runs-on: ${{ matrix.os }}
37+
name: "Ubuntu-latest Python 3.10"
38+
runs-on: ubuntu-latest
3839
needs: detect-ci-trigger
3940
if: needs.detect-ci-trigger.outputs.triggered == 'false'
40-
env:
41-
ZARR_V3_EXPERIMENTAL_API: 1
42-
defaults:
43-
run:
44-
shell: bash -l {0}
45-
strategy:
46-
fail-fast: false
47-
matrix:
48-
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
49-
# Bookend python versions
50-
python-version: ["3.10", "3.13"]
51-
env: [""]
52-
include:
53-
# Minimum python version:
54-
- env: "bare-minimum"
55-
python-version: "3.10"
56-
os: ubuntu-latest
57-
- env: "min-all-deps"
58-
python-version: "3.10"
59-
os: ubuntu-latest
60-
# Latest python version:
61-
- env: "all-but-numba"
62-
python-version: "3.13"
63-
os: ubuntu-latest
64-
- env: "all-but-dask"
65-
python-version: "3.12"
66-
os: ubuntu-latest
67-
- env: "flaky"
68-
python-version: "3.13"
69-
os: ubuntu-latest
41+
7042
steps:
71-
- uses: actions/checkout@v4
43+
- name: Checkout Code
44+
uses: actions/checkout@v4
7245
with:
73-
fetch-depth: 0 # Fetch all history for all branches and tags.
74-
- name: Set environment variables
75-
run: |
76-
echo "TODAY=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
77-
78-
if [[ ${{ matrix.os }} == windows* ]] ;
79-
then
80-
if [[ ${{ matrix.python-version }} != "3.14" ]]; then
81-
echo "CONDA_ENV_FILE=ci/requirements/environment-windows.yml" >> $GITHUB_ENV
82-
else
83-
echo "CONDA_ENV_FILE=ci/requirements/environment-windows-3.14.yml" >> $GITHUB_ENV
84-
fi
85-
elif [[ "${{ matrix.env }}" != "" ]] ;
86-
then
87-
if [[ "${{ matrix.env }}" == "flaky" ]] ;
88-
then
89-
echo "CONDA_ENV_FILE=ci/requirements/environment.yml" >> $GITHUB_ENV
90-
echo "PYTEST_ADDOPTS=-m 'flaky or network' --run-flaky --run-network-tests -W default" >> $GITHUB_ENV
91-
else
92-
echo "CONDA_ENV_FILE=ci/requirements/${{ matrix.env }}.yml" >> $GITHUB_ENV
93-
fi
94-
if [[ "${{ matrix.env }}" == "min-all-deps" ]] ;
95-
then
96-
# Don't raise on warnings
97-
echo "PYTEST_ADDOPTS=-W default" >> $GITHUB_ENV
98-
fi
99-
else
100-
if [[ ${{ matrix.python-version }} != "3.14" ]]; then
101-
echo "CONDA_ENV_FILE=ci/requirements/environment.yml" >> $GITHUB_ENV
102-
else
103-
echo "CONDA_ENV_FILE=ci/requirements/environment-3.14.yml" >> $GITHUB_ENV
104-
fi
105-
fi
106-
107-
echo "PYTHON_VERSION=${{ matrix.python-version }}" >> $GITHUB_ENV
46+
fetch-depth: 0
10847

10948
- name: Setup micromamba
11049
uses: mamba-org/setup-micromamba@v2
11150
with:
112-
environment-file: ${{ env.CONDA_ENV_FILE }}
51+
environment-file: ci/requirements/environment.yml
11352
environment-name: gedidb-tests
11453
cache-environment: true
115-
cache-environment-key: "${{runner.os}}-${{runner.arch}}-py${{matrix.python-version}}-${{env.TODAY}}-${{hashFiles(env.CONDA_ENV_FILE)}}"
54+
cache-environment-key: "ubuntu-latest-py3.10-${{ hashFiles('ci/requirements/environment.yml') }}"
11655
create-args: >-
117-
python=${{matrix.python-version}}
118-
119-
# We only want to install this on one run, because otherwise we'll have
120-
# duplicate annotations.
121-
- name: Install error reporter
122-
if: ${{ matrix.os }} == 'ubuntu-latest' and ${{ matrix.python-version }} == '3.12'
123-
run: |
124-
python -m pip install pytest-github-actions-annotate-failures
56+
python=3.10
12557
12658
- name: Install gedidb
12759
run: |
@@ -144,17 +76,15 @@ jobs:
14476
save-always: true
14577

14678
- name: Run tests
147-
run: python -m pytest -n 4
148-
--timeout 180
149-
--cov=gedidb
150-
--cov-report=xml
151-
--junitxml=pytest.xml
79+
run: |
80+
python -m pytest -n 4 --timeout 180 \
81+
--cov=gedidb --cov-report=xml --junitxml=pytest.xml
15282
15383
- name: Upload test results
15484
if: always()
15585
uses: actions/upload-artifact@v4
15686
with:
157-
name: Test results for ${{ runner.os }}-${{ matrix.python-version }} ${{ matrix.env }}
87+
name: Test results
15888
path: pytest.xml
15989

16090
- name: Upload code coverage to Codecov
@@ -166,15 +96,4 @@ jobs:
16696
flags: unittests
16797
env_vars: RUNNER_OS,PYTHON_VERSION
16898
name: codecov-umbrella
169-
fail_ci_if_error: false
170-
171-
event_file:
172-
name: "Event File"
173-
runs-on: ubuntu-latest
174-
if: github.repository == 'simonbesnard1/gedidb'
175-
steps:
176-
- name: Upload
177-
uses: actions/upload-artifact@v4
178-
with:
179-
name: Event File
180-
path: ${{ github.event_path }}
99+
fail_ci_if_error: false

ci/requirements/environment.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: gedidb-tests
2+
channels:
3+
- conda-forge
4+
- nodefaults
5+
dependencies:
6+
- aiobotocore
7+
- array-api-strict
8+
- boto3
9+
- bottleneck
10+
- cartopy
11+
- cftime
12+
- dask
13+
- distributed
14+
- flox
15+
- fsspec
16+
- geopandas
17+
- h5netcdf
18+
- h5py
19+
- hdf5
20+
- hypothesis
21+
- lxml # Optional dep of pydap
22+
- matplotlib-base
23+
- nc-time-axis
24+
- netcdf4
25+
- numba
26+
- numbagg
27+
- numexpr
28+
- numpy>=2
29+
- opt_einsum
30+
- packaging
31+
- pandas
32+
- pip
33+
- pooch
34+
- pre-commit
35+
- pyarrow # pandas raises a deprecation warning without this, breaking doctests
36+
- pydap
37+
- pydap-server
38+
- pytest
39+
- pytest-cov
40+
- pytest-env
41+
- pytest-xdist
42+
- pytest-timeout
43+
- requests
44+
- retry
45+
- scipy
46+
- sparse
47+
- tiledb
48+
- toolz
49+
- typing_extensions
50+
- xarray
51+
- pip:
52+
- jax # no way to get cpu-only jaxlib from conda if gpu is present

0 commit comments

Comments
 (0)