bridgy-fed/.circleci/config.yml

51 wiersze
1.7 KiB
YAML

# 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-auth/#installing-the-google-cloud-sdk
- image: google/cloud-sdk
environment:
# https://github.com/GoogleCloudPlatform/google-cloud-datastore/issues/168#issuecomment-294418422
- APPLICATION_ID: dev~bridgy-federated
steps:
- checkout
- restore_cache:
key: venv-{{ .Branch }}-{{ checksum "requirements.txt" }}
- run:
name: Dependencies
command: |
apt-get update
apt-get install -y python3.7 python3.7-venv python3.7-dev
python3.7 -m venv local3
. local3/bin/activate
pip install -U -r requirements.txt
pip install mox3
pip install coverage coveralls
- 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
if [ "$COVERALLS_REPO_TOKEN" != "" ]; then coveralls || true; fi
- save_cache:
key: venv-{{ .Branch }}-{{ checksum "requirements.txt" }}
paths:
- local
- store_artifacts:
path: /tmp/coverage_html