treeherder/.travis.yml

81 строка
2.9 KiB
YAML

dist: xenial
# Use the latest Travis images since they are more up to date than the stable release.
group: edge
matrix:
include:
- env: js-tests
language: node_js
# The Node version here must be kept in sync with that in `package.json`.
node_js: '11'
cache:
directories:
- node_modules
install:
- source ./bin/travis-setup.sh js_env
script:
# `yarn build` is tested as part of the Selenium job.
- yarn lint
# `yarn lint` only checks the formatting of JS/JSX, this will also check CSS/HTML/JSON/Markdown/YAML.
- yarn format:check
- yarn test
- env: python-linters
language: python
# The Python version here must be kept in sync with that in `runtime.txt` (used by Heroku/Vagrant).
python: '3.7.2'
cache:
directories:
- ${HOME}/venv
install:
- source ./bin/travis-setup.sh python_env docs
script:
- pip check
- python -bb lints/queuelint.py
- flake8 --show-source
- isort --check-only --diff --quiet
- git grep -El '^#!/.+\b(bash|sh)\b' | xargs shellcheck
- mkdocs build
- env: python-tests-main
language: python
# The Python version here must be kept in sync with that in `runtime.txt` (used by Heroku/Vagrant).
python: '3.7.2'
cache:
directories:
- ${HOME}/venv
install:
- source ./bin/travis-setup.sh services python_env
# Create the test database for `manage.py check --deploy`.
- mysql -u root -e 'create database test_treeherder;'
script:
# Several security features in settings.py (eg setting HSTS headers) are conditional on
# 'https://' being in the site URL. In addition, we override the test environment's debug
# value so the tests pass. The real environment variable will be checked during deployment.
- SITE_URL='https://treeherder.dev' TREEHERDER_DEBUG='False' python -bb ./manage.py check --deploy --fail-level WARNING
# Using `-bb` mode to surface BytesWarnings:
# https://docs.python.org/3.7/using/cmdline.html#cmdoption-b
- python -bb -m pytest tests/ --runslow --ignore=tests/selenium/
- env: python-tests-selenium
language: python
# The Python version here must be kept in sync with that in `runtime.txt` (used by Heroku/Vagrant).
python: '3.7.2'
cache:
directories:
- ${HOME}/venv
- node_modules
install:
# The Node version here must be kept in sync with that in `package.json`.
- nvm install 11
- source ./bin/travis-setup.sh services python_env browser js_env
before_script:
# Run in `before_script` to prevent the selenium tests from still being run if the UI build fails.
- yarn build
script:
- python -bb -m pytest tests/selenium/
notifications:
email:
on_success: never
on_failure: always