From 5bf2835ed6aa4c707522be3b658fb95bb160f83a Mon Sep 17 00:00:00 2001 From: Andrew Nicolaou Date: Fri, 24 May 2019 18:16:15 +0200 Subject: [PATCH] Experiment with "Checks" in Travis output (#1081) * Run tests on CI * Create a lint error on purpose * Splits build into test and deploy stages lint and test jobs will run in parallel and if both are successful (and branch is master), deploy will run. * Revert "Create a lint error on purpose" This reverts commit 306c91c4278631fa1c1dcd40f0b23f7f9e5f000d. * Updating snapshot * Run deploy only on master branch (not PRs) * Use global deploy config item to avoid building on PRs --- .travis.yml | 11 ++++++++--- package.json | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index ee7085c6..3de6635a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,8 +16,14 @@ before_install: install: true -script: - - docker-compose exec -T app npm run test:ci --verbose +jobs: + include: + - stage: test + name: "Linting" + script: docker-compose exec -T app npm run lint + - # stage name not required, will continue to use `test` + name: "Tests" + script: docker-compose exec -T app npm run test before_deploy: - docker-compose stop @@ -26,7 +32,6 @@ before_deploy: - gcloud --quiet version - gcloud --quiet components update - gcloud --quiet components update kubectl - deploy: - provider: script script: ./deploy.sh diff --git a/package.json b/package.json index 189c3c3f..70d60ca2 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "build:server": "cross-env NODE_ENV=production webpack --config webpack/config.server.js", "build:examples": "cross-env NODE_ENV=production webpack --config webpack/config.examples.js", "test": "jest", - "test:ci": "npm run lint", + "test:ci": "npm run lint && npm run test", "fetch-examples": "cross-env NODE_ENV=development node ./server/scripts/fetch-examples.js", "fetch-examples-gg": "cross-env NODE_ENV=development node ./server/scripts/fetch-examples-gg.js", "fetch-examples-ml5": "cross-env NODE_ENV=development node ./server/scripts/fetch-examples-ml5.js",