-
Notifications
You must be signed in to change notification settings - Fork 2
36 lines (30 loc) · 1.46 KB
/
test.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
name: Test - Django CI
on:
push:
pull_request:
schedule:
- cron: '0 0 * * 0' # weekly
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run tests
run: docker-compose run app bin/wait-for-deps.sh coverage run -a --source=pombola,pombola_sayit,wordcloud,writeinpublic ./manage.py test --settings=pombola.settings.tests_south_africa
- name: Set up database
run: docker-compose run --rm app python manage.py migrate
- name: Collect static files
run: docker-compose run --rm app python manage.py collectstatic --noinput
- name: Load demo data fixture
run: docker-compose run --rm app python manage.py loaddata demodata.json
- name: Start server
run: docker-compose up -d
- name: "Smoke test demo data check that a typical request returns the data in demodata"
run: wget --retry-connrefused --waitretry=1 --read-timeout=10 --timeout=10 --tries=10 -O- http://localhost:8000/position/member/parliament/\?order\=name\&a\=1 | grep "Ramokgopa"
# Log output in case issues occurred where this can help us debug quickly
- run: docker-compose logs db elasticsearch
if: ${{ always() }}
# Run codecov passing appropriate codecov.io CI environment variables to container
- name: Upload coverage data to codecov.io
run: "docker-compose run --rm `bash <(curl -s https://codecov.io/env)` app codecov"
if: ${{ always() }}