From 1753294fe9bb485efc806627b425a67915c44f05 Mon Sep 17 00:00:00 2001 From: Robert Jackson Date: Tue, 5 Dec 2017 10:45:13 -0500 Subject: [PATCH] Use build stages to fail early... --- .travis.yml | 79 ++++++++++++++++++++++++++++++---------------------- package.json | 4 ++- 2 files changed, 49 insertions(+), 34 deletions(-) diff --git a/.travis.yml b/.travis.yml index 700c51fba..521683d9a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,46 +12,59 @@ addons: cache: yarn: true -env: - # we recommend new addons test the current and previous LTS - # as well as latest stable release (bonus points to beta/canary) - - EMBER_TRY_SCENARIO=ember-2.0 - - EMBER_TRY_SCENARIO=ember-lts-2.4 - - EMBER_TRY_SCENARIO=ember-lts-2.8 - - EMBER_TRY_SCENARIO=ember-lts-2.12 - - EMBER_TRY_SCENARIO=ember-lts-2.16 - - EMBER_TRY_SCENARIO=ember-release - - EMBER_TRY_SCENARIO=ember-release-with-jquery - - EMBER_TRY_SCENARIO=ember-beta - - EMBER_TRY_SCENARIO=ember-canary - - EMBER_TRY_SCENARIO=ember-default - -matrix: - fast_finish: true +stages: + - test + - older version tests + - deploy + +jobs: + fail_fast: true allow_failures: - env: EMBER_TRY_SCENARIO=ember-canary + include: + # runs tests with current locked deps and linting + - stage: test + env: NAME=lint # used only to make Travis UI show description + script: yarn lint + - env: NAME=test # used only to make Travis UI show description + script: yarn test + - env: NAME=floating dependencies # used only to make Travis UI show description + install: yarn install --no-lockfile + script: yarn test + + # runs tests against each supported Ember version + - stage: older version tests + env: EMBER_TRY_SCENARIO=ember-2.0 + - env: EMBER_TRY_SCENARIO=ember-lts-2.4 + - env: EMBER_TRY_SCENARIO=ember-lts-2.8 + - 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-release-with-jquery + - env: EMBER_TRY_SCENARIO=ember-beta + - env: EMBER_TRY_SCENARIO=ember-canary + + # runs deploy if running on a specific tag + - stage: deploy + if: tag IS present + install: yarn global add auto-dist-tag + script: auto-dist-tag --write + deploy: + provider: npm + email: stefan.penner+ember-cli@gmail.com + api_key: + secure: rKej7q7tP+K3XUsKftqVhw8/Tgx6pn30OzV0g39RGVTRjWKvLu36UlF3LtP0AfofIKqsnPcvy+VaV9uCOOFiG6xBlXtVjxtqbplBmvKU1SjBHrwtlK61SdlXNKwIagWxBSbCUNxj+ka0d8gpIxS+sNw4sKGWHufH0CoAjpkerog= + on: + tags: true + repo: emberjs/ember-test-helpers + before_install: - curl -o- -L https://yarnpkg.com/install.sh | bash - export PATH=$HOME/.yarn/bin:$PATH install: - - yarn install --no-lockfile + - yarn install script: - # Usually, it's ok to finish the test scenario without reverting - # to the addon's original dependency state, skipping "cleanup". - - node_modules/.bin/ember try:one $EMBER_TRY_SCENARIO --skip-cleanup - -before_deploy: - - yarn global add auto-dist-tag - - auto-dist-tag --write - -deploy: - provider: npm - email: stefan.penner+ember-cli@gmail.com - api_key: - secure: rKej7q7tP+K3XUsKftqVhw8/Tgx6pn30OzV0g39RGVTRjWKvLu36UlF3LtP0AfofIKqsnPcvy+VaV9uCOOFiG6xBlXtVjxtqbplBmvKU1SjBHrwtlK61SdlXNKwIagWxBSbCUNxj+ka0d8gpIxS+sNw4sKGWHufH0CoAjpkerog= - on: - tags: true - repo: emberjs/ember-test-helpers + - yarn ember try:one $EMBER_TRY_SCENARIO --skip-cleanup diff --git a/package.json b/package.json index 4c84ba5de..7b6dce939 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,9 @@ "scripts": { "build": "ember build", "start": "ember server", - "test": "ember try:each" + "test": "ember test", + "test:all": "ember try:each", + "lint": "eslint addon-test-support config tests" }, "dependencies": { "broccoli-funnel": "^2.0.1",