-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (70 loc) · 2.08 KB
/
Copy pathci.yml
File metadata and controls
77 lines (70 loc) · 2.08 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
68
69
70
71
72
73
74
75
76
77
name: CI
# Quality gates on every PR: formatting, lints, and the fast test suites for both languages. The
# heavier gates (the `#[ignore]`-gated stress suite, big-endian emulation, fuzzing) live in
# full-tests.yml and run on demand: from the Actions tab or via a `/ci-full` / `/ci-endian` /
# `/ci-fuzz` PR comment.
#
# These mirror `task format` / `task lint` / `task test-rust-fast` / `task test-python`; keep them in
# sync.
on:
pull_request:
push:
branches: [main]
permissions:
contents: read
jobs:
format:
name: format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- name: cargo fmt
run: cargo fmt --all -- --check
- uses: astral-sh/setup-uv@v5
- name: ruff format
working-directory: ben-py
run: uv run --locked ruff format --check .
lint:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- uses: Swatinem/rust-cache@v2
- name: cargo clippy
run: cargo clippy --workspace --all-targets -- -D warnings
- uses: astral-sh/setup-uv@v5
- name: ruff check
working-directory: ben-py
run: uv run --locked ruff check .
rust-test:
name: rust tests (fast)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: cargo test
run: cargo test
python-test:
name: python tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- uses: astral-sh/setup-uv@v5
- name: sync environment
working-directory: ben-py
run: uv sync --all-groups
- name: build extension
working-directory: ben-py
run: uv run maturin develop
- name: pytest
working-directory: ben-py
run: uv run pytest tests/