Skip to content

feat(ci): Add Mypy to CI #14

feat(ci): Add Mypy to CI

feat(ci): Add Mypy to CI #14

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.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
- name: Install dependencies
run: |
poetry install --no-interaction --no-root
- name: Typecheck with mypy
run: |
poetry run mypy
- name: Test with pytest
run: |
poetry run python -m pytest
- name: Generate coverage report for okane.py
run: |
poetry run python -m pytest --cov=okane --cov-report=xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
env_vars: OS,PYTHON
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}