diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-10-31 17:23:57 +0100 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-10-31 17:23:57 +0100 |
commit | 18530063feb3326369bf3871248b04de0ce4d2af (patch) | |
tree | 1b40e2cdb9d322eb34765642c161aca4edcd4a74 | |
parent | 7a8032bb6d1d2fdfce9b23af13c3ed1cdfac91e9 (diff) | |
download | PeerTube-18530063feb3326369bf3871248b04de0ce4d2af.tar.gz PeerTube-18530063feb3326369bf3871248b04de0ce4d2af.tar.zst PeerTube-18530063feb3326369bf3871248b04de0ce4d2af.zip |
Try matrix to speed up travis builds
-rw-r--r-- | .travis.yml | 11 | ||||
-rw-r--r-- | client/config/webpack.prod.js | 2 | ||||
-rw-r--r-- | client/package.json | 2 | ||||
-rw-r--r-- | package.json | 3 | ||||
-rwxr-xr-x | scripts/build/client.sh | 4 | ||||
-rwxr-xr-x | scripts/test.sh | 12 | ||||
-rwxr-xr-x | scripts/travis.sh | 23 |
7 files changed, 44 insertions, 13 deletions
diff --git a/.travis.yml b/.travis.yml index 7b8935a32..1b611b402 100644 --- a/.travis.yml +++ b/.travis.yml | |||
@@ -22,7 +22,6 @@ services: | |||
22 | - postgresql | 22 | - postgresql |
23 | 23 | ||
24 | before_script: | 24 | before_script: |
25 | - npm run build | ||
26 | - wget --no-check-certificate "https://download.cpy.re/ffmpeg/ffmpeg-release-3.0.2-64bit-static.tar.xz" | 25 | - wget --no-check-certificate "https://download.cpy.re/ffmpeg/ffmpeg-release-3.0.2-64bit-static.tar.xz" |
27 | - tar xf ffmpeg-release-3.0.2-64bit-static.tar.xz | 26 | - tar xf ffmpeg-release-3.0.2-64bit-static.tar.xz |
28 | - mkdir -p $HOME/bin | 27 | - mkdir -p $HOME/bin |
@@ -37,6 +36,16 @@ before_script: | |||
37 | - psql -c 'create database peertube_test6;' -U postgres | 36 | - psql -c 'create database peertube_test6;' -U postgres |
38 | - psql -c "create user peertube with password 'peertube';" -U postgres | 37 | - psql -c "create user peertube with password 'peertube';" -U postgres |
39 | 38 | ||
39 | matrix: | ||
40 | include: | ||
41 | - env: TEST_SUITE=build_then_client | ||
42 | - env: TEST_SUITE=api | ||
43 | - env: TEST_SUITE=cli | ||
44 | - env: TEST_SUITE=lint | ||
45 | |||
46 | script: | ||
47 | - npm run travis -- "$TEST_SUITE" | ||
48 | |||
40 | after_failure: | 49 | after_failure: |
41 | - cat test1/logs/all-logs.log | 50 | - cat test1/logs/all-logs.log |
42 | - cat test2/logs/all-logs.log | 51 | - cat test2/logs/all-logs.log |
diff --git a/client/config/webpack.prod.js b/client/config/webpack.prod.js index ecd7914c7..539b9a1ee 100644 --- a/client/config/webpack.prod.js +++ b/client/config/webpack.prod.js | |||
@@ -167,7 +167,7 @@ module.exports = function (env) { | |||
167 | beautify: false | 167 | beautify: false |
168 | } | 168 | } |
169 | }, | 169 | }, |
170 | warnings: true | 170 | warningsFilter: () => false |
171 | }), | 171 | }), |
172 | 172 | ||
173 | /** | 173 | /** |
diff --git a/client/package.json b/client/package.json index 1715416cf..39b3185cc 100644 --- a/client/package.json +++ b/client/package.json | |||
@@ -13,7 +13,7 @@ | |||
13 | "url": "git://github.com/Chocobozzz/PeerTube.git" | 13 | "url": "git://github.com/Chocobozzz/PeerTube.git" |
14 | }, | 14 | }, |
15 | "scripts": { | 15 | "scripts": { |
16 | "test": "standard && tslint --type-check --project ./tsconfig.json -c ./tslint.json 'src/app/**/*.ts'", | 16 | "lint": "standard && tslint --type-check --project ./tsconfig.json -c ./tslint.json 'src/app/**/*.ts'", |
17 | "webpack": "webpack", | 17 | "webpack": "webpack", |
18 | "webpack-dev-server": "webpack-dev-server", | 18 | "webpack-dev-server": "webpack-dev-server", |
19 | "postinstall": "npm rebuild node-sass" | 19 | "postinstall": "npm rebuild node-sass" |
diff --git a/package.json b/package.json index ef044ab16..fd878a342 100644 --- a/package.json +++ b/package.json | |||
@@ -44,7 +44,8 @@ | |||
44 | "tsc": "tsc", | 44 | "tsc": "tsc", |
45 | "nodemon": "nodemon", | 45 | "nodemon": "nodemon", |
46 | "ts-node": "ts-node", | 46 | "ts-node": "ts-node", |
47 | "tslint": "tslint" | 47 | "tslint": "tslint", |
48 | "travis": "scripty" | ||
48 | }, | 49 | }, |
49 | "dependencies": { | 50 | "dependencies": { |
50 | "async": "^2.0.0", | 51 | "async": "^2.0.0", |
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 @@ | |||
1 | #!/usr/bin/env sh | 1 | #!/bin/bash |
2 | 2 | ||
3 | cd client || exit -1 | 3 | cd client || exit -1 |
4 | 4 | ||
5 | rm -rf ./compiled | 5 | rm -rf ./compiled ./dist |
6 | 6 | ||
7 | npm run webpack -- --config config/webpack.prod.js --progress --profile --bail | 7 | 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 @@ | |||
1 | #!/bin/bash | 1 | #!/bin/bash |
2 | 2 | ||
3 | npm run build:server | 3 | npm run build:server || exit -1 |
4 | 4 | ||
5 | cd client || exit -1 | 5 | npm run travis -- client || exit -1 |
6 | npm test || exit -1 | 6 | npm run travis -- api || exit -1 |
7 | 7 | npm run travis -- cli || exit -1 | |
8 | cd .. || exit -1 | 8 | npm run travis -- lint || exit -1 |
9 | npm run tslint -- --type-check --project ./tsconfig.json -c ./tslint.json server.ts "server/**/*.ts" || exit -1 | ||
10 | mocha --exit --require ts-node/register --bail server/tests/index.ts | ||
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 @@ | |||
1 | #!/bin/bash | ||
2 | |||
3 | if [ $# -eq 0 ]; then | ||
4 | echo "Need test suite argument." | ||
5 | exit -1 | ||
6 | fi | ||
7 | |||
8 | if [ "$1" = "build_then_client" ]; then | ||
9 | npm run build | ||
10 | mocha --exit --require ts-node/register --bail server/tests/client.ts | ||
11 | elif [ "$1" = "client" ]; then | ||
12 | mocha --exit --require ts-node/register --bail server/tests/client.ts | ||
13 | elif [ "$1" = "api" ]; then | ||
14 | mocha --exit --require ts-node/register --bail server/tests/api/index.ts | ||
15 | elif [ "$1" = "cli" ]; then | ||
16 | mocha --exit --require ts-node/register --bail server/tests/cli/index.ts | ||
17 | elif [ "$1" = "lint" ]; then | ||
18 | cd client || exit -1 | ||
19 | npm run lint || exit -1 | ||
20 | |||
21 | cd .. || exit -1 | ||
22 | npm run tslint -- --type-check --project ./tsconfig.json -c ./tslint.json server.ts "server/**/*.ts" || exit -1 | ||
23 | fi | ||