/
config.yml
82 lines (70 loc) · 2.21 KB
/
config.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
# Python CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-python/ for more details
#
version: 2
jobs:
build:
docker:
- image: circleci/python:3.6.6-stretch-node
environment:
DATABASE_URL: postgresql://root@localhost/opentech?sslmode=disable
PGHOST: localhost
PGUSER: root
DJANGO_SETTINGS_MODULE: opentech.settings.test
SEND_MESSAGES: false
- image: circleci/postgres:10.5
environment:
POSTGRES_USER: root
POSTGRES_DB: opentech
working_directory: ~/repo
steps:
- checkout
- run:
name: set owner on /usr/local
command: sudo chown -R circleci:circleci /usr/local
- restore_cache:
keys:
- v2-python-{{ .Branch }}-{{ checksum "requirements.txt" }}
- v2-python-{{ .Branch }}-
- v2-python-
- restore_cache:
keys:
- v2-npm-{{ .Branch }}-{{ checksum "package-lock.json" }}
- v2-npm-{{ .Branch }}-
- v2-npm-
- run:
name: install python dependencies
command: |
python3 -m venv venv
. venv/bin/activate
pip install coverage codecov
pip install -r requirements.txt
- run:
name: install node dependencies
command: |
npm install --quiet
npm install -g gulp-cli
- save_cache:
paths:
- ./venv
key: v2-python-{{ .Branch }}-{{ checksum "requirements.txt" }}
- save_cache:
paths:
- ./node_modules
- /usr/local/lib/node_modules
- /usr/local/bin
key: v2-npm-{{ .Branch }}-{{ checksum "package-lock.json" }}
- run:
name: buils static assets
command: gulp deploy
- run:
name: run tests
command: |
. venv/bin/activate
flake8 ./opentech
python manage.py collectstatic --noinput --verbosity=0
python manage.py check
python manage.py makemigrations --check --noinput --verbosity=0
coverage run --source='opentech' manage.py test
codecov