forked from wger-project/wger
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
54 lines (42 loc) · 1.08 KB
/
.travis.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
47
48
49
50
51
52
53
54
language: python
dist: bionic
services:
- postgresql
# Cache the pip files
cache:
directories:
- $HOME/.cache/pip
- $HOME/.nvm
- node_modules
- wger/node_modules
# Python versions to test
python:
- "3.6"
- "3.7"
- "3.8"
node_js: 10
env:
- DB=postgresql
- DB=sqlite
# Install the application
install:
# Install requirements
- pip install -r requirements_dev.txt
- python setup.py develop
- cd wger
- if [[ "$DB" = "postgresql" ]]; then pip install psycopg2; fi
# Setup application
- if [[ "$DB" = "sqlite" ]]; then wger create-settings; fi
- if [[ "$DB" = "postgresql" ]]; then wger create-settings --database-type postgresql; fi
# change back to the source folder
- cd ..
# Create test databases
before_script:
- if [[ "$DB" = "postgresql" ]]; then psql -c 'DROP DATABASE IF EXISTS test_wger;' -U postgres; fi
- if [[ "$DB" = "postgresql" ]]; then psql -c 'CREATE DATABASE test_wger;' -U postgres; fi
# Do the tests
script:
# Regular application
- coverage run --source='.' ./manage.py test --parallel
# Code coverage
- coverage report