treeherder/.travis.yml

97 строки
3.3 KiB
YAML

dist: xenial
# The fully visualised "sudo" GCE environments are faster for longer running jobs.
sudo: required
# 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
node_js: "11"
cache:
directories:
- node_modules
install:
- source ./bin/travis-setup.sh js_env
script:
- yarn test
- yarn build
- env: python2-linters
sudo: false
language: python
python: "2.7.15"
cache:
directories:
- ${HOME}/venv
install:
- source ./bin/travis-setup.sh python_env docs
script:
- pip check
- python lints/queuelint.py
- flake8 --show-source
- isort --check-only --diff --quiet
- git grep -El '^#!/.+\b(bash|sh)\b' | xargs shellcheck
- make html
- env: python2-tests-main
language: python
python: "2.7.15"
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' ./manage.py check --deploy --fail-level WARNING
# Using Python 2's `-3` mode to surface DeprecationWarnings for Python 3 incompatibilities:
# https://docs.python.org/2/using/cmdline.html#cmdoption-3
- python -3 -m pytest tests/ --runslow --ignore=tests/selenium/
- env: python2-tests-selenium
language: python
python: "2.7.15"
cache:
directories:
- ${HOME}/venv
- node_modules
install:
- nvm install 11
- source ./bin/travis-setup.sh services python_env geckodriver 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:
# Using Python 2's `-3` mode to surface DeprecationWarnings for Python 3 incompatibilities:
# https://docs.python.org/2/using/cmdline.html#cmdoption-3
- python -3 -m pytest tests/selenium/ --driver Firefox
- env: python3-smoketest
language: python
python: "3.6.5"
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:
- pip check
- flake8 --show-source
- SITE_URL='https://treeherder.dev' TREEHERDER_DEBUG='False' ./manage.py check --deploy --fail-level WARNING
# Remove these once we get the roughly equivalent pytest sanity tests working under Python 3.
- ./manage.py migrate
- ./manage.py makemigrations --check
notifications:
email:
on_success: never
on_failure: always