/
.travis.yml
99 lines (81 loc) · 3.18 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
sudo: required
language: python
python:
- "3.5"
cache:
directories:
- /home/travis/.cache/pip
- /home/travis/.cypress/Cypress
addons:
postgresql: "10"
apt:
packages:
- postgresql-10
- postgresql-client-10
- libgconf-2-4 # for Cypress
install:
- node --version
- NODE_VERSION=10.16.0
- nvm install $NODE_VERSION
- nvm use $NODE_VERSION
- node --version
- npm --version
- npm install -g npm@6.9.0
- npm --version
- pip install -r requirements.txt --quiet
env:
global:
# These env vars are available to every build
- PYTHONPATH=$PYTHONPATH:../refinery:../refinery/config
- DJANGO_SETTINGS_MODULE=config.settings.prod
# CYPRESS_RECORD_KEY:
- secure: oGdTYh3rnPdG7qVGYq3TgVESypir1btO2kmafumtKR6o+FYmMtb09pe+HtiT6Qfv4pDwnYZ2RTYqsTY4h6POigU5j7qQPSsZ5WkhHt9ybFyt/vfo2B95GaAIFt+8LVjTX5TItyw0/PPUCCUluQ1n8k/NCtSfMb0kIT/CuLrg7N8=
before_script:
# PostgreSQL-10 is still not fully supported by Travis.
# See: https://github.com/travis-ci/travis-ci/issues/8537#issuecomment-416467506
# Use default postgres port
- sudo sed -i 's/port = 5433/port = 5432/' /etc/postgresql/10/main/postgresql.conf
# Use postgres 9.6 auth config:
- sudo cp /etc/postgresql/{9.6,10}/main/pg_hba.conf
- sudo service postgresql restart
# Vagrant is not used on travis: This user is just for the database.
- createuser --createdb --no-superuser --no-createrole vagrant
- createdb -O vagrant refinery
- cd refinery
# See http://www.stuartellis.eu/articles/erb/#running-erb-from-the-command-line
- erb config/config.json.erb > config/config.json
- python manage.py migrate --noinput --fake-initial
- npm install -g grunt-cli@0.1.13 --progress false --quiet || ( cat npm-debug.log && false )
- cd ui
- npm install --progress false --quiet || ( cat npm-debug.log && false )
- cd ../
# Required for cypress tests; TODO: Move to puppet.
# TODO: Start up solr
- python manage.py loaddata guest.json
- python manage.py activate_user guest
- python manage.py add_users_to_public_group
- pushd ui && grunt make && popd
- python manage.py collectstatic --noinput -v 0
- python manage.py runserver --insecure --settings config.settings.dev 2>&1 | grep -v 200 &
script:
- set -e # Any error will cause travis to exit early and report a failure.
# TODO: Not the same behavior as pre-commit hook.
# https://github.com/refinery-platform/refinery-platform/issues/1851
- flake8 ..
- echo 'travis_fold:start:grunt'
- pushd ui && grunt test && popd
- echo 'travis_fold:end:grunt'
- echo 'travis_fold:start:django-tests'
- coverage run manage.py test --failfast
- echo 'travis_fold:end:django-tests'
- echo 'travis_fold:start:cypress'
- pushd ui && node_modules/.bin/cypress run --record && popd
- echo 'travis_fold:end:cypress'
- set +e # Currently, codecov does not always exit with 0, but that should not cause travis to fail.
after_success:
- echo 'travis_fold:start:codecov'
- codecov
- echo 'travis_fold:end:codecov'
notifications:
slack:
secure: nDs9Oj08nRizuD0edl6WcrSgaTPMyITQjZc4qPZpt+yOxUehWbrAmVhqYypfyvdj4qSi1E72rPTXftuBB1E1IZBgX4CCkrCkWGLgIxHaaValTd64oOX66eC3BbSehQxuJB7w1DWw54xBUkTy6+ufjAqiwhLpoEUeE296urAWYHU=