Skip to content

Commit

Permalink
Updated for PyTest and Poetry
Browse files Browse the repository at this point in the history
  • Loading branch information
rofrano committed Mar 9, 2024
1 parent 5df638d commit ef2843c
Showing 1 changed file with 14 additions and 17 deletions.
31 changes: 14 additions & 17 deletions .github/workflows/workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ on:
branches:
- master
paths-ignore:
- 'README.md'
- '.vscode/**'
- '.devcontainers/**'
- 'README.md'
- '.vscode/**'
- '.devcontainers/**'

pull_request:
branches:
- master
paths-ignore:
- 'README.md'
- '.vscode/**'
- '.devcontainers/**'
- 'README.md'
- '.vscode/**'
- '.devcontainers/**'

jobs:
build:
Expand All @@ -24,35 +24,32 @@ jobs:
# Required services
services:
redis:
image: redis
image: redis:6-alpine
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Install Python dependencies
- name: Install dependencies
run: |
python -m pip install --upgrade pip wheel
pip install -r requirements.txt
python -m pip install poetry
poetry config virtualenvs.create false
poetry install
- name: Linting
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 service tests --count --select=E9,F63,F7,F82 --show-source --statistics
# check for omplexity. The GitHub editor is 127 chars wide
flake8 service tests --count --max-complexity=10 --max-line-length=127 --statistics
# Run pylint on the service and tests folders only
pylint service tests --max-line-length=127
- name: Run unit tests with green
run: green
- name: Run unit tests with PyTest
run: pytest
env:
DATABASE_URI: "redis://redis:6379/0"
RETRY_COUNT: 2

- name: Upload code coverage
uses: codecov/[email protected]

0 comments on commit ef2843c

Please sign in to comment.