Update unit tests' mock auth objects to use auto-speccing (#215) #153
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: Caracara Code Quality | |
on: | |
push: | |
paths: | |
- '**.py' | |
- '**.yml' | |
branches: | |
- main | |
- 'ver_*' | |
tags: | |
- 'v*' | |
pull_request: | |
jobs: | |
codequality: | |
strategy: | |
matrix: | |
# TODO: update this to 3.13 (final release) when this is released on 1 October 2024 | |
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13.0-rc.2"] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Poetry via pipx | |
run: pipx install poetry | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: 'poetry' | |
- name: Install dependencies | |
run: poetry install | |
- name: Lint package source with flake8 | |
run: | | |
poetry run flake8 caracara/ --show-source --statistics | |
poetry run flake8 examples/ --show-source --statistics | |
poetry run flake8 tests/ --show-source --statistics | |
- name: Lint package source with pylint | |
if: success() || failure() | |
run: | | |
poetry run pylint caracara/ | |
poetry run pylint examples/ | |
poetry run pylint tests/ | |
- name: Lint package docstrings and comments with pydocstyle | |
if: success() || failure() | |
run: | | |
poetry run pydocstyle caracara/ | |
poetry run pydocstyle examples/ | |
- name: Lint imports with isort | |
if: success() || failure() | |
run: | | |
poetry run isort -c caracara/ | |
poetry run isort -c examples/ | |
poetry run isort -c tests/ | |
- name: Lint package with black | |
if: success() || failure() | |
run: | | |
poetry run black -l 100 --check caracara/ | |
poetry run black -l 100 --check examples/ | |
poetry run black -l 100 --check tests/ | |
- name: Analyse code for security issues with bandit | |
if: success() || failure() | |
run: | | |
poetry run bandit -r caracara --configfile .bandit | |
poetry run bandit -r examples --configfile examples/.bandit | |
poetry run bandit -r tests --configfile tests/.bandit |