forked from mozilla/addons-frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
98 lines (95 loc) · 3.09 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
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=prettier-ci
- stage:
<<: *node-prod
env: COMMAND=storybook-smoke-test
# Run the functional tests.
- stage:
<<: *tox
addons:
firefox: latest-nightly
hosts: example.com
apt:
update: true
env: TOXENV=discopane-ui-tests GECKODRIVER=0.24.0 MOZ_HEADLESS=1 PATH=./node_modules/.bin:$PATH
install:
# This is required by `mkcert` to interact with Firefox
- sudo apt-get -y install libnss3-tools
# Get `mkcert`
# This is unfortunately needed because of https://github.com/FiloSottile/mkcert/issues/192
- wget https://github.com/rfay/mkcert/releases/download/v1.4.1-alpha1/mkcert-v1.4.1-alpha1-linux-amd64 -O mkcert
- chmod +x mkcert
- ./mkcert -install
# Generate certificate for example.com
- ./mkcert -cert-file ./bin/local-dev-server-certs/example.com.pem -key-file ./bin/local-dev-server-certs/example.com-key.pem example.com
- 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