-
Notifications
You must be signed in to change notification settings - Fork 2
/
.travis.yml
72 lines (54 loc) · 1.26 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
language: python
python:
- 3.7.4
cache:
pip: true
directories:
- node_modules
# Use container-based infrastructure
dist: trusty
sudo: false
# Services
services:
- postgresql
addons:
postgresql: '9.6'
env:
global:
- DJANGO_SETTINGS_MODULE=bc.settings.production
- DATABASE_URL=postgres://postgres@localhost/test_db
- SECRET_KEY=iamnotsosecret
- ALLOWED_HOSTS=localhost
before_script:
# Create a database
- psql -c 'create database test_db;' -U postgres
# Package installation
install:
# Install project dependencies
- pip install -r requirements.txt
# Install test dependencies
- pip install flake8
# Install node
- nvm install 12
# Install node dependencies
- npm ci --no-optional --no-audit --progress=false
# Build the static files
- npm run build:prod
# Run the tests
script:
# Run python code style checks
- flake8 bc
# Run JS code style checks
- npm run lint:js
# Run CSS code style checks
- npm run lint:css
# Run formatting code style checks
- npm run lint:format
# Run system checks
- python manage.py check
# Check for missing migrations
- python manage.py makemigrations --check
# Run back-end tests
- python manage.py test
# Run front-end tests
- npm run test:coverage