Skip to content

Add code tests to CI, run CI weekly, add windows & macos platforms, test all supported python versions #38

Add code tests to CI, run CI weekly, add windows & macos platforms, test all supported python versions

Add code tests to CI, run CI weekly, add windows & macos platforms, test all supported python versions #38

Workflow file for this run

name: Code formatting, linting and type checking
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
code_checks:
strategy:
matrix:
os: ['ubuntu-latest', 'macos-latest', 'windows-latest']
python-version: ['3.8', '3.12']
defaults:
run:
shell: bash
runs-on: ${{ matrix.os }}
timeout-minutes: 60
steps:
- name: Check out code repository
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
- name: Install dependencies
run: poetry install --no-interaction --no-root
- name: Run Black check
run: |
source $VENV
black . --check
- name: Lint with ruff
run: |
source $VENV
ruff check .
- name: Check types with mypy
run: |
source $VENV
mypy .
if: ${{ matrix.python-version == '3.8' }}
- name: Check types with mypy
run: |
source $VENV
mypy . --ignore-missing-imports
if: ${{ matrix.python-version == '3.12' }}