Skip to content

Add CI workflow for code quality checks and testing #1

Add CI workflow for code quality checks and testing

Add CI workflow for code quality checks and testing #1

Workflow file for this run

name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
quality:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.12"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
pip install -e .
- name: Code formatting (black)
run: black . --check
- name: Import sorting (isort)
run: isort . --check-only --profile black
- name: Lint with flake8
run: flake8 . --count --max-line-length=88 --statistics
- name: Type checking with mypy
run: mypy .
- name: Security check with bandit
run: bandit -r . -c pyproject.toml
test:
runs-on: ubuntu-latest
needs: quality
strategy:
matrix:
python-version: ["3.10"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
pip install -e .
- name: Run tests with pytest
run: |
pytest --cov=. --cov-report=xml --cov-fail-under=80
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
file: ./coverage.xml