Skip to content

Commit 980ba6b

Browse files
ci: Add workflow files
Testing workflow Releasing workflow
1 parent a28cd86 commit 980ba6b

2 files changed

Lines changed: 64 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Upload Python Package
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
tags:
7+
- v*.*.*
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
pypi-publish:
14+
name: Upload release to PyPI
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- uses: actions/checkout@v3
19+
- name: Build and publish
20+
uses: JRubics/poetry-publish@v1.17
21+
with:
22+
pypi_token: ${{ secrets.PYPI_TOKEN }}

.github/workflows/test-worker.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Run Python tests
2+
3+
on: [push]
4+
5+
jobs:
6+
build:
7+
name: Run tests
8+
runs-on: ubuntu-latest
9+
strategy:
10+
matrix:
11+
python-version: ["3.9", "3.10", "3.11", "3.x"]
12+
13+
steps:
14+
- uses: actions/checkout@v3
15+
16+
- name: Set up Python ${{ matrix.python-version }}
17+
uses: actions/setup-python@v4
18+
with:
19+
python-version: ${{ matrix.python-version }}
20+
21+
- name: Install dependencies
22+
run: |
23+
python -m pip install -U pip
24+
python -m pip install -U coverage pytest pytest-cov poetry
25+
python -m poetry install
26+
python -m poetry self add poetry-plugin-export
27+
python -m poetry export -f requirements.txt --output requirements.txt
28+
python -m pip install -r requirements.txt
29+
30+
- name: Lint with Ruff
31+
run: |
32+
python -m pip install -U ruff
33+
ruff --per-file-ignores="__init__.py:F401" --per-file-ignores="__init__.py:E402" .
34+
continue-on-error: true
35+
36+
- name: Test with pytest
37+
run: |
38+
coverage run -m pytest -v -s
39+
40+
- name: Generate Coverage Report
41+
run: |
42+
coverage report -m

0 commit comments

Comments
 (0)