Skip to content

Commit

Permalink
Merge pull request googleapis#2701 from dhermes/add-circleci-config
Browse files Browse the repository at this point in the history
Adding basic CircleCI configuration.
  • Loading branch information
dhermes authored Nov 9, 2016
2 parents 0e714a7 + 8576e49 commit 43631a8
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ script:
- scripts/update_docs.sh

after_success:
- scripts/travis_coveralls.sh
- scripts/coveralls.sh

cache:
directories:
Expand Down
23 changes: 23 additions & 0 deletions circle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
dependencies:
override:
- pip install --upgrade pip tox tox-pyenv
# latest as of Nov. 7, 2016: 2.7.12, 3.4.5, 3.5.2
- pyenv local 2.7.12 3.4.4 3.5.2

test:
override:
- python2.7 scripts/run_unit_tests.py
- python3.4 scripts/run_unit_tests.py
- python3.5 scripts/run_unit_tests.py
- python scripts/run_unit_tests.py --tox-env cover
- tox -e lint
# - tox -e system-tests
# - tox -e system-tests3
# - scripts/update_docs.sh
post:
- scripts/coveralls.sh

general:
branches:
ignore:
- gh-pages
15 changes: 10 additions & 5 deletions scripts/travis_coveralls.sh → scripts/coveralls.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,19 @@

set -ev

##################################################
# Only run coveralls during a Travis push build. #
##################################################
#############################################################
# Only run coveralls during a CircleCI / Travis push build. #
#############################################################
if [[ "${TRAVIS_BRANCH}" == "master" ]] && \
[[ "${TRAVIS_PULL_REQUEST}" == "false" ]]; then
echo "Sending coverage report on a merge to master."
tox -e coveralls
echo "Sending coverage report on a Travis merge to master."
elif [[ "${CIRCLECI}" == "true" ]] && \
[[ "${CIRCLE_BRANCH}" == "master" ]] && \
[[ "${CI_PULL_REQUEST}" == "" ]]; then
echo "Sending coverage report on a CircleCI merge to master."
else
echo "Not on a push build for master, skipping coveralls."
exit
fi

tox -e coveralls
3 changes: 2 additions & 1 deletion system_tests/system_test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ def unique_resource_id(delimiter='_'):
Intended to help locate resources created in particular
testing environments and at particular times.
"""
build_id = os.getenv('TRAVIS_BUILD_ID', '')
build_id = os.getenv(
'TRAVIS_BUILD_ID', os.getenv('CIRCLE_BUILD_NUM', ''))
if build_id == '':
return '%s%d' % (delimiter, 1000 * time.time())
else:
Expand Down
4 changes: 2 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ skip_install =
py34: True
py35: True
cover: True
passenv = TRAVIS* GOOGLE_CLOUD_*
passenv = CI_* CIRCLE* TRAVIS* GOOGLE_CLOUD_*

[testenv:cover]
commands =
Expand Down Expand Up @@ -236,7 +236,7 @@ commands =
python {toxinidir}/system_tests/attempt_system_tests.py {posargs}
deps =
{[testing]deps}
passenv = GOOGLE_* TRAVIS* encrypted_*
passenv = CI_* CIRCLE* GOOGLE_* TRAVIS* encrypted_*

[testenv:system-tests3]
basepython =
Expand Down

0 comments on commit 43631a8

Please sign in to comment.