-
Notifications
You must be signed in to change notification settings - Fork 28
56 lines (53 loc) · 1.79 KB
/
Copy pathrust-pr.yml
File metadata and controls
56 lines (53 loc) · 1.79 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
name: Rust PR
on:
pull_request:
branches: [ main ] # run only when making a PR for main
env:
CARGO_TERM_COLOR: always
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- name: Install libudev
run: sudo apt-get update && sudo apt-get install libudev-dev pkg-config librust-alsa-sys-dev
- uses: actions/checkout@v6.0.2
- uses: actions/setup-python@v6.2.0
- uses: pre-commit/action@v3.0.1
build:
runs-on: ubuntu-latest
steps:
- name: Install libudev
run: sudo apt-get update && sudo apt-get install libudev-dev pkg-config librust-alsa-sys-dev
- uses: actions/checkout@v2
- name: Build
run: cargo build --verbose
- name: Build examples
run: cargo build --examples
- name: Run tests
run: cargo test --verbose
pytest:
runs-on: ubuntu-latest
strategy:
matrix:
python: ["3.10", "3.13"]
steps:
- uses: actions/checkout@v6.0.2
- uses: actions/setup-python@v6.2.0
with:
python-version: ${{ matrix.python }}
- uses: dtolnay/rust-toolchain@stable
- name: Create + activate venv (maturin develop requires one)
# $GITHUB_PATH prepends to PATH for every subsequent step;
# $GITHUB_ENV exports VIRTUAL_ENV (which maturin/pip detect)
# so we don't need to `source venv/bin/activate` in each step.
run: |
python -m venv $HOME/.venv
echo "$HOME/.venv/bin" >> $GITHUB_PATH
echo "VIRTUAL_ENV=$HOME/.venv" >> $GITHUB_ENV
- name: Install maturin and test deps
run: pip install "maturin>=1.7,<2.0" pytest pytest-timeout mypy
- name: Build and install bonsai-py
working-directory: bonsai-py
run: maturin develop --release
- name: Run pytest
run: pytest -v bonsai-py/tests/