-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (63 loc) · 1.76 KB
/
lint-and-test.yml
File metadata and controls
69 lines (63 loc) · 1.76 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
name: Lint and Test
on:
push:
branches:
- '**'
jobs:
lint:
runs-on: ubuntu-latest
name: cargo clippy
steps:
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
- run: cargo clippy --all-targets --all-features -- -D warnings
fmt:
runs-on: ubuntu-latest
name: cargo fmt
steps:
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
- run: cargo fmt -- --check
test:
runs-on: ubuntu-latest
name: cargo test
steps:
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
- run: cargo test --all-features
- run: cargo doc --no-deps
test-python:
runs-on: ubuntu-latest
name: test python bindings
steps:
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
- uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Create virtual environment
run: python -m venv .venv
- name: Install dependencies and build Python extension
run: |
source .venv/bin/activate
pip install maturin pytest
maturin develop --features python
- name: Run Python tests
run: |
source .venv/bin/activate
python -m unittest discover tests/python/ -v
test-wasm:
runs-on: ubuntu-latest
name: test wasm bindings
steps:
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
- uses: actions/setup-node@v4
with:
node-version: '20.x'
- run: cargo install wasm-pack
- run: npm install
- name: Build WASM package
run: npm run build
- name: Run WASM tests
run: npm test