-
Notifications
You must be signed in to change notification settings - Fork 0
106 lines (99 loc) · 2.85 KB
/
ci.yaml
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
on: [push, pull_request]
defaults:
run:
shell: bash
jobs:
lint-rust:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v1
- uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- run: make lint-rust
lint-python:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.x'
- run: pip install $(grep -E '^(black|ruff|mypy|numpy)' requirements.txt)
- run: make lint-python
test-rust:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- uses: Swatinem/rust-cache@v1
- run: cargo test
test-python:
strategy:
fail-fast: false
matrix:
python-version:
- '3.8'
- '3.9'
- '3.10'
- '3.11'
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- uses: Swatinem/rust-cache@v1
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- run: |
sudo apt-get install libspatialindex-dev
pip install -U pip wheel
pip install -r requirements.txt
name: Install dependencies
- run: |
mkdir -p $TGT_DIR
rm -f $TGT_DIR/*.whl
maturin build --release --interpreter python --out $TGT_DIR
pip install $TGT_DIR/*.whl
name: Install package
env:
TGT_DIR: "target/wheels/${{ matrix.python-version }}"
- run: pytest --verbose
deploy:
strategy:
matrix:
os: [macos-latest, windows-latest, ubuntu-20.04]
needs: [lint-rust, lint-python, test-rust, test-python]
runs-on: ${{ matrix.os }}
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/v')
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- uses: actions/setup-python@v2
with:
python-version: '3.9'
- uses: messense/maturin-action@v1
with:
manylinux: auto
command: publish
args: -u __token__ -p ${{ secrets.MATURIN_PASSWORD }} --skip-existing --universal2
name: Deploy wheels