Skip to content

CI

CI #48

Workflow file for this run

# This is a basic workflow to help you get started with Actions
name: CI
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "master" branch
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
run-tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13-dev"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt -r requirements-build.txt
- name: Typecheck with mypy
run: |
mypy --strict
- name: Check with ruff
run: |
ruff check
- name: Test with pytest
run: |
pytest
- name: Generate coverage report
run: |
pytest --cov=./ --cov-report=xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
env_vars: OS,PYTHON
- name: Test with pytest (sdist)
run: |
python -m build --sdist --outdir build-test
cd build-test
tar xf pysubs2-*.tar.gz
cd $(find -maxdepth 1 -type d -name 'pysubs2-*')
PYTHONPATH=. pytest
- name: Test with pytest (wheel)
run: |
python -m pip install ../pysubs2-*.whl
pytest