Skip to content

Commit

Permalink
chore(CI): parallelize CI tests plus add release and aot check (Terad…
Browse files Browse the repository at this point in the history
…ata#1067)

* chore(ci): parallelize CI tests

* chore(): combine everything into a file

* make script.sh executable

* chore(): fix if/else statement

* chore(): fix unit test execution

* fix(): travis and try again

* fix(): one last fix

* chore(): remove extra space
  • Loading branch information
emoralesb05 authored Jan 4, 2018
1 parent 15ed22b commit 287f9d5
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 10 deletions.
24 changes: 14 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
language: node_js
sudo: required
dist: trusty
language: node_js

node_js:
- '6.11.1'
- '6.12.0'
branches:
only:
- master
Expand All @@ -13,18 +14,21 @@ before_script:
- export CHROME_BIN=chromium-browser
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
jobs:
include:
- env: "MODE=lint"
- env: "MODE=aot"
- env: "MODE=release"
- env: "MODE=unit-test"
install:
- npm i process-nextick-args util-deprecate buffer-shims
- npm install
- npm rebuild node-sass # Workaround for https://github.com/yarnpkg/yarn/issues/1981
script:
- npm run tslint
- npm run stylelint
- npm run test
after_script:
- npm run coveralls
- ./scripts/ci/travis-script.sh
cache:
directories:
- ./node_modules/
after_success:
- test $TRAVIS_PULL_REQUEST == "false" && test $TRAVIS_BRANCH == "develop" && npm run publish:nightly
- test $MODE == "release" && test $TRAVIS_PULL_REQUEST == "false" && test $TRAVIS_BRANCH == "develop" && npm run publish:nightly
notifications:
slack:
secure: pkXQL5AZiSBh1yWjilrcA7KbcJjC4xxjhd0SAwogJCQgyEf/i8/CfR1ZXiZYsIBJT6HTI7UMdJzwP6TiY/zih6Mq8PqUg38NUsvGyznILkbksMQJieWrg1r+1ideplPJFX7qdXwrOcxvSVoEFIGha26X0Fglq3kXSBHpPR9U0lDCoUxLUO35txQ/iji85Na4hjQnmtBEQkqaJogA0hRdcSLIKxwScgSrb4UU2PXEaIS9Zpr2SOG/RTOMkrrSMOD7bgocZbhAbk3c5shPZNj51gpEN+692Qxp4kQ/nfT10Hu5ATLaFCM5v04+w0D3ZJLA46LpU47qP0ALy6O9d16pGUcxJGbWaMZpV53vV9jIl9y2ahaqN1h1J9BcLIOzJvaQy92km8F7a3l7cN8gWSUZjs5Hd+gPFQH9Flcydmq26e8Maa1tQDF5R3GIdaCw4qkuJYbl4ToE59wtiPQ6M7xVKqNK4Qypu1YNsKOoLG/tZRFvp4771vgWcR5Lu/DqJJ9SAB0jsdrOXpe+0DmdrLBwhoZv2D9FTce+clDHIJ7ObPEc/UKw8rtWAA5iCPCEJ0sPl+WZwOS3ZFp4QmMC+5mzffMUiX6HBnzxiyOZvYGJD/jTy1yA1Cmt4RJYrOPM73csI1ELs5tj4tvqBNJQ8daIenfkg7u42IJfByDGIsJz8to=
47 changes: 47 additions & 0 deletions scripts/ci/travis-script.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#!/bin/bash

# Script that runs in every Travis CI container.
# Responsible for testing the project in different Travis jobs of the current build stage.

# The script should immediately exit if any command in the script fails.
set -e

# Go to project directory
cd $(dirname $0)/../..

if [[ -z "$TRAVIS" ]]; then
echo "This script can only run inside of Travis build jobs."
exit 1
fi

echo ""
echo "Building sources and running tests. Running mode: ${MODE}"
echo ""

# Get commit diff
if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then
fileDiff=$(git diff --name-only $TRAVIS_COMMIT_RANGE)
else
fileDiff=$(git diff --name-only $TRAVIS_BRANCH...HEAD)
fi

# Check if tests can be skipped
if [[ ${fileDiff} =~ ^(.*\.md\s*)*$ ]]; then
echo "Skipping tests since only markdown files changed."
exit 0
fi

if [ "${MODE}" = "lint" ]; then
npm run lint
elif [ "${MODE}" = "aot" ]; then
npm run build:docs
elif [ "${MODE}" = "release" ]; then
npm run build:release
elif [ "${MODE}" = "unit-test" ]; then
npm run test
fi

# Upload coverage results if those are present.
if [ -f coverage/lcov.info ]; then
npm run coveralls
fi
1 change: 1 addition & 0 deletions scripts/rollup.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ gulp.task('rollup-code', '', function() {

'rxjs/operator/toPromise': 'Rx.Observable.prototype',

'rxjs/observable/defer': 'Rx.Observable',
'rxjs/operators/pairwise': 'Rx.Observable',
'rxjs/operators/map': 'Rx.Observable',
'rxjs/operators/filter': 'Rx.Observable',
Expand Down

0 comments on commit 287f9d5

Please sign in to comment.