Speedup CI
This commit is contained in:
parent
609a444202
commit
29b7426c67
5 changed files with 19 additions and 10 deletions
2
.github/workflows/test.yml
vendored
2
.github/workflows/test.yml
vendored
|
@ -39,7 +39,7 @@ jobs:
|
|||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
test_suite: [ misc, api-1, api-2, api-3, api-4, cli, lint, external-plugins ]
|
||||
test_suite: [ client, api-1, api-2, api-3, api-4, cli-plugin, lint, external-plugins ]
|
||||
|
||||
env:
|
||||
PGUSER: peertube
|
||||
|
|
|
@ -40,7 +40,7 @@ languages=(
|
|||
|
||||
cd client
|
||||
|
||||
rm -rf ./dist ./compiled
|
||||
rm -rf ./dist
|
||||
|
||||
# Don't build other languages if --light arg is provided
|
||||
if [ -z ${1+x} ] || ([ "$1" != "--light" ] && [ "$1" != "--analyze-bundle" ]); then
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -7,8 +7,8 @@ npm run setup:cli
|
|||
|
||||
npm run ci -- lint
|
||||
|
||||
npm run ci -- misc
|
||||
npm run ci -- cli
|
||||
npm run ci -- client
|
||||
npm run ci -- cli-plugin
|
||||
npm run ci -- api-1
|
||||
npm run ci -- api-2
|
||||
npm run ci -- api-3
|
||||
|
|
|
@ -15,7 +15,7 @@ import {
|
|||
|
||||
const expect = chai.expect
|
||||
|
||||
describe('Test plugins HTML inection', function () {
|
||||
describe('Test plugins HTML injection', function () {
|
||||
let server: ServerInfo = null
|
||||
|
||||
before(async function () {
|
||||
|
|
Loading…
Reference in a new issue