-
-
Notifications
You must be signed in to change notification settings - Fork 9
/
.travis.yml
63 lines (54 loc) · 1.96 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
# use container-based Ubuntu Trusty
dist: bionic
sudo: true
language: python
python:
- "3.8.13"
services:
- docker
- elasticsearch
before_install:
# install the chosen PG version
- sudo -E apt-get -yq --no-install-suggests --no-install-recommends install postgresql-11 postgresql-client-11
- sudo -E sed -i -e '/local.*peer/s/postgres/all/' -e 's/peer\|md5/trust/g' /etc/postgresql/*/main/pg_hba.conf
- sudo -E sed -i 's/port = 5433/port = 5432/' /etc/postgresql/*/main/postgresql.conf
# give PG some time to finish setup
- sleep 10
# stop any running postgres versions
- sudo -E service postgresql stop 10
- sudo -E ps axuwww | grep -i postg
# possibly a Travis bug but data directory sometimes not initialized
- if [ ! -d /var/ramfs/postgresql/11/main ]; then sudo -u postgres /usr/lib/postgresql/11/bin/initdb -D /var/ramfs/postgresql/11/main; fi
# start the chosen PG version
- sudo -E systemctl -l restart postgresql@11-main
- sudo -E systemctl -l status postgresql@11-main
before_script:
# setup test database
- psql -U postgres -c "CREATE USER bothub WITH PASSWORD 'bothub';"
- psql -U postgres -c "ALTER ROLE bothub WITH SUPERUSER;"
- psql -U bothub postgres -c "CREATE DATABASE bothub;"
install:
- pip install --upgrade pip
- pip install poetry==1.1.12
- poetry config virtualenvs.create false --local
- poetry install
- pip install coveralls
env:
global:
- SECRET_KEY=SK
- SUPPORTED_LANGUAGES="en|pt"
- DEFAULT_DATABASE="postgres://bothub:bothub@localhost:5432/bothub"
- ELASTICSEARCH_DSL="http://localhost:9200"
- ELASTICSEARCH_SIGNAL_PROCESSOR="realtime"
- ELASTICSEARCH_NUMBER_OF_SHARDS=1
- ELASTICSEARCH_NUMBER_OF_REPLICAS=0
- USE_ELASTICSEARCH="false"
script:
- python manage.py migrate
- python manage.py search_index --create -f
- python manage.py search_index --populate -f
- python manage.py collectstatic
- flake8
- travis_wait coverage run manage.py test
after_success:
- coveralls