Repository navigation
124 lines (105 loc) · 4.49 KB
/
Copy pathtests.yml
File metadata and controls
124 lines (105 loc) · 4.49 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
124
name: Tests
on:
push:
branches: [ main, copilot/** ]
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
distribution:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.12"
- name: Install distribution validators
run: python -m pip install build "twine>=7,<8" uv
- name: Verify the generated dependency lock matches declarations
run: uv lock --check --no-python-downloads
- name: Build release artifacts
run: python -m build
- name: Validate release artifacts
run: python -m twine check dist/*
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.11", "3.12"]
steps:
- name: Checkout code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
# Install the package with dev dependencies
pip install -e ".[dev]"
- name: Verify installation
run: |
python -c "import polystore; print(f'polystore {polystore.__version__} installed successfully')"
python -c "from polystore import FileManager, MemoryBackend, DiskBackend; print('All imports successful')"
- name: Lint with ruff
run: |
ruff check src/ tests/ || true
- name: Format check with black
run: |
black --check src/ tests/ || true
- name: Run tests with coverage
run: |
python -m pytest --cov=polystore --cov-report=term-missing --cov-report=xml -v
- name: Upload coverage to Codecov
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12'
continue-on-error: true
uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7.1.1
with:
file: ./coverage.xml
fail_ci_if_error: false
zarr-minimum:
name: Zarr minimum stack (Python 3.11)
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.11"
- name: Install the minimum supported Zarr stack
run: |
python -m pip install --upgrade pip
python -m pip install -e ".[dev]" -c tests/constraints/zarr-minimum.txt
python -m pip check
- name: Exercise both storage formats and every configured codec
run: python -m pytest tests/test_zarr_backend.py tests/test_zarr_batch.py tests/test_ome_zarr_storage.py tests/test_ome_zarr_metadata.py --no-cov -v
imagej-runtime:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up Python 3.12
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.12"
- name: Cache the declared JDK and ImageJ artifacts
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ~/.cache/polystore
key: ${{ runner.os }}-polystore-imagej-${{ hashFiles('src/polystore/imagej_distribution.py', 'src/polystore/imagej_runtime.py') }}
- name: Install the Bio-Formats integration
run: |
python -m pip install --upgrade pip
pip install -e ".[bioformats,dev]"
# Tests forbid downloads (tests/conftest.py), so the bundle cache is
# filled here, outside pytest, when actions/cache restores nothing.
- name: Prepare the declared Fiji bundle cache
run: python -c "from polystore.imagej_runtime import FIJI_IMAGEJ_RUNTIME; print(FIJI_IMAGEJ_RUNTIME.distribution.materialize().imagej_directory)"
- name: Resolve and initialize the declared Fiji runtime
env:
POLYSTORE_LIVE_IMAGEJ_TEST: "1"
run: python -m pytest tests/integration/test_imagej_runtime_live.py --no-cov -v