Skip to content

Commit

Permalink
update stages and build matrices (#3308)
Browse files Browse the repository at this point in the history
* optimize build stages and jobs
* attempt to avoid $TARGET
* run smoke tests across multiple node versions
* define addons per-job
* disable caching for smoke tests; avoid alias
* disable caching for older node versions entirely
* combine bundle / browser tests; do not run extra node 9 job

Signed-off-by: Christopher Hiller <[email protected]>
  • Loading branch information
boneskull authored Apr 4, 2018
1 parent f2560e7 commit ff9f3cf
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 64 deletions.
90 changes: 47 additions & 43 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,44 +1,60 @@
# trusty dist provides a modern build chain (as opposed to 'precise' dist)
# which absolves us from having to install compilers and stuff
dist: trusty
# these are executed in order. each must pass for the next to be run
stages:
- smoke # this ensures a "user" install works properly
- lint # lint code and docs
- test # all tests

# defaults
language: node_js
node_js: '9'
cache:
directories:
- ~/.npm
- node_modules

matrix:
fast_finish: true
jobs:
include:
- script: COVERAGE=1 npm start test.node
after_success: npm start coveralls

before_install: scripts/travis-before-install.sh
- &node
script: npm start test.node
node_js: '8'
cache: false

before_script: scripts/travis-before-script.sh
- <<: *node
node_js: '6'

- <<: *node
node_js: '4'

- script: npm start test.bundle test.browser
before_script: mkdir -p .karma
addons:
artifacts:
paths:
- .karma/
- ./mocha.js
chrome: stable
sauce_connect: true

jobs:
include:
- stage: lint
script: npm start lint

- &smoke
stage: smoke
env: NPM_CONFIG_PRODUCTION=1
script: ./bin/mocha --opts /dev/null --reporter spec test/sanity/sanity.spec.js
cache: false

- <<: *smoke
node_js: '8'
env: TARGET=lint
script: npm start $TARGET
- stage: test
node_js: '9'
env: TARGET=test.node COVERAGE=true
script: npm start $TARGET
- node_js: '8'
env: TARGET=test.node
script: npm start $TARGET
- node_js: '6'
env: TARGET=test.node
script: npm start $TARGET
- node_js: '4'
env: TARGET=test.node
script: npm start $TARGET
- node_js: '8'
env: TARGET=test.browser
script: npm start $TARGET

stages:
- lint
- test
- <<: *smoke
node_js: '6'

after_success: npm start coveralls
- <<: *smoke
node_js: '4'

notifications:
email: false
Expand All @@ -49,15 +65,3 @@ notifications:
- secure: rGMGYWBaZgEa9i997jJHKzjI8WxECqLi6BqsMhvstDq9EeTeXkZFVfz4r6G3Xugsk3tFwb/pDpiYo1OK36kA5arUJTCia51u4Wn+c7lHKcpef/vXztoyucvw6/jXdVm/FQz1jztYYbqdyAOWC2BV8gYvg5F8TpK05UGCe5R0bRA=
on_success: change
on_failure: always

addons:
artifacts:
paths:
- .karma/
- ./mocha.js
sauce_connect: true
chrome: stable
cache:
directories:
- ~/.npm
- node_modules
16 changes: 8 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 0 additions & 9 deletions scripts/travis-before-install.sh

This file was deleted.

4 changes: 0 additions & 4 deletions scripts/travis-before-script.sh

This file was deleted.

1 comment on commit ff9f3cf

@plroebuck
Copy link
Contributor

@plroebuck plroebuck commented on ff9f3cf Apr 21, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Travis setup here references "Node-4", yet the "package.json" engines references ">=4.0.0.". Don't believe you've been testing against your requirement as Travis is using the most recent 4.x version, not the original. However, at this point (since Node4 will be unsupported within the month), if you changed the engine spec to reference the final Argon LTS, it'd be far more accurate.

Please sign in to comment.