Skip to content

Commit c0c639c

Browse files
committed
ci(wip): add initial github actions workflow
1 parent f07d141 commit c0c639c

File tree

1 file changed

+77
-0
lines changed

1 file changed

+77
-0
lines changed

.github/workflows/ci.yml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: Python CI
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
branches: [master]
8+
9+
jobs:
10+
test:
11+
name: Python ${{ matrix.python-version }} (${{ matrix.platform }})
12+
runs-on: ${{ matrix.platform }}
13+
14+
strategy:
15+
matrix:
16+
include:
17+
- python-version: "3.9"
18+
platform: ubuntu-latest
19+
- python-version: "3.10"
20+
platform: ubuntu-latest
21+
- python-version: "3.11"
22+
platform: ubuntu-latest
23+
- python-version: "3.12"
24+
platform: ubuntu-latest
25+
run-lint: true
26+
- python-version: "3.13"
27+
platform: ubuntu-latest
28+
- python-version: "3.10"
29+
platform: macos-latest
30+
- python-version: "3.10"
31+
platform: windows-latest
32+
33+
steps:
34+
- uses: actions/checkout@v4
35+
36+
- name: Set up Python ${{ matrix.python-version }}
37+
uses: actions/setup-python@v5
38+
with:
39+
python-version: ${{ matrix.python-version }}
40+
41+
- name: Install tox
42+
run: python -m pip install --upgrade tox
43+
44+
- name: Run tests
45+
run: tox -e py${{ matrix.python-version.replace('.', '') }}
46+
47+
- name: Run lint
48+
if: matrix.run-lint == true
49+
run: tox -e lint
50+
51+
- name: Run Codecov
52+
env:
53+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
54+
run: tox -e codecov
55+
56+
publish:
57+
name: Build & Publish to PyPI
58+
if: github.ref == 'refs/heads/master'
59+
needs: test
60+
runs-on: ubuntu-latest
61+
62+
steps:
63+
- uses: actions/checkout@v4
64+
65+
- name: Set up Python
66+
uses: actions/setup-python@v5
67+
with:
68+
python-version: "3.12"
69+
70+
- name: Install tox
71+
run: python -m pip install --upgrade tox
72+
73+
- name: Publish to PyPI
74+
env:
75+
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
76+
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
77+
run: tox -e pypi

0 commit comments

Comments
 (0)