-
Notifications
You must be signed in to change notification settings - Fork 1
46 lines (42 loc) · 1.22 KB
/
unittest.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
name: Run unittests
on: [push]
jobs:
tests:
runs-on: ubuntu-latest
container: python:3.11
services:
postgres:
image: postgres
env:
POSTGRES_PASSWORD: postgres
POSTGRES_DB: mesads
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v3
- name: Install build tools
run: |
apt-get update && apt-get install -y npm
curl -sSL https://install.python-poetry.org | python3 -
- name: Install dependencies
run: |
npm install
/github/home/.local/bin/poetry install
npm run build
- name: Run tests and coverage
run: |
/github/home/.local/bin/poetry run coverage run --source=. manage.py test
env:
DB_HOST: postgres
DB_PORT: 5432
DB_USER: postgres
DB_PASSWORD: postgres
- name: Coverage report
run: |
/github/home/.local/bin/poetry run coverage report
/github/home/.local/bin/poetry run coverage xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3