Skip to content

Commit

Permalink
ci: Add workflow files
Browse files Browse the repository at this point in the history
Testing workflow
Releasing workflow
  • Loading branch information
caffeine-addictt committed Feb 4, 2024
1 parent a28cd86 commit 980ba6b
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Upload Python Package

on:
workflow_dispatch:
push:
tags:
- v*.*.*

permissions:
contents: read

jobs:
pypi-publish:
name: Upload release to PyPI
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Build and publish
uses: JRubics/poetry-publish@v1.17
with:
pypi_token: ${{ secrets.PYPI_TOKEN }}
42 changes: 42 additions & 0 deletions .github/workflows/test-worker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Run Python tests

on: [push]

jobs:
build:
name: Run tests
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.x"]

steps:
- uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install -U pip
python -m pip install -U coverage pytest pytest-cov poetry
python -m poetry install
python -m poetry self add poetry-plugin-export
python -m poetry export -f requirements.txt --output requirements.txt
python -m pip install -r requirements.txt
- name: Lint with Ruff
run: |
python -m pip install -U ruff
ruff --per-file-ignores="__init__.py:F401" --per-file-ignores="__init__.py:E402" .
continue-on-error: true

- name: Test with pytest
run: |
coverage run -m pytest -v -s
- name: Generate Coverage Report
run: |
coverage report -m

0 comments on commit 980ba6b

Please sign in to comment.