-
Notifications
You must be signed in to change notification settings - Fork 113
116 lines (103 loc) · 3.03 KB
/
test.yml
File metadata and controls
116 lines (103 loc) · 3.03 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
name: CI
on:
push:
branches:
- main
- "[0-9]+.[0-9]+.x"
pull_request:
env:
PYTEST_ADDOPTS: "-v --color=yes -n auto"
FORCE_COLOR: "1"
MPLBACKEND: agg
# It's impossible to ignore SyntaxWarnings for a single module,
# so because leidenalg 0.10.0 has them, we pre-compile things: https://github.com/vtraag/leidenalg/issues/173
UV_COMPILE_BYTECODE: "1"
defaults:
run:
shell: bash -e {0} # -e to fail on error
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- name: hatch-test-py310
os: ubuntu-latest
python: "3.10"
- name: hatch-test-py311
os: ubuntu-latest
python: "3.11"
- name: hatch-test-py312
os: ubuntu-latest
python: "3.12"
- name: hatch-test-py312-pre
os: macos-latest
python: "3.12"
prerelease: "allow"
test-type: coverage
env: # environment variable for use in codecov's env_vars tagging
ENV_NAME: ${{ matrix.name }}
UV_PRERELEASE: ${{ matrix.prerelease || 'disallow' }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
filter: blob:none
- uses: astral-sh/setup-uv@v5
with:
enable-cache: true
python-version: ${{ matrix.python }}
cache-dependency-glob: pyproject.toml
- name: Cache downloaded data
uses: actions/cache@v4
with:
path: .pytest_cache/d/squidpy-data
key: pytest
- name: Install dependencies
run: uvx hatch -v env create ${{ matrix.name }}
- name: Run tests
if: matrix.test-type == null
run: uvx hatch run ${{ matrix.name }}:run
- name: Run tests (coverage)
if: matrix.test-type == 'coverage'
run: uvx hatch run ${{ matrix.name }}:run-cov --cov --cov-report=xml
- name: Archive figures generated during testing
if: always()
uses: actions/upload-artifact@v4
with:
name: visual_test_results_${{ matrix.name }}
path: /home/runner/work/squidpy/squidpy/tests/figures/*
- name: Upload coverage data
if: matrix.test-type == 'coverage'
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
env_vars: ENV_NAME
fail_ci_if_error: true
files: test-data/coverage.xml
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
filter: blob:none
- uses: actions/setup-python@v5
with:
python-version: "3.13"
- uses: astral-sh/setup-uv@v5
with:
enable-cache: false
- run: uvx --from build pyproject-build --sdist --wheel .
- run: uvx twine check dist/*
check:
if: always()
needs:
- test
- build
runs-on: ubuntu-latest
steps:
- uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}