Skip to content

Commit 278a426

Browse files
committed
Setup GHA workflows
1 parent 7c661f5 commit 278a426

File tree

3 files changed

+111
-0
lines changed

3 files changed

+111
-0
lines changed

.github/workflows/ci.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Run CI
2+
3+
# Run this workflow every time a new commit pushed to your repository
4+
on:
5+
push:
6+
branches:
7+
- main
8+
tags:
9+
- "*"
10+
pull_request:
11+
workflow_dispatch:
12+
13+
jobs:
14+
tests:
15+
runs-on: ubuntu-latest
16+
strategy:
17+
matrix:
18+
python: ["3.12", "3.13", "3.14"]
19+
20+
name: Run the test suite (Python ${{ matrix.python }})
21+
22+
steps:
23+
- uses: actions/checkout@v4
24+
- uses: actions/setup-python@v5
25+
with:
26+
python-version: ${{ matrix.python }}
27+
allow-prereleases: true
28+
29+
- name: Install dependencies
30+
run: pip install tox tox-gh-actions
31+
32+
- name: Run tests
33+
run: tox
34+
35+
- name: Publish coverage report
36+
uses: codecov/codecov-action@v5
37+
with:
38+
token: ${{ secrets.CODECOV_TOKEN }}
39+
40+
publish:
41+
name: Publish package to PyPI
42+
runs-on: ubuntu-latest
43+
needs: [tests]
44+
environment: release
45+
permissions:
46+
id-token: write
47+
48+
if: false && github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
49+
50+
steps:
51+
- uses: actions/checkout@v4
52+
- uses: actions/setup-python@v5
53+
with:
54+
python-version: "3.12"
55+
56+
- name: Build sdist and wheel
57+
run: |
58+
pip install build --upgrade
59+
python -m build
60+
61+
- name: Publish a Python distribution to PyPI
62+
uses: pypa/gh-action-pypi-publish@release/v1

.github/workflows/code-quality.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Code quality checks
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
tags:
8+
- "*"
9+
pull_request:
10+
workflow_dispatch:
11+
12+
jobs:
13+
linting:
14+
name: Code-quality checks
15+
runs-on: ubuntu-latest
16+
17+
strategy:
18+
matrix:
19+
toxenv:
20+
- ruff
21+
# - docs
22+
# - typecheck
23+
24+
steps:
25+
- uses: actions/checkout@v4
26+
- uses: actions/setup-python@v5
27+
with:
28+
python-version: "3.12"
29+
- name: Install dependencies
30+
run: pip install tox
31+
- run: tox
32+
env:
33+
TOXENV: ${{ matrix.toxenv }}

tox.ini

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
[tox]
2+
envlist = py{312,313,314}
3+
skip_missing_interpreters = true
4+
5+
[gh-actions]
6+
python =
7+
3.12: py312
8+
3.13: py313
9+
3.14: py314
10+
11+
[testenv]
12+
extras = tests
13+
commands =
14+
pytest {posargs:tests} --cov=openklant_client --cov-report=xml --cov-report=term-missing
15+
deps =
16+
pytest-cov

0 commit comments

Comments
 (0)