addons-frontend/.travis.yml

92 строки
2.5 KiB
YAML

sudo: required
_aliases:
- &tox
language: python
python: 3.6
before_install: nvm install 10
install: pip install tox
script: tox
- &node-prod
# This is the NodeJS version we run in production.
language: node_js
node_js: '10'
before_install: npm install -g yarn
- &node-next
# This is the next NodeJS version we will support.
language: node_js
node_js: '12'
before_install: npm install -g yarn
services:
- docker
cache:
yarn: true
directories:
- node_modules
# Allow to display job names on Travis-CI, see:
# https://github.com/travis-ci/travis-ci/issues/5898#issuecomment-362490313
script: FORCE_COLOR=0 yarn $COMMAND
# See: https://github.com/mozilla/addons-frontend/issues/3034
install: yarn install --pure-lockfile
jobs:
include:
# Test the build process.
- stage:
<<: *node-prod
env: COMMAND=build-ci
- stage:
<<: *node-next
env: COMMAND=build-all
# Run the unit/integration tests.
- stage:
<<: *node-prod
env: COMMAND=test-ci
- stage:
<<: *node-next
env: COMMAND=test-ci
- stage:
<<: *node-prod
env: COMMAND=lint
- stage:
<<: *node-prod
env: COMMAND=snyk-ci
if: fork = false
- stage:
<<: *node-prod
env: COMMAND=prettier-ci
- stage:
<<: *node-prod
env: COMMAND=storybook-smoke-test
# Run the functional tests.
- stage:
<<: *tox
addons:
firefox: latest-nightly
hosts: example.com
env: TOXENV=discopane-ui-tests GECKODRIVER=0.24.0 MOZ_HEADLESS=1 PATH=./node_modules/.bin:$PATH
install:
- yarn
- yarn start-func-test-server &
before_script:
- wget -O /tmp/geckodriver.tar.gz https://github.com/mozilla/geckodriver/releases/download/v$GECKODRIVER/geckodriver-v$GECKODRIVER-linux64.tar.gz
- mkdir $HOME/geckodriver && tar xvf /tmp/geckodriver.tar.gz -C $HOME/geckodriver
- export PATH=$HOME/geckodriver:$PATH
- firefox --version
- geckodriver --version
- pip install tox
# Wait for server to be available
- until $(curl --output /dev/null --silent --head --fail -k https://example.com:4000); do printf '.'; sleep 5; done
- stage:
<<: *tox
env: TOXENV=flake8
- stage:
<<: *tox
env: TOXENV=dennis-lint
- stage: Storybook deployment
<<: *node-prod
if: branch = master AND type = push AND fork = false
script: echo "Deploying to GitHub Pages..."
after_success: yarn storybook-deploy --ci > /dev/null 2>&1