aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts/ci.sh
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-06-17 10:43:34 +0200
committerChocobozzz <me@florianbigard.com>2021-06-17 10:43:34 +0200
commit29b7426c671c91b8567b038df30b9ae909ee838a (patch)
treedf0b8473eee01e60326f824b49307dbbe039f8a2 /scripts/ci.sh
parent609a444202b4cf97f962ed596aac4d0d7b7f63fe (diff)
downloadPeerTube-29b7426c671c91b8567b038df30b9ae909ee838a.tar.gz
PeerTube-29b7426c671c91b8567b038df30b9ae909ee838a.tar.zst
PeerTube-29b7426c671c91b8567b038df30b9ae909ee838a.zip
Speedup CI
Diffstat (limited to 'scripts/ci.sh')
-rwxr-xr-xscripts/ci.sh19
1 files changed, 14 insertions, 5 deletions
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 () {
33} 33}
34 34
35findTestFiles () { 35findTestFiles () {
36 find $1 -type f -name "*.js" | grep -v "/index.js" | xargs echo 36 exception="-not -name index.js"
37
38 if [ ! -z ${2+x} ]; then
39 exception="$exception -not -name $2"
40 fi
41
42 find $1 -type f -name "*.js" $exception | xargs echo
37} 43}
38 44
39if [ "$1" = "misc" ]; then 45if [ "$1" = "client" ]; then
40 npm run build 46 npm run build
41 47
42 feedsFiles=$(findTestFiles ./dist/server/tests/feeds) 48 feedsFiles=$(findTestFiles ./dist/server/tests/feeds)
43 helperFiles=$(findTestFiles ./dist/server/tests/helpers) 49 helperFiles=$(findTestFiles ./dist/server/tests/helpers)
44 pluginsFiles=$(findTestFiles ./dist/server/tests/plugins)
45 miscFiles="./dist/server/tests/client.js ./dist/server/tests/misc-endpoints.js" 50 miscFiles="./dist/server/tests/client.js ./dist/server/tests/misc-endpoints.js"
51 # Not in plugin task, it needs an index.html
52 pluginFiles="./dist/server/tests/plugins/html-injection.js"
46 53
47 MOCHA_PARALLEL=true runTest "$1" 2 $feedsFiles $helperFiles $pluginsFiles $miscFiles 54 MOCHA_PARALLEL=true runTest "$1" 2 $feedsFiles $helperFiles $miscFiles $pluginFiles
48elif [ "$1" = "cli" ]; then 55elif [ "$1" = "cli-plugin" ]; then
49 npm run build:server 56 npm run build:server
50 npm run setup:cli 57 npm run setup:cli
51 58
59 pluginsFiles=$(findTestFiles ./dist/server/tests/plugins html-injection.js)
52 cliFiles=$(findTestFiles ./dist/server/tests/cli) 60 cliFiles=$(findTestFiles ./dist/server/tests/cli)
53 61
62 MOCHA_PARALLEL=true runTest "$1" 2 $pluginsFiles
54 runTest "$1" 1 $cliFiles 63 runTest "$1" 1 $cliFiles
55elif [ "$1" = "api-1" ]; then 64elif [ "$1" = "api-1" ]; then
56 npm run build:server 65 npm run build:server