Skip to content

Commit

Permalink
Improve workflow
Browse files Browse the repository at this point in the history
Add coverage report to test workflow
  • Loading branch information
jotonedev committed Sep 19, 2024
1 parent 1a53dc7 commit f5f79f9
Show file tree
Hide file tree
Showing 3 changed files with 113 additions and 4 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ on:
pull_request:

jobs:
build:

test:
runs-on: ubuntu-latest
continue-on-error: false
strategy:
Expand All @@ -35,11 +34,18 @@ jobs:
run: poetry install --sync --no-interaction

- name: Lint with flake8
if: matrix.python-version == '3.12'
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: Test with pytest
- name: Test code
if: matrix.python-version != '3.12'
run: poetry run pytest

- name: Test code with coverage
if: matrix.python-version == '3.12'
run: poetry run coverage run -m pytest && poetry run coverage report -m
continue-on-error: true
104 changes: 103 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ python = "^3.11"
[tool.poetry.group.dev.dependencies]
flake8 = "^7.1.1"
pytest = "^8.3.3"
pytest-cov = "^5.0.0"

[build-system]
requires = ["poetry-core"]
Expand Down

0 comments on commit f5f79f9

Please sign in to comment.