-
Notifications
You must be signed in to change notification settings - Fork 1
107 lines (107 loc) · 2.93 KB
/
python.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
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
107
name: Python
on:
pull_request:
branches: main
release:
types: published
jobs:
test:
if: github.event_name != 'release'
strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
runs-on: ${{ matrix.os }}
steps:
- name: checkout
uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
components: clippy
default: true
toolchain: stable
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: clippy
run: cargo clippy --features python -- -D warnings
- name: maturin
run: pip install maturin
- name: build
run: maturin build --release --features python
- name: install
run: pip install --find-links=target/wheels/ automesh[dev]
- name: pycodestyle
run: pycodestyle --verbose .
- name: pytest
run: pytest --verbose
source:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
- name: Rust
uses: actions-rs/toolchain@v1
with:
default: true
toolchain: stable
- name: python
uses: actions/setup-python@v5
with:
python-version: 3.13
- name: requirements
run: pip install build maturin twine
- name: source
run: python -m build . --sdist
- name: check
run: twine check dist/*
- uses: actions/upload-artifact@v4
with:
name: dist
path: dist
wheel:
strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
default: true
toolchain: stable
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: requirements
run: pip install build maturin twine
- name: foo
if: matrix.os == 'macos-latest'
run: brew uninstall --ignore-dependencies xz
- name: wheel
run: maturin build --release --features python
- name: check
run: twine check target/wheels/*
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.os }}-${{ matrix.python-version }}-dist
path: target/wheels
twine:
needs: [source, wheel]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
- uses: actions/setup-python@v5
with:
check-latest: true
python-version: 3.13
- name: requirements
run: pip install twine
- name: wheels
run: mv ./*-dist*/*.whl dist/
- name: ppload
if: github.event_name == 'release'
run: twine upload -u __token__ -p ${{ secrets.PYPI_TOKEN }} dist/*