-
Notifications
You must be signed in to change notification settings - Fork 51
/
config.yml
75 lines (64 loc) 路 2.59 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
# CircleCI automatically reads this file from our repo and uses it for
# configuration. Docs:
# https://circleci.com/docs/2.0/configuration-reference/
# https://circleci.com/docs/2.0/sample-config/
version: 2
jobs:
build:
docker:
# https://circleci.com/docs/2.0/google-container-engine/#selecting-a-base-image
- image: google/cloud-sdk
environment:
# https://github.com/GoogleCloudPlatform/google-cloud-datastore/issues/168#issuecomment-294418422
- APPLICATION_ID: dev~brid-gy
steps:
- checkout
- restore_cache:
keys:
- venv-npm-2-{{ .Branch }}-{{ checksum "requirements.txt" }}-{{ checksum "browser-extension/package.json" }}
- venv-npm-2-{{ .Branch }}-{{ checksum "requirements.txt" }}
- venv-npm-2-{{ .Branch }}
- venv-npm-2
- run:
name: Base dependencies
command: |
apt-get update
apt-get install -y python3 npm nodejs
- run:
name: Python 3 dependencies
command: |
apt-get install -y python3-venv python3-dev
python3 -m venv local3
. local3/bin/activate
pip install -U pip
pip install cython # avoids grpcio install bug (search _needs_stub)
pip install -U -r requirements.txt
pip install mox3
pip install coverage coveralls
- run:
name: JavaScript dependencies
command: |
cd browser-extension
npm install
- run:
name: Test Python 3
command: |
. local3/bin/activate
CLOUDSDK_CORE_PROJECT=brid-gy gcloud beta emulators datastore start --no-store-on-disk --consistency=1.0 --host-port=localhost:8089 < /dev/null >& /dev/null &
sleep 5s
python -m coverage run --source=. --omit=admin.py,appengine_config.py,local3/\*,logs.py,scripts/\*,tests/\* -m unittest discover -v
if [ "$TWITTER_LIVE_TEST_APP_KEY" != "" ]; then PYTHONPATH=. python tests/twitter_live_test.py --debug; fi
python -m coverage html -d /tmp/coverage_html
if [ "$COVERALLS_REPO_TOKEN" != "" ]; then coveralls || true; fi
- run:
name: Test JavaScript
command: |
cd browser-extension
npm run test
- save_cache:
key: venv-npm-2-{{ .Branch }}-{{ checksum "requirements.txt" }}-{{ checksum "browser-extension/package.json" }}
paths:
- "local"
- "browser-extension/node_modules"
- store_artifacts:
path: /tmp/coverage_html