graphene/.travis.yml

86 lines
2.9 KiB
YAML
Raw Normal View History

2015-09-24 12:11:50 +03:00
language: python
sudo: false
python:
- 2.7
2015-10-06 08:59:23 +03:00
- 3.4
- 3.5
- pypy
2015-11-21 21:33:29 +03:00
cache:
2015-11-26 02:25:03 +03:00
directories:
- .cache/pip/
- $HOME/.cache/pip
- docs/node_modules/
- $HOME/docs/node_modules
before_install:
- |
2015-12-04 06:08:06 +03:00
git_diff=$(git diff --name-only $TRAVIS_COMMIT_RANGE)
if [ "$?" == 0 ] && [ "$TEST_TYPE" != build_website ] && \
! echo "$git_diff" | grep -qvE '(\.md$)|(^(docs))/'
then
echo "Only docs were updated, stopping build process."
exit
fi
2015-09-24 12:11:50 +03:00
install:
- |
if [ "$TEST_TYPE" = build ]; then
pip install --download-cache $HOME/.cache/pip/ pytest pytest-cov coveralls six
2016-04-03 06:13:30 +03:00
pip install --download-cache $HOME/.cache/pip psycopg2 > /dev/null 2>&1
2016-05-12 08:44:25 +03:00
pip install --download-cache $HOME/.cache/pip/ -e .
python setup.py develop
2015-11-28 12:56:36 +03:00
elif [ "$TEST_TYPE" = build_website ]; then
pip install --download-cache $HOME/.cache/pip/ -e .
python setup.py develop
elif [ "$TEST_TYPE" = lint ]; then
pip install --download-cache $HOME/.cache/pip/ flake8
fi
2015-09-24 12:11:50 +03:00
script:
- |
if [ "$TEST_TYPE" = build_website ]; then
2015-11-30 11:12:21 +03:00
if [ "$TRAVIS_BRANCH" = "master" ] && [ "$TRAVIS_PULL_REQUEST" = false ]; then
echo "Building the web."
nvm install 4.0
GH_PAGES_DIR="$TRAVIS_BUILD_DIR"/docs/public
git config --global user.name "Travis CI"
git config --global user.email "travis@graphene-python.org"
2015-11-30 11:12:21 +03:00
git clone --branch gh-pages --depth=50 \
https://graphql-python-bot@github.com/graphql-python/graphene.git \
$GH_PAGES_DIR
cd docs
2015-11-28 11:38:22 +03:00
./playground/graphene-js/build.sh
npm run deploy
cd $GH_PAGES_DIR
git status
2015-11-28 12:56:36 +03:00
git add --intent-to-add .
if ! git diff-index --quiet HEAD --; then
git add -A .
git commit -m "Rebuild website"
2015-11-30 11:12:21 +03:00
git push "https://${GITHUB_TOKEN}@github.com/graphql-python/graphene.git" gh-pages
fi
exit
fi
elif [ "$TEST_TYPE" = lint ]; then
echo "Checking Python code lint."
flake8
exit
elif [ "$TEST_TYPE" = build ]; then
2016-06-15 10:18:20 +03:00
py.test graphene examples --cov=graphene
fi
2015-09-24 12:11:50 +03:00
after_success:
- |
if [ "$TEST_TYPE" = build ]; then
coveralls
fi
2015-11-21 21:33:29 +03:00
env:
matrix:
- TEST_TYPE=build
global:
secure: SQC0eCWCWw8bZxbLE8vQn+UjJOp3Z1m779s9SMK3lCLwJxro/VCLBZ7hj4xsrq1MtcFO2U2Kqf068symw4Hr/0amYI3HFTCFiwXAC3PAKXeURca03eNO2heku+FtnQcOjBanExTsIBQRLDXMOaUkf3MIztpLJ4LHqMfUupKmw9YSB0v40jDbSN8khBnndFykmOnVVHznFp8USoN5F0CiPpnfEvHnJkaX76lNf7Kc9XNShBTTtJsnsHMhuYQeInt0vg9HSjoIYC38Tv2hmMj1myNdzyrHF+LgRjI6ceGi50ApAnGepXC/DNRhXROfECKez+LON/ZSqBGdJhUILqC8A4WmWmIjNcwitVFp3JGBqO7LULS0BI96EtSLe8rD1rkkdTbjivajkbykM1Q0Tnmg1adzGwLxRUbTq9tJQlTTkHBCuXIkpKb1mAtb/TY7A6BqfnPi2xTc/++qEawUG7ePhscdTj0IBrUfZsUNUYZqD8E8XbSWKIuS3SHE+cZ+s/kdAsm4q+FFAlpZKOYGxIkwvgyfu4/Plfol4b7X6iAP9J3r1Kv0DgBVFst5CXEwzZs19/g0CgokQbCXf1N+xeNnUELl6/fImaR3RKP22EaABoil4z8vzl4EqxqVoH1nfhE+WlpryXsuSaF/1R+WklR7aQ1FwoCk8V8HxM2zrj4tI8k=
matrix:
fast_finish: true
include:
- python: '2.7'
env: TEST_TYPE=build_website
- python: '2.7'
env: TEST_TYPE=lint