From 29b7426c671c91b8567b038df30b9ae909ee838a Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 17 Jun 2021 10:43:34 +0200 Subject: Speedup CI --- scripts/ci.sh | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'scripts/ci.sh') diff --git a/scripts/ci.sh b/scripts/ci.sh index b068deeb4..07e37e0ee 100755 --- a/scripts/ci.sh +++ b/scripts/ci.sh @@ -33,24 +33,33 @@ runTest () { } findTestFiles () { - find $1 -type f -name "*.js" | grep -v "/index.js" | xargs echo + exception="-not -name index.js" + + if [ ! -z ${2+x} ]; then + exception="$exception -not -name $2" + fi + + find $1 -type f -name "*.js" $exception | xargs echo } -if [ "$1" = "misc" ]; then +if [ "$1" = "client" ]; then npm run build feedsFiles=$(findTestFiles ./dist/server/tests/feeds) helperFiles=$(findTestFiles ./dist/server/tests/helpers) - pluginsFiles=$(findTestFiles ./dist/server/tests/plugins) miscFiles="./dist/server/tests/client.js ./dist/server/tests/misc-endpoints.js" + # Not in plugin task, it needs an index.html + pluginFiles="./dist/server/tests/plugins/html-injection.js" - MOCHA_PARALLEL=true runTest "$1" 2 $feedsFiles $helperFiles $pluginsFiles $miscFiles -elif [ "$1" = "cli" ]; then + MOCHA_PARALLEL=true runTest "$1" 2 $feedsFiles $helperFiles $miscFiles $pluginFiles +elif [ "$1" = "cli-plugin" ]; then npm run build:server npm run setup:cli + pluginsFiles=$(findTestFiles ./dist/server/tests/plugins html-injection.js) cliFiles=$(findTestFiles ./dist/server/tests/cli) + MOCHA_PARALLEL=true runTest "$1" 2 $pluginsFiles runTest "$1" 1 $cliFiles elif [ "$1" = "api-1" ]; then npm run build:server -- cgit v1.2.3