forked from wger-project/wger
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
61 lines (49 loc) · 1.49 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
55
56
57
58
59
60
61
language: python
dist: bionic
services:
- postgresql
# Cache the pip files
cache:
directories:
- $HOME/.cache/pip
- $HOME/.nvm
- node_modules
- wger/node_modules
# Use container infrastructure
sudo: false
# Python versions to test
python:
- "3.6"
- "3.7"
- "3.8"
# Manually define here the combinations environment variables to test
# https://github.com/travis-ci/travis-ci/issues/1519
env:
- TEST_MOBILE=True DB=postgresql TRAVIS_NODE_VERSION="6"
- TEST_MOBILE=True DB=sqlite TRAVIS_NODE_VERSION="6"
- TEST_MOBILE=False DB=postgresql TRAVIS_NODE_VERSION="6"
- TEST_MOBILE=False DB=sqlite TRAVIS_NODE_VERSION="6"
# Install the application
install:
# Install requirements
- pip install -r requirements_devel.txt
- python setup.py develop
- npm install -g gulp gulp-cli
- npm install
- 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