(fix): Accelerate tests: migrate to Github Actions, remove slow param, parallelize #35
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Python application | |
on: | |
push: | |
branches: | |
- main | |
- "*.*.x" | |
pull_request: | |
branches: | |
- main | |
- "*.*.x" | |
# 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: true | |
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 | |
defaults: | |
run: | |
shell: bash -el {0} | |
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: hynek/setup-cached-uv@v2 | |
with: | |
cache-dependency-path: pyproject.toml | |
- name: Install dependencies | |
if: matrix.dependencies-version == null | |
run: uv pip install --system --compile "anndata[dev,test] @ ." -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 pytest-cov "anndata @ ." | |
- name: Install dependencies release candidates | |
if: matrix.dependencies-version == 'pre-release' | |
run: uv pip install -v --system --compile --pre "anndata[dev,test] @ ." -c ci/constraints.txt | |
- name: Display installed versions | |
run: uv pip list | |
- name: Run Pytest | |
if: matrix.test-type == 'standard' | |
run: pytest -n auto | |
- name: Run Pytest (coverage) | |
if: matrix.test-type == 'coverage' | |
run: pytest --cov --cov-report=xml --cov-context=test | |
- name: Run Pytest (treat warnings as errors) | |
if: matrix.test-type == 'strict-warning' | |
run: pytest --strict-warnings -n auto | |
- uses: codecov/codecov-action@v4 | |
if: matrix.test-type == 'coverage' | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
fail_ci_if_error: true | |
verbose: true | |
check-build: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- 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__)' |