treeherder/.travis.yml

104 строки
3.8 KiB
YAML

dist: xenial
# Use the latest Travis images since they are more up to date than the stable release.
group: edge
matrix:
include:
- language: node_js
# The Node version here must be kept in sync with that in `package.json`.
node_js: '12.13.0'
cache: yarn
before_install:
# Try to keep version in sync with `package.json`
- curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.19.1
- export PATH="$HOME/.yarn/bin:$PATH"
install:
- yarn install --frozen-lockfile
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:coverage
- yarn codecov
# This build is configured to catch issues on PRs that would only be detected as part of Heroku's
# build step when the code has already been merged to master
# The step ./bin/post_compile requires the output of `yarn build`, thus, we need to build
# both the JS and Python builds
- env:
- NODE_ENV=production YARN_PRODUCTION=true
# Since we're using Python/pip and Node/yarn use the generic image
language: generic
cache:
directories:
- $HOME/.cache/yarn
- $HOME/.cache/pip
- node_modules
before_install:
# XXX: I have not been able to install 3.7.2 to match runtime.txt
- pyenv global 3.7.1
- nvm install 12.14.1
- nvm use 12.14.1
# Steps to validate versions in use
- python --version
- pip --version
- node --version
- yarn --version
install:
- pip install -r requirements.txt
- yarn install
script:
- yarn heroku-postbuild
- ./manage.py collectstatic --noinput
# This generates the revision and does the Brotly/Gzip compression
- ./bin/post_compile
- language: minimal
services:
- docker
install:
- docker-compose build
- pip install codecov --user
script:
- docker-compose run backend ./runtests.sh
- codecov -f coverage.xml
- language: minimal
services:
- docker
install:
- docker-compose build
- pip install codecov --user
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.
- docker-compose run -e SITE_URL=https://treeherder.dev -e TREEHERDER_DEBUG=False backend 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
- docker-compose run backend bash -c "pytest --cov --cov-report=xml tests/ --runslow --ignore=tests/selenium"
- codecov -f coverage.xml
- language: node_js
services:
- docker
# The Node version here must be kept in sync with that in `package.json`.
node_js: '12.13.0'
cache: yarn
before_install:
- docker-compose build
install:
- yarn install
- pip install codecov --user
before_script:
# Run in `before_script` to prevent the Selenium tests from running if the UI build fails.
- yarn build
script:
# Using `-bb` mode to surface BytesWarnings: https://docs.python.org/3.7/using/cmdline.html#cmdoption-b
- docker-compose run backend bash -c "pytest --cov --cov-report=xml tests/selenium/"
- codecov -f coverage.xml
notifications:
email:
on_success: never
on_failure: always