forked from freeCodeCamp/testable-projects-fcc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
49 lines (49 loc) · 1.62 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
language: node_js
node_js:
- '6'
dist: trusty
addons:
chrome: stable
firefox: latest
before_install:
- if [[ `npm -v` != 3* ]]; then npm i -g npm@3; fi
# Codecs needed for Firefox to play audio.
- sudo apt-get install -y ubuntu-restricted-extras
before_script:
# Build budle.js
- npm run build
- cp test/setup.js.travis test/setup.js
# Start https server (and sleep) so we can get the local bundle.js via https.
# The `&` at the end tells this process to fork into the background
# https://github.com/travis-ci/travis-ci/issues/1321
- npm run live-serve-build &
# Increase the shared memory mountpoint. Chrome or something in the tests is
# taking up more shared memory than is available which causes tests to fail.
# See https://github.com/SeleniumHQ/docker-selenium/issues/431
- sudo mount -o remount,size=64G /run/shm
cache:
directories:
- node_modules
sudo: required
script:
- commitlint-travis
- npm test
# When the test script fails, push screen shots to a git branch.
after_failure: |
if [ -n "$GITHUB_API_KEY" ]; then
cd "$TRAVIS_BUILD_DIR/travis-screenshots"
git init
git checkout -b travis-screenshots
git add .
git -c user.name="$GITHUB_USER" -c user.email='travis' commit -m 'Travis CI screenshots'
# Make sure to make the output quiet, or else the API token will leak!
# This works because the API key can replace your password.
git push -f -q https://$GITHUB_USER:[email protected]/$TRAVIS_REPO_SLUG travis-screenshots 2>/dev/null
cd "$TRAVIS_BUILD_DIR"
fi
deploy:
provider: script
skip_cleanup: true
script: bash deploy.sh
on:
branch: master