Skip to content

Commit

Permalink
simplify CircleCI config
Browse files Browse the repository at this point in the history
no more virtualenv
  • Loading branch information
snarfed committed Jan 14, 2022
1 parent 3bb1a90 commit 222b4f8
Showing 1 changed file with 14 additions and 20 deletions.
34 changes: 14 additions & 20 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,54 +2,48 @@
# configuration. Docs:
# https://circleci.com/docs/2.0/configuration-reference/
# https://circleci.com/docs/2.0/sample-config/
version: 2
version: 2.1

jobs:
build:
docker:
# https://circleci.com/docs/2.0/google-container-engine/#selecting-a-base-image
# https://hub.docker.com/r/google/cloud-sdk
- image: google/cloud-sdk

steps:
- checkout

- restore_cache:
key: venv-7-{{ .Branch }}-{{ checksum "requirements.txt" }}-{{ checksum "setup.py" }}
keys:
- venv-7-{{ .Branch }}-{{ checksum "requirements.txt" }}-{{ checksum "setup.py" }}
- venv-7-{{ .Branch }}-{{ checksum "requirements.txt" }}
- venv-7-{{ .Branch }}
- venv-7

- run:
name: Base dependencies
name: Install dependencies
command: |
apt-get update
apt-get install -y python3
git submodule sync
git submodule update --init
- run:
name: Python 3 dependencies
command: |
apt-get install -y python3-venv python3-dev
python3 -m venv local
. local/bin/activate
pip install -U pip
pip install cython # avoids grpcio install bug (search _needs_stub)
pip -V
pip install -U -r requirements.txt
pip install coverage coveralls
- run:
name: Test Python 3
name: Run tests
command: |
. local/bin/activate
CLOUDSDK_CORE_PROJECT=oauth-dropins gcloud beta emulators datastore start --no-store-on-disk --consistency=1.0 --host-port=localhost:8089 < /dev/null >& /dev/null &
CLOUDSDK_CORE_PROJECT=oauth-dropins gcloud beta emulators datastore start --no-store-on-disk --consistency=1.0 --host-port=localhost:8089 --quiet &
sleep 5s
DATASTORE_EMULATOR_HOST=localhost:8089 DATASTORE_DATASET=oauth-dropins python -m coverage run --include=oauth_dropins/webutil/handlers.py,oauth_dropins/webutil/models.py,oauth_dropins/webutil/util.py -m unittest discover -v -p 'test_*.py'
python3 -m coverage run --include=oauth_dropins/webutil/handlers.py,oauth_dropins/webutil/models.py,oauth_dropins/webutil/util.py -m unittest discover -v -p 'test_*.py'
kill %1
python -m coverage html -d /tmp/coverage_html
python3 -m coverage html -d /tmp/coverage_html
if [ "$COVERALLS_REPO_TOKEN" != "" ]; then coveralls || true; fi
- save_cache:
key: venv-7-{{ .Branch }}-{{ checksum "requirements.txt" }}-{{ checksum "setup.py" }}
paths:
- "local"
- "/usr/local/lib/python3.7/dist-packages/"

- store_artifacts:
path: /tmp/coverage_html

0 comments on commit 222b4f8

Please sign in to comment.