Repository navigation
216 lines (178 loc) · 6.21 KB
/
Copy pathci.yml
File metadata and controls
216 lines (178 loc) · 6.21 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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
name: CI
on:
merge_group:
pull_request:
push:
branches:
- main
schedule:
# At 04:44 on Monday, see https://crontab.guru/
- cron: "44 4 * * 1"
permissions:
contents: read
jobs:
lint:
name: Lint
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Install uv and set the python version
uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e # v6.8.0
with:
python-version: "3.11"
- name: Install lint group
run: uv sync --locked --only-group lint
- name: Run prek
run: |
uv run --locked --only-group lint \
prek -c prek.toml run --all-files --show-diff-on-failure
python_test:
name: Python tests
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-14, ubuntu-latest, windows-latest]
python-version: ["3.11", "3.13"]
exclude:
# There's a bug in Pyranges which means we need to avoid Windows/3.11
# https://github.com/sgkit-dev/vcztools/issues/290
- os: windows-latest
python-version: "3.11"
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
persist-credentials: false
- name: Install bcftools and plink2 (Linux only)
# The bcftools and plink2 validation test files skip cleanly
# via shutil.which on platforms without these binaries, so
# the install runs on Linux only; macOS and Windows leave
# the validation suites as no-ops.
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y bcftools plink2
- name: Install uv
uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e # v6.8.0
with:
python-version: ${{ matrix.python-version }}
- name: Install test dependencies
run: |
uv sync --locked --group test --no-default-groups
# Build the extension module in-place so pytest can find it
uv run python setup.py build_ext --inplace
- name: Run tests
run: |
uv run pytest --cov=vcztools --cov-report=term-missing
c_python_test:
name: CPython interface tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
persist-credentials: false
- name: Install uv and set the python version
uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e # v6.8.0
with:
python-version: "3.11"
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y gcovr
- name: Install python dependencies
run: uv sync --locked --group test --no-default-groups
- name: Build module with coverage
run: |
# Build the extension module in-place so pytest can find it
CFLAGS="--coverage" uv run python setup.py build_ext --inplace
- name: Run tests
run: |
uv run pytest -vs tests/test_cpython_interface.py
- name: Show coverage
run: |
gcovr --filter vcztools
c_test:
name: C tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y ninja-build libcunit1-dev valgrind meson gcovr
- name: Build
working-directory: ./lib
run: |
meson setup -Db_coverage=true build
- name: Tests
working-directory: ./lib
run: |
ninja -C build test
- name: Show coverage
working-directory: ./lib
run: |
ninja -C build coverage-text
cat build/meson-logs/coverage.txt
- name: Valgrind
working-directory: ./lib
run: |
valgrind --leak-check=full --error-exitcode=1 ./build/test_formats
valgrind --leak-check=full --error-exitcode=1 ./build/test_compute
packaging:
name: Packaging
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
persist-credentials: false
- name: Install uv and set the python version
uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e # v6.8.0
with:
python-version: "3.12"
- name: Install packaging deps
run: uv sync --locked --group packaging --no-default-groups
- name: Validate pyproject
run: uv run --locked --group packaging --no-default-groups validate-pyproject pyproject.toml -v
- name: Build artefacts
run: uv build
- name: Twine check
run: uv run --locked --group packaging --no-default-groups twine check --strict dist/*
- name: Install into venv
run: |
uv venv cli-test
uv pip install --python=cli-test dist/*.whl
- name: Check vcztools CLI
run: |
./cli-test/bin/vcztools --help
cd tests
../cli-test/bin/python -m vcztools --help
test-azure-emulator:
name: Test Azure emulator
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
persist-credentials: false
- name: Install uv and set the python version
uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e # v6.8.0
with:
python-version: "3.12"
- name: Set up Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: "22"
- name: Install Azurite
run: npm install -g azurite
- name: Install test dependencies
run: |
uv sync --locked --group test --no-default-groups
- name: Run Azure Icechunk test
run: |
uv run pytest -q tests/test_azure.py