kellog #29
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: kellog | |
on: | |
push: | |
branches: | |
- '**' | |
tags: | |
- 'v*' | |
workflow_dispatch: | |
inputs: | |
python-version: | |
description: Python version | |
required: true | |
type: choice | |
options: | |
- 3.7 | |
- 3.8 | |
- 3.9 | |
- 3.10 | |
- 3.11 | |
- 3.12 | |
jobs: | |
test: | |
name: Test on Python ${{ matrix.python-version }} | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ${{fromJson(github.event.inputs.python-version || '["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]')}} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Run Ruff checks | |
uses: chartboost/ruff-action@v1 | |
- name: Setup Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install with dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install .[dev] | |
- name: Unit tests | |
run: pytest --disable-warnings -vvs kellog/tests | |
publish: | |
name: Publish to PyPI | |
needs: test | |
runs-on: ubuntu-latest | |
if: startsWith(github.ref, 'refs/tags/v') | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.8 | |
- name: Install with dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install build | |
- name: Build package | |
run: python -m build | |
- name: Publish package | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_API_TOKEN }} |