88 pull_request :
99
1010env :
11- PYTEST_ADDOPTS : " -v --color=yes"
1211 FORCE_COLOR : " 1"
1312
1413defaults :
@@ -22,31 +21,44 @@ concurrency:
2221 cancel-in-progress : true
2322
2423jobs :
25- pytest :
24+ get-environments :
25+ runs-on : ubuntu-latest
26+ outputs :
27+ envs : ${{ steps.get-envs.outputs.envs }}
28+ steps :
29+ - uses : actions/checkout@v4
30+ with :
31+ filter : blob:none
32+ fetch-depth : 0
33+ - uses : astral-sh/setup-uv@v5
34+ with :
35+ enable-cache : false
36+ - id : get-envs
37+ run : |
38+ ENVS_JSON=$(NO_COLOR=1 uvx hatch env show --json | jq -c 'to_entries
39+ | map(
40+ select(.key | startswith("hatch-test"))
41+ | { name: .key, python: .value.python }
42+ )')
43+ echo "envs=${ENVS_JSON}" | tee $GITHUB_OUTPUT
44+ test :
45+ needs : get-environments
2646 runs-on : ubuntu-latest
2747 strategy :
2848 matrix :
29- include :
30- - python-version : ' 3.12'
31- test-type : coverage
32- - python-version : ' 3.10'
33- test-type : standard
34- - python-version : ' 3.12'
35- dependencies-version : pre-release
36- test-type : strict-warning
37- - python-version : ' 3.10'
38- dependencies-version : minimum
39- test-type : coverage
49+ env : ${{ fromJSON(needs.get-environments.outputs.envs) }}
50+ env : # environment variable for use in codecov’s env_vars tagging
51+ ENV_NAME : ${{ matrix.env.name }}
4052 steps :
4153 - uses : actions/checkout@v4
4254 with :
4355 fetch-depth : 0
4456 filter : blob:none
4557
46- - name : Set up Python ${{ matrix.python-version }}
58+ - name : Set up Python ${{ matrix.env. python }}
4759 uses : actions/setup-python@v5
4860 with :
49- python-version : ${{ matrix.python-version }}
61+ python-version : ${{ matrix.env. python }}
5062
5163 - name : Install UV
5264 uses : astral-sh/setup-uv@v5
@@ -55,44 +67,20 @@ jobs:
5567 cache-dependency-glob : pyproject.toml
5668
5769 - name : Install dependencies
58- if : matrix.dependencies-version == null
59- run : uv pip install --system --compile "anndata[dev,test] @ ." -c ci/constraints.txt
60-
61- - name : Install minimum dependencies
62- if : matrix.dependencies-version == 'minimum'
63- run : |
64- uv pip install --system --compile tomli packaging
70+ run : uvx hatch -v env create ${{ matrix.env.name }}
6571
66- deps=$(python3 ci/scripts/min-deps.py pyproject.toml --extra dev test)
67- uv pip install --system --compile $deps "anndata @ ."
72+ - name : Run tests
73+ run : uvx hatch run ${{ matrix.env.name }}:run-cov -v --color=yes -n auto --cov --cov-report=xml --junitxml=test-data/test-results.xml
6874
69- - name : Install dependencies release candidates
70- if : matrix.dependencies-version == 'pre-release'
71- run : uv pip install -v --system --compile --pre "anndata[dev,test] @ ." -c ci/constraints.txt
72-
73- - name : Display installed versions
74- run : uv pip list
75-
76- - name : Run Pytest
77- if : matrix.test-type == 'standard'
78- run : pytest -n auto
79-
80- - name : Run Pytest (coverage)
81- if : matrix.test-type == 'coverage'
82- run : coverage run -m pytest -n auto --cov --cov-report=xml
83-
84- - name : Run Pytest (treat warnings as errors)
85- if : matrix.test-type == 'strict-warning'
86- run : pytest --strict-warnings -n auto
87-
88- - uses : codecov/codecov-action@v4
89- if : matrix.test-type == 'coverage'
75+ - name : Upload coverage data
76+ uses : codecov/codecov-action@v5
9077 with :
9178 token : ${{ secrets.CODECOV_TOKEN }}
79+ env_vars : ENV_NAME
9280 fail_ci_if_error : true
9381 files : test-data/coverage.xml
9482
95- check- build :
83+ build :
9684 runs-on : ubuntu-22.04
9785 steps :
9886 - uses : actions/checkout@v4
@@ -122,3 +110,15 @@ jobs:
122110 run : |
123111 pip install dist/*.whl
124112 python -c 'import anndata; print(anndata.__version__)'
113+
114+ check :
115+ if : always()
116+ needs :
117+ - get-environments
118+ - test
119+ - build
120+ runs-on : ubuntu-latest
121+ steps :
122+ - uses : re-actors/alls-green@release/v1
123+ with :
124+ jobs : ${{ toJSON(needs) }}
0 commit comments