-
Notifications
You must be signed in to change notification settings - Fork 2
28 lines (24 loc) · 891 Bytes
/
python-app.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
name: Build and Run tests
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build the project
run: docker-compose -f docker-compose-test.yml up -d --build
- name: Run Django and pytest tests and generate report
run: |
docker-compose exec -T web coverage run --source=noise_sensors_monitoring,mqtt -m pytest
docker-compose exec -T web coverage run -a --source=users,pages,devices manage.py test
docker-compose exec -T web coverage report -m
- name: Upload Coverage to Codecov
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: |
docker-compose exec -T web pip install codecov
docker-compose exec -T web codecov -t $CODECOV_TOKEN