Skip to content

Commit

Permalink
chore(ci): reuse stage configs (#3197)
Browse files Browse the repository at this point in the history
* chore(ci): reuse stages configuration

* chore(ci): add formatting to yaml file

* chore(ci): update utils related to release notes

* chore(ci): chrome headless is not stable

* chore(ci): firefox, please please

* chore(ci): firefox, please please

* chore(ci): use firefox for tests
  • Loading branch information
valorkin authored Dec 5, 2017
1 parent 422d3bc commit 671d573
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 17 deletions.
31 changes: 20 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,28 @@ git:

env:
global:
- MOZ_HEADLESS=1
- SAUCE_USERNAME_PR=valorkinpr
- SAUCE_ACCESS_KEY_PR=e0a97bd3-4b74-4408-89bf-cce1b44a8bf1
- BROWSER_PROVIDER_READY_FILE=/tmp/sauce-connect-ready
- LOGS_DIR=/tmp/logs

stages:
- name: precache
if: ( branch = development AND type = push ) OR type = pull_request
- name: lint
if: ( branch = development AND type = push ) OR type = pull_request
- name: test
if: ( branch = development AND type = push ) OR type = pull_request
- name: build
if: ( branch = development AND type = push ) OR type = pull_request
- &stage
name: precache
if: ( branch = development AND type = push ) OR type = pull_request OR tag =~ ^v2
- <<: *stage
name: lint
- <<: *stage
name: test
- <<: *stage
name: build
- name: deploy
if: branch = development AND type = push
if: branch = development AND type = push OR tag =~ ^v2
- name: publish
if: tag =~ ^v2
- name: sauce-tests
if: ( branch = development AND type = push ) OR type = pull_request
- <<: *stage
name: sauce-tests

before_install:
- export CHROME_BIN=chromium-browser
Expand Down Expand Up @@ -58,17 +60,20 @@ jobs:
install: npm install > /dev/null
script: true
addons:
firefox: latest
chrome: stable
apt:
sources:
- ubuntu-toolchain-r-test
# required by node-gyp to build some packages
packages:
- g++-4.8

# lint code
- stage: lint
install: true
script: npm run lint

# test
- &test
stage: test
Expand All @@ -79,6 +84,7 @@ jobs:
env: NGV=latest
- <<: *test
env: NGV=next

# check prod build
- &build
stage: build
Expand All @@ -96,6 +102,7 @@ jobs:
- ./scripts/sauce/sauce_connect_block.sh
- npm run test-cross
after_script: ./scripts/sauce/sauce_connect_teardown.sh

# deploy to ngx-bootstrap.surge.sh
- &surge
stage: deploy
Expand All @@ -120,6 +127,8 @@ jobs:
skip_cleanup: true
app: ngx-universal
on: development

# publish to gh pages and npm
- stage: publish
script: npm run demo.build
after_deploy: npm run flow.github-release
Expand Down
3 changes: 2 additions & 1 deletion karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ module.exports = function (config) {
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-firefox-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage-istanbul-reporter'),
require('@angular/cli/plugins/karma'),
Expand Down Expand Up @@ -53,7 +54,7 @@ module.exports = function (config) {
};

if (process.env.TRAVIS) {
configuration.browsers = ['Chrome_travis_ci'];
configuration.browsers = ['Firefox'];
}

if (process.env.SAUCE) {
Expand Down
11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,15 @@
"@types/webpack": "3.0.10",
"bootstrap": "3.3.7",
"classlist-polyfill": "1.2.0",
"codecov": "2.3.1",
"codecov": "3.0.0",
"codelyzer": "3.2.0",
"compression": "1.7.1",
"conventional-changelog-cli": "1.3.4",
"conventional-github-releaser": "1.1.12",
"conventional-changelog-cli": "1.3.5",
"conventional-github-releaser": "1.1.13",
"core-js": "2.5.1",
"cpy": "5.1.0",
"cpy-cli": "1.0.1",
"gh-pages": "1.0.0",
"gh-pages": "1.1.0",
"gitignore-to-glob": "0.3.0",
"google-code-prettify": "1.0.5",
"html-loader": "0.5.1",
Expand All @@ -118,6 +118,7 @@
"karma-chrome-launcher": "^2.0.0",
"karma-cli": "^1.0.1",
"karma-coverage-istanbul-reporter": "^1.2.1",
"karma-firefox-launcher": "1.0.1",
"karma-jasmine": "^1.0.2",
"karma-jasmine-html-reporter": "^0.2.2",
"karma-remap-istanbul": "0.6.0",
Expand All @@ -129,7 +130,7 @@
"ng2-page-scroll": "4.0.0-beta.7",
"ngm-cli": "0.8.3",
"npm-run-all": "4.1.1",
"prettier": "1.7.3",
"prettier": "1.9.0",
"protractor": "5.1.2",
"reflect-metadata": "0.1.10",
"require-dir": "0.3.2",
Expand Down

0 comments on commit 671d573

Please sign in to comment.