Skip to content

Commit

Permalink
Better on pr workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
dyakovri committed Apr 6, 2024
1 parent 1f0366f commit 188d3e8
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
name: Python package
name: Python tests

on:
pull_request:


jobs:
test:
name: Unit tests
Expand All @@ -18,7 +17,7 @@ jobs:
docker run -d -p 5432:5432 -e POSTGRES_HOST_AUTH_METHOD=trust --name db-test postgres:15-alpine
- uses: actions/setup-python@v4
with:
python-version: '3.11'
python-version: "3.11"
- name: Install dependencies
run: |
python -m ensurepip
Expand All @@ -28,6 +27,7 @@ jobs:
run: |
DB_DSN=postgresql://postgres@localhost:5432/postgres alembic upgrade head
- name: Build coverage file
id: pytest
run: |
DB_DSN=postgresql://postgres@localhost:5432/postgres pytest --junitxml=pytest.xml --cov-report=term-missing:skip-covered --cov=calendar_backend tests/ | tee pytest-coverage.txt
- name: Print report
Expand All @@ -48,6 +48,10 @@ jobs:
remove-link-from-badge: false
junitxml-path: ./pytest.xml
junitxml-title: Summary
- name: Fail on pytest errors
if: steps.pytest.outcome == 'failure'
run: exit 1

linting:
runs-on: ubuntu-latest
steps:
Expand All @@ -60,7 +64,7 @@ jobs:
requirementsFiles: "requirements.txt requirements.dev.txt"
- uses: psf/black@stable
- name: Comment if linting failed
if: ${{ failure() }}
if: failure()
uses: thollander/actions-comment-pull-request@v2
with:
message: |
Expand Down

0 comments on commit 188d3e8

Please sign in to comment.