Skip to content

Commit 256ebd6

Browse files
committed
ci: add python workflow
1 parent f37f771 commit 256ebd6

File tree

2 files changed

+54
-1
lines changed

2 files changed

+54
-1
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@ name: CI
22

33
on:
44
push:
5-
branches: [master]
5+
branches: [main]
66
pull_request:
7+
workflow_dispatch:
78

89
jobs:
910
test:

.github/workflows/python.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Python
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
workflow_dispatch:
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
16+
steps:
17+
- uses: actions/checkout@v4
18+
- uses: actions/setup-python@v4
19+
with:
20+
python-version: ${{ matrix.python-version }}
21+
- name: Build and install
22+
run: pip install --verbose .[tests]
23+
- name: Run tests with pytest
24+
run: pytest
25+
26+
build_wheels:
27+
name: Build wheels on ${{ matrix.os }}
28+
runs-on: ${{ matrix.os }}
29+
strategy:
30+
matrix:
31+
# macos-13 is an intel runner, macos-14 is apple silicon
32+
os: [ubuntu-latest, ubuntu-24.04-arm, windows-latest, macos-13, macos-14]
33+
steps:
34+
- uses: actions/checkout@v4
35+
- name: Build wheels
36+
uses: pypa/[email protected]
37+
- uses: actions/upload-artifact@v4
38+
with:
39+
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
40+
path: ./wheelhouse/*.whl
41+
42+
build_sdist:
43+
name: Build source distribution
44+
runs-on: ubuntu-latest
45+
steps:
46+
- uses: actions/checkout@v4
47+
- name: Build sdist
48+
run: pipx run build --sdist
49+
- uses: actions/upload-artifact@v4
50+
with:
51+
name: cibw-sdist
52+
path: dist/*.tar.gz

0 commit comments

Comments
 (0)