BREAKING CHANGE: Version bump trigger #4
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: Code quality | |
on: | |
push: | |
branches: | |
- dev | |
- main | |
paths: | |
- http_csp/** | |
- pyproject.toml | |
- poetry.lock | |
pull_request: | |
branches: | |
- dev | |
- main | |
paths: | |
- http_csp/** | |
- pyproject.toml | |
- poetry.lock | |
jobs: | |
test: | |
name: Run tests | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Poetry | |
uses: snok/install-poetry@v1 | |
with: | |
version: latest | |
virtualenvs-create: true | |
virtualenvs-in-project: false | |
installer-parallel: true | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.11 | |
cache: poetry | |
- name: Install dependencies | |
run: poetry install --with dev | |
- name: Lint with flake8 | |
run: | | |
# stop the build if there are Python syntax errors or undefined names | |
poetry run flake8 . --count --select=E9,F63,F7,F82 \ | |
--show-source --statistics | |
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide | |
poetry run flake8 . --count --exit-zero --max-complexity=10 \ | |
--max-line-length=127 --statistics | |
- name: Run tests | |
run: poetry run pytest | |
- name: Dependencies safety check | |
run: | | |
poetry export --without-hashes -f requirements.txt | \ | |
poetry run safety check --full-report --stdin | |
- name: Create code coverage report | |
uses: MishaKav/pytest-coverage-comment@main |