kopia lustrzana https://github.com/jupyterhub/repo2docker
Run pre-commit hooks on travis
rodzic
32b32bf1d9
commit
00d1258c07
29
.travis.yml
29
.travis.yml
|
@ -15,21 +15,44 @@ install:
|
||||||
- pip install dist/*.whl
|
- pip install dist/*.whl
|
||||||
- pip freeze
|
- pip freeze
|
||||||
script:
|
script:
|
||||||
# cd into tests so CWD being repo2docker does not hide
|
- |
|
||||||
# possible issues with MANIFEST.in
|
# run autoformat
|
||||||
- pushd tests;
|
if [[ "$REPO_TYPE" == "lint" ]]; then
|
||||||
|
pre-commit run --all-files
|
||||||
|
fi
|
||||||
|
- |
|
||||||
|
# run any of the other tests
|
||||||
|
if [[ "$REPO_TYPE" != "lint" ]]; then
|
||||||
|
# cd into tests so CWD being repo2docker does not hide
|
||||||
|
# possible issues with MANIFEST.in
|
||||||
|
pushd tests;
|
||||||
if [ ${REPO_TYPE} == "r" ] || [ ${REPO_TYPE} == "stencila-r" ] || [ ${REPO_TYPE} == "stencila-py" ]; then
|
if [ ${REPO_TYPE} == "r" ] || [ ${REPO_TYPE} == "stencila-r" ] || [ ${REPO_TYPE} == "stencila-py" ]; then
|
||||||
travis_wait 30 pytest --durations 10 --cov repo2docker -v ${REPO_TYPE} || exit 1;
|
travis_wait 30 pytest --durations 10 --cov repo2docker -v ${REPO_TYPE} || exit 1;
|
||||||
else
|
else
|
||||||
travis_retry pytest --durations 10 --cov repo2docker -v ${REPO_TYPE} || exit 1;
|
travis_retry pytest --durations 10 --cov repo2docker -v ${REPO_TYPE} || exit 1;
|
||||||
fi;
|
fi;
|
||||||
popd;
|
popd;
|
||||||
|
fi
|
||||||
after_success:
|
after_success:
|
||||||
- pip install codecov
|
- pip install codecov
|
||||||
- pushd tests && codecov && popd
|
- pushd tests && codecov && popd
|
||||||
|
|
||||||
|
after_failure:
|
||||||
|
- |
|
||||||
|
# point to auto-lint-fix
|
||||||
|
if [[ "$REPO_TYPE" == "lint" ]]; then
|
||||||
|
echo "You can install pre-commit hooks to automatically run formatting"
|
||||||
|
echo "on each commit with:"
|
||||||
|
echo " pre-commit install"
|
||||||
|
echo "or you can run by hand on staged files with"
|
||||||
|
echo " pre-commit run"
|
||||||
|
echo "or after-the-fact on already committed files with"
|
||||||
|
echo " pre-commit run --all-files"
|
||||||
|
fi
|
||||||
|
|
||||||
env:
|
env:
|
||||||
matrix:
|
matrix:
|
||||||
|
- REPO_TYPE=lint
|
||||||
- REPO_TYPE=unit
|
- REPO_TYPE=unit
|
||||||
- REPO_TYPE=base
|
- REPO_TYPE=base
|
||||||
- REPO_TYPE=conda
|
- REPO_TYPE=conda
|
||||||
|
|
Ładowanie…
Reference in New Issue