/
.travis.yml
45 lines (45 loc) · 1.29 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
language: python
env:
global:
- PIPENV_IGNORE_VIRTUALENVS=1
- DJANGO_SETTINGS_MODULE=concordia.settings_test
dist: xenial
sudo: required
addons:
sonarcloud:
organization: "libraryofcongress"
python:
- "3.6"
- "3.7"
- "3.7-dev"
- "3.8-dev"
matrix:
allow_failures:
- python: 3.7-dev
- python: 3.8-dev
services:
- postgresql
before_script:
- psql -c 'create database concordia;' -U postgres
install:
- pip install --upgrade pip
# We install pre-commit outside of the virtualenv to avoid issues with pipenv / pip
# in the Travis CI Python 3.6 environment. Once we upgrade to Python 3.7 this will
# no longer be necessary:
- pip install coveralls "pipenv>=2018.11.26" pre-commit
- pipenv install --dev --deploy
# We want to have safety available but aren't putting it in the dev tools:
- pipenv run pip install safety
script:
- mkdir logs
- touch ./logs/concordia-celery.log
- pipenv run ./manage.py collectstatic --no-input
# n.b.
- pipenv run coverage run ./manage.py test
- git diff --name-only $TRAVIS_COMMIT_RANGE | xargs pre-commit run --files
- pipenv run safety check
after_success:
- git fetch --unshallow --tags
- pipenv run coverage xml
- sonar-scanner
- coveralls