-
Notifications
You must be signed in to change notification settings - Fork 15
45 lines (42 loc) · 1.1 KB
/
rustapi.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
# Test Qibolab Rust API
name: Rust API
on:
push:
workflow_dispatch:
jobs:
tests:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Prepare virtual environment
run: |
python -m venv env
pip install .
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Check and lint
working-directory: crate
run: |
cargo check
cargo clippy --all-targets
- name: Set Python path
if: ${{ matrix.os == 'macos-latest' }}
run: |
site=$(python3 -c '
from pathlib import Path;
print(Path("../.venv/lib/python3.11/site-packages/").resolve())
')
echo "PYTHONPATH=$site:$PYTHONPATH" >> "$GITHUB_ENV"
- name: Build & run example
working-directory: crate
run: |
cargo run --example example