Skip to content

Commit b294fa8

Browse files
committed
Initial commit.
0 parents  commit b294fa8

35 files changed

+11837
-0
lines changed

.github/workflows/ci.yaml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: ci
2+
3+
on: [push, pull_request]
4+
5+
env:
6+
CARGO_TERM_COLOR: always
7+
8+
jobs:
9+
check:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v5
13+
- uses: dtolnay/rust-toolchain@stable
14+
- uses: Swatinem/rust-cache@v2
15+
- run: cargo check
16+
17+
fmt:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v5
21+
with:
22+
submodules: true
23+
- uses: dtolnay/rust-toolchain@stable
24+
with:
25+
components: rustfmt
26+
- uses: Swatinem/rust-cache@v2
27+
- run: cargo fmt --all -- --check
28+
29+
test:
30+
runs-on: ${{ matrix.os }}
31+
strategy:
32+
matrix:
33+
os: [ubuntu-latest, macos-latest]
34+
steps:
35+
- uses: actions/checkout@v5
36+
- uses: dtolnay/rust-toolchain@stable
37+
- uses: Swatinem/rust-cache@v2
38+
- run: cargo test --no-fail-fast

.github/workflows/python.yaml

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
name: python
2+
3+
on: [push, pull_request, workflow_dispatch]
4+
5+
env:
6+
CARGO_TERM_COLOR: always
7+
8+
jobs:
9+
build_wheels:
10+
name: build_wheels (os=${{ matrix.os }} target=${{ matrix.target }})
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
matrix:
14+
include:
15+
- os: ubuntu-24.04
16+
target: x86_64
17+
cross: false
18+
- os: macos-15
19+
target: universal2
20+
cross: false
21+
22+
steps:
23+
- name: checkout
24+
uses: actions/checkout@v5
25+
- uses: actions/setup-python@v6
26+
with:
27+
python-version: '3.14'
28+
- uses: dtolnay/rust-toolchain@stable
29+
- uses: Swatinem/rust-cache@v2
30+
- name: build wheel
31+
uses: PyO3/maturin-action@v1
32+
with:
33+
target: ${{ matrix.target }}
34+
args: --profile release-lto --out dist
35+
manylinux: auto
36+
sccache: true
37+
- name: delocate wheel (macOS)
38+
if: runner.os == 'macOS'
39+
run: |
40+
pip3 install delocate
41+
delocate-wheel -v dist/*.whl
42+
- name: install built wheel
43+
if: ${{ ! matrix.cross }}
44+
run: |
45+
pip3 install miniacd --find-links dist
46+
python3 -c "import miniacd"
47+
- name: upload wheels
48+
uses: actions/upload-artifact@v4
49+
with:
50+
name: wheels-binary-${{ matrix.os }}-${{ matrix.target }}
51+
path: dist
52+
- if: github.ref == 'refs/heads/main'
53+
name: update prerelease tag
54+
uses: EndBug/[email protected]
55+
with:
56+
ref: "prerelease"
57+
58+
sdist:
59+
runs-on: ubuntu-latest
60+
steps:
61+
- uses: actions/checkout@v4
62+
- name: build sdist
63+
uses: PyO3/maturin-action@v1
64+
with:
65+
command: sdist
66+
args: --out dist
67+
- name: upload sdist
68+
uses: actions/upload-artifact@v4
69+
with:
70+
name: wheels-sdist
71+
path: dist
72+
73+
prerelease:
74+
if: github.ref == 'refs/heads/main'
75+
runs-on: ubuntu-latest
76+
concurrency:
77+
group: push-${{ github.ref_name }}-prerelease
78+
cancel-in-progress: true
79+
needs: [build_wheels, sdist]
80+
steps:
81+
- uses: actions/download-artifact@v4
82+
with:
83+
pattern: wheels-*
84+
merge-multiple: true
85+
path: wheels
86+
87+
- name: GitHub release
88+
uses: ncipollo/[email protected]
89+
with:
90+
prerelease: true
91+
tag: "prerelease"
92+
name: "Development Build"
93+
allowUpdates: true
94+
removeArtifacts: true
95+
replacesArtifacts: true
96+
makeLatest: true
97+
artifacts: "wheels/*"
98+
99+
publish:
100+
name: publish to PyPI
101+
runs-on: ubuntu-latest
102+
if: "startsWith(github.ref, 'refs/tags/')"
103+
needs: [build_wheels, sdist]
104+
steps:
105+
- uses: actions/download-artifact@v4
106+
with:
107+
pattern: wheels-*
108+
merge-multiple: true
109+
- uses: PyO3/maturin-action@v1
110+
env:
111+
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
112+
with:
113+
command: upload
114+
args: --non-interactive --skip-existing *

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/target
2+
__pycache__
3+
*.pyc
4+
*.bak

.pre-commit-config.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v2.3.0
4+
hooks:
5+
- id: check-yaml
6+
- id: end-of-file-fixer
7+
- id: trailing-whitespace
8+
- repo: https://github.com/astral-sh/ruff-pre-commit
9+
rev: v0.14.1
10+
hooks:
11+
- id: ruff-check
12+
- id: ruff-format
13+
- repo: https://github.com/crate-ci/typos
14+
rev: v1.38.1
15+
hooks:
16+
- id: typos

0 commit comments

Comments
 (0)