-
Notifications
You must be signed in to change notification settings - Fork 32
228 lines (205 loc) · 7.23 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
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
name: CI
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/develop' }}
on:
push:
branches: [ "develop" ]
pull_request: { }
workflow_dispatch: { }
permissions:
actions: read
contents: read
checks: write # audit-check creates checks
issues: write # audit-check creates issues
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
jobs:
python-lint:
name: "Python (lint)"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: spiraldb/actions/.github/actions/[email protected]
- name: Python Lint - Format
run: uv run ruff format --check .
- name: Python Lint - Ruff
run: uv run ruff check .
python-test:
name: "Python (test)"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/cleanup
- uses: rui314/setup-mold@v1
- uses: ./.github/actions/setup-rust
- uses: spiraldb/actions/.github/actions/[email protected]
- name: Pytest - PyVortex
run: |
uv run pytest --benchmark-disable test/
working-directory: pyvortex/
- name: Doctest - PyVortex
run: |
uv run make clean && uv run make doctest
working-directory: docs/
- name: Ensure docs build - PyVortex
run: |
uv run make html
working-directory: docs/
- name: Ensure wheel and sdist can be built on Linux - PyVortex
run: |
# force linux compatibility to ensure there is exactly one wheel ergo no ambiguity in installation
uv run maturin build --interpreter python3.10 --compatibility linux
working-directory: pyvortex/
- name: Ensure wheel can run tests successfully
run: |
set -ex
echo creating a fresh venv which does *not* have the normal dependencies to ensure the wheel dependencies are correct
rm -rf .venv
uv sync --only-dev
uv run pip install target/wheels/vortex_array-*.whl || { uv run pip debug --verbose ; exit 1 ; }
uv run pip install pytest
cd pyvortex/test
uv run pytest
rust-docs:
name: "Rust (docs)"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-rust
- name: Docs
run: cargo doc --no-deps
build-rust:
name: "Rust build (${{matrix.config.name}})"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
config:
- name: "all-features"
command: "build"
args: "--all-features --all-targets"
- name: "default features"
command: "build"
args: "--all-targets"
- name: "with tokio dispatcher"
command: "build"
args: "--no-default-features --features tokio --all-targets --ignore-unknown-features"
- name: "with compio dispatcher"
command: "build"
args: "--no-default-features --features compio --all-targets --ignore-unknown-features"
- name: "with tokio+compio dispatcher"
command: "build"
args: "--no-default-features --features tokio,compio --all-targets --ignore-unknown-features"
- name: "wasm32 with default features"
command: "build"
target: wasm32-unknown-unknown
args: "--target wasm32-unknown-unknown --exclude vortex-roaring --exclude vortex-datafusion "
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/cleanup
- uses: rui314/setup-mold@v1
- uses: ./.github/actions/setup-rust
with:
targets: ${{matrix.config.target || ''}}
- name: Install cargo-hack
uses: taiki-e/install-action@cargo-hack
- name: Rust Build (${{matrix.config.name}})
run: cargo hack ${{matrix.config.command}} ${{matrix.config.args}} --ignore-private
rust-test:
name: "Rust (tests)"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/cleanup
- uses: rui314/setup-mold@v1
- uses: ./.github/actions/setup-rust
- name: Rust Lint - Format
run: cargo fmt --all --check
- name: Rust Lint - Clippy All Features
run: cargo clippy --all-features --all-targets
- name: Rust Lint - Clippy Default Features
run: cargo clippy --all-targets
- name: Rust Lint - Clippy No Default Features
run: |
set -ex
# https://spiraldb.slack.com/archives/C07BV3GKAJ2/p1732736281946729
for package in $(cargo check -p 2>&1 | grep '^ ')
do
echo ---- $package ----
cargo clippy --package $package --no-default-features
done
- name: Rust Test
run: cargo test --workspace --all-features
env:
# Enable coverage using -Zprofile flag
RUSTFLAGS: '-Zprofile'
RUSTDOCFLAGS: '-Zprofile'
- uses: rraval/actions-rs-grcov@e96292badb0d33512d16654efb0ee3032a9a3cff
id: grcov
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Coveralls
uses: coverallsapp/github-action@v2
with:
file: "${{ steps.grcov.outputs.report }}"
license-check-and-audit-check:
name: License Check and Audit Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/cleanup
- uses: rui314/setup-mold@v1
- uses: ./.github/actions/setup-rust
- uses: actions/checkout@v4
- name: License Check
run: cargo install --locked cargo-deny && cargo deny check
- uses: rustsec/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
ignore: "RUSTSEC-2023-0384"
miri:
name: "miri"
runs-on: ubuntu-latest
env:
MIRIFLAGS: -Zmiri-strict-provenance -Zmiri-symbolic-alignment-check -Zmiri-backtrace=full -Zmiri-disable-isolation
steps:
- uses: rui314/setup-mold@v1
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-rust
- name: Run tests with Miri
run: cargo miri test
bench-test:
name: "bench test"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/cleanup
- uses: rui314/setup-mold@v1
- uses: ./.github/actions/setup-rust
# Required to run benchmarks
- name: Install DuckDB
uses: opt-nc/[email protected]
with:
version: v1.0.0
- name: Rust TPC-H and Random access Bench as test
run: cargo bench --bench tpch --bench random_access --profile benchtest -- --test
generated-files:
name: "Check generated proto/fbs files are up to date"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/cleanup
- uses: rui314/setup-mold@v1
- uses: ./.github/actions/setup-rust
- uses: ./.github/actions/setup-flatc
- name: Install Protoc
uses: arduino/setup-protoc@v3
- name: "regenerate all .fbs/.proto Rust code"
run: |
cargo xtask generate-fbs
cargo xtask generate-proto
- name: "Make sure no files changed after regenerating"
run: |
test -z "$(git status --porcelain)"