-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (62 loc) · 2.39 KB
/
Copy pathci.yml
File metadata and controls
67 lines (62 loc) · 2.39 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
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
rust-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
# Also exercises the cpp/ (cxx) crate, since it's a workspace member --
# this just builds it, as it has no #[test]s of its own (see the
# cpp-test job below for the C++ bindings' own suite). python/'s
# bindings have their own pytest suite -- see the python-test job below.
- run: cargo test --workspace
cpp-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- run: cmake -S cpp -B cpp/build -DCMAKE_BUILD_TYPE=Release
- run: cmake --build cpp/build -j
- run: ./cpp/build/quickik_cpp_tests
python-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- uses: astral-sh/setup-uv@v7
- run: uv venv --python 3.12
# Each `run:` step is a fresh shell, so .venv/bin has to be persisted
# via GITHUB_PATH for it to resolve `maturin`/`pytest` by bare name in
# later steps -- it doesn't happen automatically just by installing
# into that venv.
- run: echo "$PWD/.venv/bin" >> "$GITHUB_PATH"
# maturin needs an active virtualenv to know where to install the
# built extension -- a bare `pip install` with no venv at all doesn't
# give it one. `uv pip install` (no explicit --python) auto-targets
# the .venv just created above, and maturin's own "look for a .venv
# in the current or any parent directory" fallback then finds that
# same one from python/, without needing VIRTUAL_ENV set.
- run: uv pip install maturin pytest
- run: cd python && maturin develop --release
- run: pytest python/tests/
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- run: cargo fmt --all -- --check
- uses: astral-sh/setup-uv@v7
- run: cd devtools-pyenv && uv sync
# ruff.toml at the root covers python/tests/, benchmark/, and
# devtools-pyenv/ itself.
- run: cd devtools-pyenv && uv run ruff check ..