]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Try matrix to speed up travis builds
authorChocobozzz <florian.bigard@gmail.com>
Tue, 31 Oct 2017 16:23:57 +0000 (17:23 +0100)
committerChocobozzz <florian.bigard@gmail.com>
Tue, 31 Oct 2017 16:23:57 +0000 (17:23 +0100)
.travis.yml
client/config/webpack.prod.js
client/package.json
package.json
scripts/build/client.sh
scripts/test.sh
scripts/travis.sh [new file with mode: 0755]

index 7b8935a323030c28c64b3f62f4aca07f586bef31..1b611b402c112e642303ba95aaea6bbbadb3a0eb 100644 (file)
@@ -22,7 +22,6 @@ services:
   - postgresql
 
 before_script:
-  - npm run build
   - wget --no-check-certificate "https://download.cpy.re/ffmpeg/ffmpeg-release-3.0.2-64bit-static.tar.xz"
   - tar xf ffmpeg-release-3.0.2-64bit-static.tar.xz
   - mkdir -p $HOME/bin
@@ -37,6 +36,16 @@ before_script:
   - psql -c 'create database peertube_test6;' -U postgres
   - psql -c "create user peertube with password 'peertube';" -U postgres
 
+matrix:
+  include:
+  - env: TEST_SUITE=build_then_client
+  - env: TEST_SUITE=api
+  - env: TEST_SUITE=cli
+  - env: TEST_SUITE=lint
+
+script:
+  - npm run travis -- "$TEST_SUITE"
+
 after_failure:
   - cat test1/logs/all-logs.log
   - cat test2/logs/all-logs.log
index ecd7914c793b2d3cbfb61f4c11c285a1e856a398..539b9a1ee06b92751355ce7991fb8c8d3a0244ef 100644 (file)
@@ -167,7 +167,7 @@ module.exports = function (env) {
               beautify: false
             }
           },
-          warnings: true
+          warningsFilter: () => false
         }),
 
         /**
index 1715416cf21d2ca1e3df8e83346e8646b44f66fc..39b3185cc33af438253b3e310cb47b2e69b21013 100644 (file)
@@ -13,7 +13,7 @@
     "url": "git://github.com/Chocobozzz/PeerTube.git"
   },
   "scripts": {
-    "test": "standard && tslint --type-check --project ./tsconfig.json -c ./tslint.json 'src/app/**/*.ts'",
+    "lint": "standard && tslint --type-check --project ./tsconfig.json -c ./tslint.json 'src/app/**/*.ts'",
     "webpack": "webpack",
     "webpack-dev-server": "webpack-dev-server",
     "postinstall": "npm rebuild node-sass"
index ef044ab16f1ce7b18db0d8c11421637d61316c4b..fd878a342efd2a4d28ecf881cafdb30df7d9886f 100644 (file)
@@ -44,7 +44,8 @@
     "tsc": "tsc",
     "nodemon": "nodemon",
     "ts-node": "ts-node",
-    "tslint": "tslint"
+    "tslint": "tslint",
+    "travis": "scripty"
   },
   "dependencies": {
     "async": "^2.0.0",
index 65b67edcfe8d4110ccbf9ec2d2fc49fd1cfb0947..3a1532dafc6ed28a39985bae889aeff05df8e209 100755 (executable)
@@ -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
index dc1baf97dfc19bb1b13b0439a26dd705ff636028..473445876ab12a232a11ad25dc68aab228b7e73b 100755 (executable)
@@ -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 (executable)
index 0000000..e919f18
--- /dev/null
@@ -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