-
Notifications
You must be signed in to change notification settings - Fork 191
123 lines (102 loc) · 3.47 KB
/
test-cpu.yml
File metadata and controls
123 lines (102 loc) · 3.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
name: CI
on:
push:
branches:
- main
- "[0-9]+.[0-9]+.x"
pull_request:
env:
PYTEST_ADDOPTS: "-v --color=yes -n auto --instafail"
FORCE_COLOR: "1"
defaults:
run:
shell: bash -el {0}
# Cancel the job if new commits are pushed
# https://stackoverflow.com/questions/66335225/how-to-cancel-previous-runs-in-the-pr-when-you-push-new-commitsupdate-the-curre
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: false # TODO: set to `true` again
jobs:
pytest:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- python-version: '3.13'
test-type: coverage
- python-version: '3.11'
test-type: standard
- python-version: '3.13'
dependencies-version: pre-release
test-type: strict-warning
#- python-version: '3.11'
# dependencies-version: minimum
# test-type: coverage
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
filter: blob:none
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install UV
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
cache-dependency-glob: pyproject.toml
- name: Install dependencies
if: matrix.dependencies-version == null
run: uv pip install --system --compile "anndata[dev,test-full] @ ." -c ci/constraints.txt
- name: Install minimum dependencies
if: matrix.dependencies-version == 'minimum'
run: |
uv pip install --system --compile tomli packaging
deps=$(python3 ci/scripts/min-deps.py pyproject.toml --extra dev test)
uv pip install --system --compile $deps "anndata @ ."
- name: Install dependencies release candidates
if: matrix.dependencies-version == 'pre-release'
run: uv pip install -v --system --compile --pre "anndata[dev,test-full] @ ." -c ci/constraints.txt
- name: Display installed versions
run: uv pip list
- name: Run Pytest
if: matrix.test-type == 'standard'
run: pytest
- name: Run Pytest (coverage)
if: matrix.test-type == 'coverage'
run: coverage run -m pytest --cov --cov-report=xml
- name: Run Pytest (treat warnings as errors)
if: matrix.test-type == 'strict-warning'
run: pytest --strict-warnings
- uses: codecov/codecov-action@v4
if: matrix.test-type == 'coverage'
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
files: test-data/coverage.xml
check-build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
filter: blob:none
- name: Set up Python 3.13
uses: actions/setup-python@v5
with:
python-version: '3.13'
- name: Install build tools and requirements
run: |
python -m pip install --upgrade pip
pip install build twine
- name: Display installed versions
run: pip list
- name: Build & Twine check
run: |
python -m build --sdist --wheel .
twine check dist/*
- name: Check runtime version
run: |
pip install dist/*.whl
python -c 'import anndata; print(anndata.__version__)'