-
Notifications
You must be signed in to change notification settings - Fork 7
156 lines (151 loc) · 5.18 KB
/
ci.yml
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
name: CI
on:
pull_request:
push:
branches:
- main
jobs:
pre-commit:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- uses: pre-commit/[email protected]
test:
name: Test
runs-on: ${{ matrix.os }}
strategy:
matrix:
# Use macos-13 because pip binary packages for ARM aren't
# available for many dependencies
os: [macos-13, macos-14, ubuntu-latest]
python-version: ["3.9", "3.10", "3.11", "3.12"]
exclude:
# Just run macos tests on one Python version
- os: macos-13
python-version: "3.10"
- os: macos-13
python-version: "3.11"
- os: macos-13
python-version: "3.12"
- os: macos-14
python-version: "3.9"
- os: macos-14
python-version: "3.10"
- os: macos-14
python-version: "3.12"
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install '.[dev]'
- name: Run basic vcf2zarr example
run: |
python -m bio2zarr vcf2zarr convert tests/data/vcf/sample.vcf.gz sample.vcz -f
- name: Run two-pass vcf2zarr example
run: |
python -m bio2zarr vcf2zarr explode tests/data/vcf/sample.vcf.gz sample.icf -f
python -m bio2zarr vcf2zarr encode sample.icf sample.vcz -f
- name: Run distributed explode example
run: |
python -m bio2zarr vcf2zarr dexplode-init tests/data/vcf/sample.vcf.gz sample.icf -fn 3
python -m bio2zarr vcf2zarr dexplode-partition sample.icf 0
python -m bio2zarr vcf2zarr dexplode-partition sample.icf 1
python -m bio2zarr vcf2zarr dexplode-partition sample.icf 2
python -m bio2zarr vcf2zarr dexplode-finalise sample.icf
- name: Run distributed encode example
run: |
python -m bio2zarr vcf2zarr dencode-init sample.icf sample.vcz -fn 3 --variants-chunk-size=3
python -m bio2zarr vcf2zarr dencode-partition sample.vcz 0
python -m bio2zarr vcf2zarr dencode-partition sample.vcz 1
python -m bio2zarr vcf2zarr dencode-partition sample.vcz 2
python -m bio2zarr vcf2zarr dencode-finalise sample.vcz
- name: Run tests
run: |
pytest --cov=bio2zarr
- name: Upload coverage to Coveralls
uses: coverallsapp/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
# The first coveralls upload will succeed and others seem to fail now.
# This is a quick workaround for doing a proper "parallel" setup:
# https://github.com/coverallsapp/github-action
fail-on-error: false
packaging:
name: Packaging
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install build twine validate-pyproject[all]
- name: Check and install package
run: |
validate-pyproject pyproject.toml
python -m build
python -m twine check --strict dist/*
python -m pip install dist/*.whl
- name: Check vcf2zarr CLI
run: |
vcf2zarr --help
python -m bio2zarr vcf2zarr --help
- name: Check vcfpartition CLI
run: |
vcfpartition --help
python -m bio2zarr vcfpartition --help
test-numpy-version:
name: Test numpy versions
runs-on: ubuntu-latest
strategy:
matrix:
numpy: ["==1.26", ">=2"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install '.[dev]'
- name: Install numpy${{ matrix.numpy }}
run: |
python -m pip install 'numpy${{ matrix.numpy }}'
- name: Run tests
run: |
# We just run the CLI tests here because it doesn't require other upstream
# packages like sgkit (which are tangled up with the numpy 2 dependency)
python -m pytest tests/test_cli.py
test-zarr-version:
name: Test Zarr versions
runs-on: ubuntu-latest
strategy:
matrix:
zarr: ["==2.18.3", ">=3"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install '.[dev]'
- name: Install zarr${{ matrix.zarr }}
run: |
python -m pip install 'zarr${{ matrix.zarr }}'
- name: Run tests
run: |
python -m pytest -k "not test_double_encode_partition"