Skip to content

Commit 2280836

Browse files
committed
ci: Update GitHub Actions workflows for publishing and testing with multiple Python versions
1 parent 082213e commit 2280836

2 files changed

Lines changed: 41 additions & 10 deletions

File tree

.github/workflows/publish.yml

Lines changed: 39 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,54 @@ name: Publish Python Package
22

33
on:
44
push:
5-
branches:
6-
- master
5+
tags:
6+
- 'v*'
7+
- '[0-9]+.[0-9]+.[0-9]+'
78

89
jobs:
9-
publish-service-client-package:
10+
test:
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
matrix:
14+
os: [ubuntu-latest, macos-latest, windows-latest]
15+
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
- name: Install uv
20+
uses: astral-sh/setup-uv@v5
21+
- name: Set up Python ${{ matrix.python-version }}
22+
uses: actions/setup-python@v5
23+
with:
24+
python-version: ${{ matrix.python-version }}
25+
- name: Install dependencies
26+
run: |
27+
uv sync
28+
- name: Lint with flake8
29+
run: |
30+
# stop the build if there are Python syntax errors or undefined names
31+
uv run flake8 comexdown --count --select=E9,F63,F7,F82 --show-source --statistics
32+
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
33+
uv run flake8 comexdown --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
34+
- name: Test with pytest
35+
run: |
36+
uv run pytest --cov=comexdown
37+
38+
publish:
39+
needs: test
1040
runs-on: ubuntu-latest
1141
permissions:
1242
contents: write
43+
id-token: write
1344
steps:
14-
- uses: actions/checkout@v3
45+
- uses: actions/checkout@v4
1546
- name: Install uv
1647
uses: astral-sh/setup-uv@v5
17-
- name: Set up Python 3.12
18-
uses: actions/setup-python@v4
48+
- name: Set up Python 3.13
49+
uses: actions/setup-python@v5
1950
with:
20-
python-version: "3.12"
51+
python-version: "3.13"
2152
- name: Build
2253
run: uv build
23-
- name: Publish Package
54+
- name: Publish Package to PyPI
2455
run: uv publish --token ${{ secrets.PYPI_TOKEN }}

.github/workflows/tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ name: tests
55

66
on:
77
push:
8-
tags:
9-
- '*'
8+
branches:
9+
- master
1010

1111
jobs:
1212
build:

0 commit comments

Comments
 (0)