forked from vintasoftware/django-react-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
proj_circle.yml
94 lines (93 loc) · 3.29 KB
/
proj_circle.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
version: 2
jobs:
build:
working_directory: ~/{{project_name}}
docker:
- image: circleci/python:3.7-stretch-node-browsers # remeber to update those!
steps:
- checkout
# this updates git-lfs to make pre-commit large files check hook work properly
# more details in https://github.com/pre-commit/pre-commit-hooks/issues/252
- run:
command: curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash
- run:
command: sudo apt-get install git-lfs --upgrade
- run:
command: sudo chown -R circleci:circleci /usr/local/bin
- run:
command: sudo chown -R circleci:circleci /usr/local/lib/python3.7/site-packages
- run:
command: pip install requests pip-tools --upgrade
{% verbatim %}
- restore_cache:
keys:
- v1-pip-cache-{{ .Branch }}-{{ .Environment.CIRCLE_SHA1 }}
- v1-pip-cache-{{ .Branch }}-
- v1-pip-cache-
- run:
command: |
pip-compile requirements.in > requirements.txt;
pip-compile dev-requirements.in > dev-requirements.txt;
pip install --user -r requirements.txt && pip install -r dev-requirements.txt
- save_cache:
key: pip-cache-{{ .Branch }}-{{ .Environment.CIRCLE_SHA1 }}
paths:
- .venv
- /usr/local/bin
- /usr/local/lib/python3.7/site-packages
- restore_cache:
keys:
- v1-npm-cache-{{ .Branch }}-{{ .Environment.CIRCLE_SHA1 }}
- v1-npm-cache-{{ .Branch }}-
- v1-npm-cache-
- run:
command: npm install
- save_cache:
key: npm-cache-{{ .Branch }}-{{ .Environment.CIRCLE_SHA1 }}
paths:
- node_modules
{% endverbatim %}
- run:
command: npm run build
- run:
command: npm run lint
# style check
- run:
command: prospector --messages-only
# security checks
- run:
command: bandit -r .
# imports check
- run:
command: isort **/*.py --check-only
- run:
command: pre-commit run --all-files
environment:
SKIP: prospector,isort,eslint,missing-migrations
- run:
command: (cd backend; python manage.py makemigrations --check --dry-run --ignore authtools)
environment:
DJANGO_SETTINGS_MODULE: '{{project_name}}.settings.local_base'
- run:
command: (cd backend; python manage.py check --deploy)
environment:
DJANGO_SETTINGS_MODULE: '{{project_name}}.settings.production'
SECRET_KEY: "$(python -c 'import uuid; print(uuid.uuid4().hex + uuid.uuid4().hex)')"
DATABASE_URL: 'sqlite:///'
ALLOWED_HOSTS: '.example.org'
SENDGRID_USERNAME: 'test'
SENDGRID_PASSWORD: 'test'
REDIS_URL: 'redis://'
- run:
command: (cd backend; coverage run manage.py test)
- run:
command: npm run test
- run:
command: |
mkdir -p test-reports/
coverage xml -o test-reports/results.xml
when: always
- store_test_results:
path: test-reports
- store_artifacts:
path: test-reports