-
Notifications
You must be signed in to change notification settings - Fork 9
205 lines (189 loc) · 5.48 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
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
# This file was originally generated by maturin v0.14.17
name: CI3
on:
push:
schedule:
- cron: '0 0 1 * *'
pull_request:
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
permissions:
contents: read
jobs:
test_rust:
name: Test Rust
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-13, macos-14]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Rust (Pinned Version)
uses: dtolnay/rust-toolchain@1.81.0
with:
components: clippy, rustfmt, rust-src
- name: Run Clippy (strict for this pinned version of Rust)
run: cargo clippy --all-targets --all-features -- -D warnings
- name: Set up Rust (Latest Stable)
uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt, rust-src
- name: Run Clippy (lenient for latest version)
run: cargo clippy --all-targets --all-features -- -A warnings || echo "Clippy warnings from the latest version"
- name: Test Rust no-default-features
run: cargo test --verbose --no-default-features
- name: Test Rust default features
run: cargo test --verbose
macos:
runs-on: macos-13
strategy:
matrix:
target: [x86_64, aarch64]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: |
3.10
3.11
3.12
3.13
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
args: --release --out dist --find-interpreter
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: wheels
path: dist
linux:
runs-on: ubuntu-latest
strategy:
matrix:
target: [x86_64, aarch64]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: |
3.10
3.11
3.12
3.13
- name: Install cross-compilation dependencies
if: matrix.target == 'aarch64'
run: |
sudo apt-get update
sudo apt-get install -y gcc-aarch64-linux-gnu
- name: Build wheels for aarch64
if: matrix.target == 'aarch64'
env:
CC: aarch64-linux-gnu-gcc
CFLAGS: -march=armv8-a -D__ARM_ARCH=8
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
args: --release --out dist -i python3.10 -i python3.11 -i python3.12 -i python3.13
manylinux: auto
- name: Build wheels for x86_64
if: matrix.target == 'x86_64'
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
args: --release --out dist -i -i python3.10 -i python3.11 -i python3.12 -i python3.13
manylinux: auto
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: wheels
path: dist
windows:
runs-on: windows-latest
strategy:
matrix:
target: [x64]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: |
3.10
3.11
3.12
3.13
architecture: ${{ matrix.target }}
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
args: --release --out dist --find-interpreter
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: wheels
path: dist
sdist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build sdist
uses: PyO3/maturin-action@v1
with:
command: sdist
args: --out dist
- name: Upload sdist
uses: actions/upload-artifact@v3
with:
name: wheels
path: dist
test_python:
name: Test Python
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]
os: [ubuntu-latest, windows-latest, macos-13, macos-14]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Install the latest version of uv
uses: astral-sh/setup-uv@v3
- name: Install Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}
- name: Pinned Ruff
run: uvx ruff@0.6.9 check bed_reader
- name: Lastest Ruff (just to check for warnings)
run: uvx ruff@latest check bed_reader || echo "Ignoring warnings from the latest version of ruff"
- name: Install minimal dependencies
run: uv sync --extra min_dev
- name: Run min tests
shell: bash
run: |
if [[ "$RUNNER_OS" != "Windows" ]]; then
source .venv/bin/activate
else
source .venv/Scripts/activate
fi
pytest bed_reader/tests/test_opt_dep.py
- name: Install all dependencies
run: uv sync --all-extras
- name: Run all tests
shell: bash
run: |
if [[ "$RUNNER_OS" != "Windows" ]]; then
source .venv/bin/activate
else
source .venv/Scripts/activate
fi
pytest .