-
Notifications
You must be signed in to change notification settings - Fork 114
92 lines (78 loc) · 2.39 KB
/
test-notebooks.yaml
File metadata and controls
92 lines (78 loc) · 2.39 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
name: Test notebooks
on:
push:
branches: [main]
pull_request:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
# TODO: remove once hatch is compatible with virtualenv 21+ (pypa/hatch#2193)
UV_CONSTRAINT: ${{ github.workspace }}/.github/uv-constraints.txt
jobs:
ensure-data-is-cached:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
with:
filter: blob:none
fetch-depth: 0
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: false
python-version: "3.13"
- name: Restore data cache
id: data-cache
uses: actions/cache@v4
with:
path: data # IMPORTANT: this will fail if scanpy.settings.datasetdir default changes
key: data-${{ hashFiles('**/download_data.py') }}
restore-keys: |
data-
enableCrossOsArchive: true
- name: Download datasets
# Always run to ensure any missing files are downloaded
# (restore-keys may provide partial cache)
run: uvx hatch run data:download
test:
needs: [ensure-data-is-cached]
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python: ["3.12"]
steps:
- uses: actions/checkout@v5
with:
submodules: recursive
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python }}
- uses: astral-sh/setup-uv@v7
with:
enable-cache: true
python-version: ${{ matrix.python }}
cache-dependency-glob: pyproject.toml
- name: Restore data cache
id: data-cache
uses: actions/cache@v4
with:
path: data # IMPORTANT: this will fail if scanpy.settings.datasetdir default changes
key: data-${{ hashFiles('**/download_data.py') }}
restore-keys: |
data-
enableCrossOsArchive: true
- name: Create notebooks environment
run: uvx hatch -v env create notebooks
- name: Test notebooks
env:
MPLBACKEND: agg
PLATFORM: ${{ matrix.os }}
DISPLAY: :42
run: |
uvx hatch run notebooks:setup-squidpy-kernel
uvx hatch run notebooks:run-notebooks