Skip to content

Commit 31cf356

Browse files
brunovcostaclaude
andcommitted
Add CI workflows for tests and PyPI publishing
- test.yml: runs pytest on push/PR across Python 3.10-3.13 - publish.yml: builds with Poetry and publishes to PyPI on release Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 0c28c15 commit 31cf356

2 files changed

Lines changed: 78 additions & 0 deletions

File tree

.github/workflows/publish.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Publish release
2+
3+
on:
4+
release:
5+
types: [created]
6+
workflow_dispatch:
7+
8+
jobs:
9+
test:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
14+
- uses: actions/setup-python@v5
15+
with:
16+
python-version: "3.12"
17+
18+
- name: Install dependencies
19+
run: |
20+
python -m pip install --upgrade pip
21+
pip install pytest
22+
23+
- name: Run tests
24+
run: pytest tests/ -v
25+
26+
publish:
27+
if: startsWith(github.ref, 'refs/tags')
28+
needs: test
29+
runs-on: ubuntu-latest
30+
31+
steps:
32+
- uses: actions/checkout@v4
33+
34+
- uses: actions/setup-python@v5
35+
with:
36+
python-version: "3.12"
37+
38+
- name: Install dependencies
39+
run: |
40+
python -m pip install --upgrade pip
41+
pip install poetry
42+
43+
- name: Build
44+
run: poetry build
45+
46+
- name: Publish package
47+
uses: pypa/gh-action-pypi-publish@release/v1
48+
with:
49+
password: ${{ secrets.PYPI_API_TOKEN }}

.github/workflows/test.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
python-version: ["3.10", "3.11", "3.12", "3.13"]
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- uses: actions/setup-python@v5
20+
with:
21+
python-version: ${{ matrix.python-version }}
22+
23+
- name: Install dependencies
24+
run: |
25+
python -m pip install --upgrade pip
26+
pip install pytest
27+
28+
- name: Run tests
29+
run: pytest tests/ -v

0 commit comments

Comments
 (0)