-
Notifications
You must be signed in to change notification settings - Fork 25
184 lines (162 loc) · 5.26 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
name: CI
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/setup-uv@0.2.0
- 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/setup-uv@0.2.0
- 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-default:
name: "Build (default)"
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 Build (Default features)
run: cargo build --all-targets
build-all:
name: "Build (all-features)"
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 Build (All Features)
run: cargo build --all-features --all-targets
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
run: cargo clippy --all-features --all-targets
- name: Rust Test
run: cargo test --workspace --all-features
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/audit-check@v2.0.0
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/setup-duckdb-action@v1.0.9
with:
version: v1.0.0
- name: Rust Bench as test
run: cargo bench --bench '*[!noci]' -- --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)"