2017-08-25 18:05:25 +00:00
|
|
|
# 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:
|
2019-12-26 06:20:57 +00:00
|
|
|
# https://github.com/GoogleCloudPlatform/google-cloud-datastore/issues/168#issuecomment-294418422
|
|
|
|
- APPLICATION_ID: dev~bridgy-federated
|
2017-08-25 18:05:25 +00:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
|
|
|
|
- restore_cache:
|
2019-12-26 06:20:57 +00:00
|
|
|
key: venv-{{ .Branch }}-{{ checksum "requirements.txt" }}
|
2017-08-25 18:05:25 +00:00
|
|
|
|
|
|
|
- run:
|
2019-12-26 06:20:57 +00:00
|
|
|
name: Base dependencies
|
2017-08-25 18:05:25 +00:00
|
|
|
command: |
|
2019-12-26 06:20:57 +00:00
|
|
|
apt-get update
|
|
|
|
apt-get install -y python3
|
2017-08-25 18:05:25 +00:00
|
|
|
|
2018-10-16 15:55:22 +00:00
|
|
|
- run:
|
2019-12-26 06:20:57 +00:00
|
|
|
name: Python 3 dependencies
|
2018-10-16 15:55:22 +00:00
|
|
|
command: |
|
2019-12-26 06:20:57 +00:00
|
|
|
apt-get install -y python3-venv python3-dev
|
|
|
|
python3 -m venv local3
|
|
|
|
. local3/bin/activate
|
|
|
|
pip install -U -r requirements.txt
|
|
|
|
pip install mox3
|
|
|
|
pip install coverage coveralls
|
2017-08-25 18:05:25 +00:00
|
|
|
|
2019-12-26 06:20:57 +00:00
|
|
|
- run:
|
|
|
|
name: Build and test
|
|
|
|
command: |
|
|
|
|
. local3/bin/activate
|
|
|
|
CLOUDSDK_CORE_PROJECT=bridgy-federated 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=appengine_config.py,local3/\*,logs.py,tests/\* -m unittest discover -v
|
|
|
|
python -m coverage html -d /tmp/coverage_html
|
2019-08-13 14:14:53 +00:00
|
|
|
if [ "$COVERALLS_REPO_TOKEN" != "" ]; then coveralls || true; fi
|
2017-08-25 18:05:25 +00:00
|
|
|
|
|
|
|
- save_cache:
|
2019-12-26 06:20:57 +00:00
|
|
|
key: venv-{{ .Branch }}-{{ checksum "requirements.txt" }}
|
2017-08-25 18:05:25 +00:00
|
|
|
paths:
|
|
|
|
- local
|
|
|
|
|
|
|
|
- store_artifacts:
|
|
|
|
path: /tmp/coverage_html
|