-
Notifications
You must be signed in to change notification settings - Fork 7
52 lines (50 loc) · 1.42 KB
/
test.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
name: Test
on:
- push
- pull_request
jobs:
test:
name: Test (Linux)
runs-on: ubuntu-latest
env:
OS: Linux
strategy:
matrix:
include:
- python-version: 3.8
python-release: v3.8
python-impl: CPython
- python-version: 3.9
python-release: v3.9
python-impl: CPython
- python-version: "3.10"
python-release: v3.10
python-impl: CPython
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
- name: Install build dependencies
run: python -m pip install setuptools-rust
- name: Build example
run: cd example && python setup.py build_ext --inplace
- name: Check example
run: cd example && python -c 'import pprint; import hello; pprint.pprint(hello.__build__)'
publish:
name: Publish
runs-on: ubuntu-latest
environment: Crates.io
needs: test
if: "startsWith(github.ref, 'refs/tags/v')"
steps:
- name: Checkout code
uses: actions/checkout@v1
- name: Setup Rust ${{ matrix.rust-toolchain }}
uses: dtolnay/rust-toolchain@stable
- name: Package and publish
run: cargo publish --token ${{ secrets.CRATES_IO_TOKEN }}