Skip to content

Commit

Permalink
👷 Run code quality checks through tox
Browse files Browse the repository at this point in the history
* Add flake8 to code checks
* Use Github actions matrix
* Prepare for Python 3.12
  • Loading branch information
sergei-maertens committed Mar 26, 2024
1 parent 7d37441 commit 5708423
Showing 1 changed file with 14 additions and 30 deletions.
44 changes: 14 additions & 30 deletions .github/workflows/code_quality.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,43 +7,27 @@ on:
- main
tags:
- '*'
paths:
- '**.py'
pull_request:
paths:
- '**.py'
workflow_dispatch:

jobs:
isort:
name: Check import sorting
linting:
runs-on: ubuntu-latest
strategy:
matrix:
python: ['3.10', '3.12']
toxenv: [isort, black, flake8]

steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install dependencies
run: |
pip install isort
- uses: isort/[email protected]
with:
sort-paths: 'prefill_haalcentraalhr tests'
configuration: '--check-only --diff'

black:
name: Check code formatting with black
runs-on: ubuntu-latest
name: "Code style: ${{ matrix.toxenv }}, py${{ matrix.python }}"

steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: ${{ matrix.python }}
- name: Install dependencies
run: |
pip install black
- name: Run black
run: |
black --check prefill_haalcentraalhr tests
run: pip install tox tox-gh-actions tox-uv

- run: tox
env:
TOXENV: ${{ matrix.toxenv }}

0 comments on commit 5708423

Please sign in to comment.