chore: update pre-commit hooks #122
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Test, Lint & Coverage" | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
# Allow manual triggering | |
workflow_dispatch: | |
jobs: | |
perform-checks: | |
name: "Test, Lint & Coverage" | |
runs-on: ubuntu-latest | |
steps: | |
- name: "Checkout source code" | |
uses: actions/checkout@v4 | |
- name: "Install Poetry" | |
run: pipx install poetry | |
- name: "Install Python" | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12.3" | |
cache: "poetry" | |
- name: Install dependencies | |
run: poetry install | |
- name: "Run ruff format" | |
run: poetry run ruff format | |
- name: "Run ruff check" | |
run: poetry run ruff check | |
- name: "Run mypy" | |
run: poetry run mypy . | |
- name: "Run tests with coverage" | |
run: poetry run pytest --cov=src --cov-report=xml --cov-report=term-missing | |
- name: "Upload coverage to Code Climate" | |
uses: paambaati/[email protected] | |
env: | |
CC_TEST_REPORTER_ID: ${{secrets.CC_TEST_REPORTER_ID}} | |
- name: "Bandit Code Scan" | |
if: always() | |
run: poetry run bandit -c pyproject.toml -r -l . |