Skip to content

Code coverage

Code coverage #22

Workflow file for this run

name: Django CI
on:
push:
branches: [ "dev" , "main"]
pull_request:
branches: [ "dev", "main" ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: [3.9]
db: [postgres]
include:
- db: postgres
db_port: 5432
services:
postgres:
image: postgres:10
env:
POSTGRES_USER: testUser
POSTGRES_PASSWORD: tstPassword
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
python -m nltk.downloader punkt stopwords wordnet omw-1.4
- name: Run Tests
env:
POSTGRES_USER: testUser
POSTGRES_PW: tstPassword
POSTGRESIP: 127.0.0.1
POSTGRESPORT: 5432
run: |
coverage run --source='.' manage.py test
coverage xml
- name: Upload coverage reports to Codecov with GitHub Action
uses: codecov/codecov-action@v3