Skip to content

Refactor

Refactor #34

Workflow file for this run

---
name: CI
on:
push:
branches: ["development", "refactor"]
#paths:
# - "**/*.py"
# - "!**/README.md"
pull_request:
branches: ["development"]
paths:
- "**/*.py"
- "!**/README.md"
workflow_dispatch:
jobs:
code-quality:
name: "python-code-quality"
strategy:
matrix:
python-version: [3.8.x]
poetry-version: [1.3.1]
runs-on: ubuntu-latest
#defaults:
# run:
# working-directory: cyborg_web
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: "Setup Python, Poetry and Dependencies"
uses: packetcoders/action-setup-cache-python-poetry@main
with:
python-version: ${{matrix.python-version}}
poetry-version: ${{matrix.poetry-version}}
- name: Format (chk) - black
run: poetry run black ./src ./tests
- name: Format (chk) - isort
run: poetry run isort ./src ./tests --check-only --profile black
#- name: Format (chk) - autoflake
# run: poetry run autoflake -r . --expand-star-imports --remove-unused-variables --remove-all-unused-imports
#- name: Format (chk) - bandit
# run: poetry run bandit -c pyproject.toml -r .
#- name: Lint - flake8
# run: poetry run flake8 .
#- name: Lint - pydocstyle
# run: poetry run pydocstyle .
- name: Lint - yamllint
run: poetry run yamllint src/ -c .yamllint
- name: Type check - mypy
run: poetry run mypy ./src ./tests --config-file pyproject.toml
test:
name: "python-tests"
needs: "code-quality"
strategy:
matrix:
python-version: [3.8.x]
poetry-version: [1.3.1]
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: "Setup Python, Poetry and Dependencies"
uses: packetcoders/action-setup-cache-python-poetry@main
with:
python-version: ${{matrix.python-version}}
poetry-version: ${{matrix.poetry-version}}
- name: Test
run: poetry run pytest tests -vvv --tb=short