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:
|
2015-11-26 05:35:13 +03:00
|
|
|
- .cache/pip/
|
|
|
|
- $HOME/.cache/pip
|
|
|
|
- docs/node_modules/
|
|
|
|
- $HOME/docs/node_modules
|
2015-11-26 08:00:13 +03:00
|
|
|
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))/'
|
2015-11-26 08:00:13 +03:00
|
|
|
then
|
|
|
|
echo "Only docs were updated, stopping build process."
|
|
|
|
exit
|
|
|
|
fi
|
2015-09-24 12:11:50 +03:00
|
|
|
install:
|
2015-11-26 04:53:52 +03:00
|
|
|
- |
|
2015-11-26 05:35:13 +03:00
|
|
|
if [ "$TEST_TYPE" = build ]; then
|
2016-02-02 00:58:26 +03:00
|
|
|
pip install --download-cache $HOME/.cache/pip/ pytest pytest-cov coveralls six pytest-django django-filter sqlalchemy_utils
|
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 .
|
2015-11-26 08:00:13 +03:00
|
|
|
pip install --download-cache $HOME/.cache/pip/ -e .[django]
|
2016-01-22 22:30:24 +03:00
|
|
|
pip install --download-cache $HOME/.cache/pip/ -e .[sqlalchemy]
|
2015-12-04 19:13:45 +03:00
|
|
|
pip install django==$DJANGO_VERSION
|
2015-11-26 08:00:13 +03:00
|
|
|
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
|
2015-11-26 05:35:13 +03:00
|
|
|
elif [ "$TEST_TYPE" = lint ]; then
|
2015-11-26 08:00:13 +03:00
|
|
|
pip install --download-cache $HOME/.cache/pip/ flake8
|
2015-11-26 05:35:13 +03:00
|
|
|
fi
|
2015-09-24 12:11:50 +03:00
|
|
|
script:
|
2015-11-26 04:53:52 +03:00
|
|
|
- |
|
2015-11-26 05:35:13 +03:00
|
|
|
if [ "$TEST_TYPE" = build_website ]; then
|
2015-11-30 11:12:21 +03:00
|
|
|
if [ "$TRAVIS_BRANCH" = "master" ] && [ "$TRAVIS_PULL_REQUEST" = false ]; then
|
2015-11-26 05:35:13 +03:00
|
|
|
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 \
|
2015-11-26 05:35:13 +03:00
|
|
|
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
|
2015-11-26 05:35:13 +03:00
|
|
|
cd $GH_PAGES_DIR
|
|
|
|
git status
|
2015-11-28 12:56:36 +03:00
|
|
|
git add --intent-to-add .
|
2015-11-26 05:35:13 +03:00
|
|
|
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
|
2015-11-26 05:35:13 +03:00
|
|
|
fi
|
|
|
|
exit
|
2015-11-26 08:00:13 +03:00
|
|
|
fi
|
2015-11-26 05:35:13 +03:00
|
|
|
elif [ "$TEST_TYPE" = lint ]; then
|
2015-11-26 08:00:13 +03:00
|
|
|
echo "Checking Python code lint."
|
|
|
|
flake8
|
|
|
|
exit
|
2015-11-26 05:35:13 +03:00
|
|
|
elif [ "$TEST_TYPE" = build ]; then
|
2015-11-26 08:00:13 +03:00
|
|
|
py.test --cov=graphene
|
2015-11-26 05:35:13 +03:00
|
|
|
fi
|
2015-09-24 12:11:50 +03:00
|
|
|
after_success:
|
2015-11-26 04:53:52 +03:00
|
|
|
- |
|
2015-11-26 05:35:13 +03:00
|
|
|
if [ "$TEST_TYPE" = build ]; then
|
|
|
|
coveralls
|
|
|
|
fi
|
2015-11-21 21:33:29 +03:00
|
|
|
env:
|
2015-11-26 05:35:13 +03:00
|
|
|
matrix:
|
2015-12-12 11:40:26 +03:00
|
|
|
- TEST_TYPE=build
|
2015-11-26 05:35:13 +03:00
|
|
|
global:
|
|
|
|
secure: SQC0eCWCWw8bZxbLE8vQn+UjJOp3Z1m779s9SMK3lCLwJxro/VCLBZ7hj4xsrq1MtcFO2U2Kqf068symw4Hr/0amYI3HFTCFiwXAC3PAKXeURca03eNO2heku+FtnQcOjBanExTsIBQRLDXMOaUkf3MIztpLJ4LHqMfUupKmw9YSB0v40jDbSN8khBnndFykmOnVVHznFp8USoN5F0CiPpnfEvHnJkaX76lNf7Kc9XNShBTTtJsnsHMhuYQeInt0vg9HSjoIYC38Tv2hmMj1myNdzyrHF+LgRjI6ceGi50ApAnGepXC/DNRhXROfECKez+LON/ZSqBGdJhUILqC8A4WmWmIjNcwitVFp3JGBqO7LULS0BI96EtSLe8rD1rkkdTbjivajkbykM1Q0Tnmg1adzGwLxRUbTq9tJQlTTkHBCuXIkpKb1mAtb/TY7A6BqfnPi2xTc/++qEawUG7ePhscdTj0IBrUfZsUNUYZqD8E8XbSWKIuS3SHE+cZ+s/kdAsm4q+FFAlpZKOYGxIkwvgyfu4/Plfol4b7X6iAP9J3r1Kv0DgBVFst5CXEwzZs19/g0CgokQbCXf1N+xeNnUELl6/fImaR3RKP22EaABoil4z8vzl4EqxqVoH1nfhE+WlpryXsuSaF/1R+WklR7aQ1FwoCk8V8HxM2zrj4tI8k=
|
2015-11-26 04:53:52 +03:00
|
|
|
matrix:
|
|
|
|
fast_finish: true
|
|
|
|
include:
|
2015-12-12 11:40:26 +03:00
|
|
|
- python: '2.7'
|
2016-01-02 16:49:08 +03:00
|
|
|
env: TEST_TYPE=build DJANGO_VERSION=1.6
|
2015-12-12 11:40:26 +03:00
|
|
|
- python: '2.7'
|
2016-01-02 16:49:08 +03:00
|
|
|
env: TEST_TYPE=build DJANGO_VERSION=1.7
|
2015-12-12 11:40:26 +03:00
|
|
|
- python: '2.7'
|
2016-01-02 16:49:08 +03:00
|
|
|
env: TEST_TYPE=build DJANGO_VERSION=1.8
|
2015-12-12 11:40:26 +03:00
|
|
|
- python: '2.7'
|
2016-01-02 16:49:08 +03:00
|
|
|
env: TEST_TYPE=build DJANGO_VERSION=1.9
|
2015-11-26 05:35:13 +03:00
|
|
|
- python: '2.7'
|
|
|
|
env: TEST_TYPE=build_website
|
|
|
|
- python: '2.7'
|
|
|
|
env: TEST_TYPE=lint
|