Skip to content

Add a proper python package #168

Add a proper python package

Add a proper python package #168

Workflow file for this run

name: Run python unit tests
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v7
- name: Set up Python
uses: actions/setup-python@v7
with:
python-version: '3.11'
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
- name: Check lints
run: ruff check .
- name: Check types
run: mypy
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# 3.11 is the floor: fedifetcher.servers uses StrEnum. The top of the
# range wants extending as each new Python is released.
python-version: ['3.11', '3.12', '3.13', '3.14']
steps:
- name: Checkout code
uses: actions/checkout@v7
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v7
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
- name: Run tests with coverage
run: |
pytest --cov --cov-report=xml
- name: Save coverage report
if: matrix.python-version == '3.11'
uses: actions/upload-artifact@v7
with:
name: coverage-report
path: coverage.xml