From 18530063feb3326369bf3871248b04de0ce4d2af Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 31 Oct 2017 17:23:57 +0100 Subject: Try matrix to speed up travis builds --- scripts/build/client.sh | 4 ++-- scripts/test.sh | 12 +++++------- scripts/travis.sh | 23 +++++++++++++++++++++++ 3 files changed, 30 insertions(+), 9 deletions(-) create mode 100755 scripts/travis.sh (limited to 'scripts') diff --git a/scripts/build/client.sh b/scripts/build/client.sh index 65b67edcf..3a1532daf 100755 --- a/scripts/build/client.sh +++ b/scripts/build/client.sh @@ -1,7 +1,7 @@ -#!/usr/bin/env sh +#!/bin/bash cd client || exit -1 -rm -rf ./compiled +rm -rf ./compiled ./dist npm run webpack -- --config config/webpack.prod.js --progress --profile --bail diff --git a/scripts/test.sh b/scripts/test.sh index dc1baf97d..473445876 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -1,10 +1,8 @@ #!/bin/bash -npm run build:server +npm run build:server || exit -1 -cd client || exit -1 -npm test || exit -1 - -cd .. || exit -1 -npm run tslint -- --type-check --project ./tsconfig.json -c ./tslint.json server.ts "server/**/*.ts" || exit -1 -mocha --exit --require ts-node/register --bail server/tests/index.ts +npm run travis -- client || exit -1 +npm run travis -- api || exit -1 +npm run travis -- cli || exit -1 +npm run travis -- lint || exit -1 diff --git a/scripts/travis.sh b/scripts/travis.sh new file mode 100755 index 000000000..e919f18a4 --- /dev/null +++ b/scripts/travis.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +if [ $# -eq 0 ]; then + echo "Need test suite argument." + exit -1 +fi + +if [ "$1" = "build_then_client" ]; then + npm run build + mocha --exit --require ts-node/register --bail server/tests/client.ts +elif [ "$1" = "client" ]; then + mocha --exit --require ts-node/register --bail server/tests/client.ts +elif [ "$1" = "api" ]; then + mocha --exit --require ts-node/register --bail server/tests/api/index.ts +elif [ "$1" = "cli" ]; then + mocha --exit --require ts-node/register --bail server/tests/cli/index.ts +elif [ "$1" = "lint" ]; then + cd client || exit -1 + npm run lint || exit -1 + + cd .. || exit -1 + npm run tslint -- --type-check --project ./tsconfig.json -c ./tslint.json server.ts "server/**/*.ts" || exit -1 +fi -- cgit v1.2.3