-
Notifications
You must be signed in to change notification settings - Fork 7
53 lines (49 loc) · 1.31 KB
/
test.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
name: Test
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt
- uses: Swatinem/rust-cache@v2
- name: Ruff
run: pipx run ruff .
- name: Rustfmt
run: cargo fmt --all -- --check
- name: Clippy (pure rust)
run: cargo clippy --tests -- -D warnings
- name: Clippy (pyo3)
run: cargo clippy --tests --all-features -- -D warnings
test-rust:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- run: cargo test
test-python:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Install pytest
run: |
pip install --upgrade pip
pip install pytest
- uses: PyO3/maturin-action@v1
with:
command: build
- name: Install pep440_rs
run: pip install --no-index --find-links target/wheels pep440_rs
- run: pytest