Skip to content

Add CI

Add CI #4

Workflow file for this run

name: Test
on:
workflow_dispatch:
pull_request:
push:
branches:
- main
tags:
- '**'
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
- "3.12"
name: Python ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- run: |
pip install pre-commit
pre-commit run --all-files
if: matrix.python-version == '3.12'
- run: |
apt-get install gcc
pip install poetry
poetry install
- run: poetry run pytest -s
- uses: codecov/codecov-action@v4
if: matrix.python-version == '3.12'
with:
fail_ci_if_error: true
publish:
if: github.ref_type == 'tag'
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- run: poetry publish --build
env:
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }}