-
Notifications
You must be signed in to change notification settings - Fork 4
75 lines (68 loc) · 1.9 KB
/
ci.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: CI
on:
push:
paths:
- 'src/**'
- 'tests/**'
- 'python/**'
- '.github/**'
pull_request:
paths:
- 'src/**'
- 'tests/**'
- 'python/**'
- '.github/**'
env:
PACKAGE_NAME: memflow
jobs:
python:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest] # TODO: Check macos compat
python: ["3.7", "3.8", "3.9", "3.10"]
target: [x64] # TODO: Check x86 compat
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v4
id: python
with:
python-version: ${{ matrix.python }}
architecture: ${{ matrix.target }}
- uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
command: build
args: --release -o dist --interpreter=${{ steps.python.outputs.python-path }}
- name: Install built package
run: pip install ${{ env.PACKAGE_NAME }} --no-index --find-links dist --force-reinstall
- name: Install dev dependencies
run: pip install '.[dev]'
- name: Run tests
run: pytest --verbose
- name: black
run: black --check tests/ python/ examples/
rust:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v1
with:
path: $HOME/.cargo
key: cargo-${{ hashFiles('Cargo.lock') }}
- name: Install rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable # TODO: Use rust-toolchain.toml
components: rustfmt, clippy
- name: Run clippy
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-features
- name: Check format
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check