Skip to content

Commit

Permalink
Refactor .travis.yml to use build stages.
Browse files Browse the repository at this point in the history
  • Loading branch information
rwjblue committed Jan 28, 2018
1 parent c7ea993 commit 4dc13cd
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 14 deletions.
64 changes: 53 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,66 @@ addons:
cache:
yarn: true

stages:
- test
- additional tests
- older version tests
- deploy

jobs:
fail_fast: true

include:
# runs tests with current locked deps and linting
- stage: test
env: NAME=test # used only to make Travis UI show description
script:
- ./bin/lint-features
- yarn test
- env: NAME=floating dependencies # used only to make Travis UI show description
install: yarn install --no-lockfile --non-interactive
script: yarn test

- stage: additional tests
env: NAME=optional-features # used only to make Travis UI show description
install: yarn install
script: yarn test:optional-features

- env: NAME=production # used only to make Travis UI show description
install: yarn install
script: yarn test:production

- env: NAME=node-tests # used only to make Travis UI show description
install: yarn install
script: yarn test:node

# runs tests against each supported Ember version
- stage: older version tests
env: EMBER_TRY_SCENARIO=ember-lts-2.12
- env: EMBER_TRY_SCENARIO=ember-lts-2.16
- env: EMBER_TRY_SCENARIO=ember-release
- env: EMBER_TRY_SCENARIO=ember-beta
- env: EMBER_TRY_SCENARIO=ember-canary

- stage: deploy
if: branch IN (master, beta, release) OR tag IS present
env: NAME=publish # used only to make Travis UI show description
install: yarn install
script:
- yarn build:production
- "./bin/publish-builds"


before_install:
- curl -o- -L https://yarnpkg.com/install.sh | bash
- export PATH=$HOME/.yarn/bin:$PATH
- yarn global add phantomjs-prebuilt
- phantomjs --version

install:
- yarn install --no-lockfile --no-interactive
- yarn install

script:
- ./bin/lint-features
- yarn run test
- yarn run test:optional-features
- yarn run test:production
- yarn run node-tests
after_success:
- yarn run production
- "./bin/publish-builds"
- node_modules/.bin/ember try:one $EMBER_TRY_SCENARIO --skip-cleanup

env:
global:
- BROCCOLI_ENV="production"
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
},
"scripts": {
"build": "ember build",
"build:production": "ember build --environment=production",
"start": "ember server",
"test": "ember test",
"test:all": "ember try:each",
"test:node": "node node-tests/nodetest-runner.js",
"test:production": "ember test --environment=production",
"node-tests": "node node-tests/nodetest-runner.js",
"test:optional-features": "ember test --environment=test-optional-features",
"production": "ember build --environment=production"
"test:optional-features": "ember test --environment=test-optional-features"
},
"author": "",
"license": "MIT",
Expand Down

0 comments on commit 4dc13cd

Please sign in to comment.