Run e2e only when lib affected (#7791)

This commit is contained in:
Maurizio Vitale 2022-08-26 15:24:19 +01:00 committed by GitHub
parent c7d769510d
commit 38e9cc9f41
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 42 additions and 22 deletions

View File

@ -183,7 +183,7 @@ jobs:
- stage: "e2e Test" - stage: "e2e Test"
name: "Process Cloud: Storybook Playwright" name: "Process Cloud: Storybook Playwright"
before_script: ./scripts/ci/jobs/dbpci-before-playwright before_script: ./scripts/ci/jobs/dbpci-before-playwright
script: ./scripts/travis/storybook-testing/storybook-test.sh script: ./scripts/travis/affected-contains.sh "process-services-cloud" && ./scripts/travis/storybook-testing/storybook-test.sh
workspaces: workspaces:
use: use:
- built_libs_cache - built_libs_cache
@ -195,7 +195,7 @@ jobs:
- ./scripts/ci/job_hooks/before_e2e.sh - ./scripts/ci/job_hooks/before_e2e.sh
- ./scripts/ci/check-env/check-cs-env.sh || travis_terminate 1 - ./scripts/ci/check-env/check-cs-env.sh || travis_terminate 1
- ./scripts/ci/check-env/check-ps-env.sh || travis_terminate 1 - ./scripts/ci/check-env/check-ps-env.sh || travis_terminate 1
script: ./scripts/travis/e2e/e2e.sh script: ./scripts/travis/affected-contains.sh "core" && ./scripts/travis/e2e/e2e.sh
after_script: ./scripts/ci/job_hooks/after_e2e.sh after_script: ./scripts/ci/job_hooks/after_e2e.sh
workspaces: workspaces:
create: create:
@ -216,7 +216,7 @@ jobs:
before_script: before_script:
- ./scripts/ci/job_hooks/before_e2e.sh - ./scripts/ci/job_hooks/before_e2e.sh
- ./scripts/ci/check-env/check-cs-env.sh || travis_terminate 1 - ./scripts/ci/check-env/check-cs-env.sh || travis_terminate 1
script: ./scripts/travis/e2e/e2e.sh script: ./scripts/travis/affected-contains.sh "content-services" && ./scripts/travis/e2e/e2e.sh
after_script: ./scripts/ci/job_hooks/after_e2e.sh after_script: ./scripts/ci/job_hooks/after_e2e.sh
workspaces: workspaces:
create: create:
@ -237,7 +237,7 @@ jobs:
before_script: before_script:
- ./scripts/ci/job_hooks/before_e2e.sh - ./scripts/ci/job_hooks/before_e2e.sh
- ./scripts/ci/check-env/check-cs-env.sh || travis_terminate 1 - ./scripts/ci/check-env/check-cs-env.sh || travis_terminate 1
script: ./scripts/travis/e2e/e2e.sh script: ./scripts/travis/affected-contains.sh "content-services" && ./scripts/travis/e2e/e2e.sh
after_script: ./scripts/ci/job_hooks/after_e2e.sh after_script: ./scripts/ci/job_hooks/after_e2e.sh
workspaces: workspaces:
create: create:
@ -258,7 +258,7 @@ jobs:
before_script: before_script:
- ./scripts/ci/job_hooks/before_e2e.sh - ./scripts/ci/job_hooks/before_e2e.sh
- ./scripts/ci/check-env/check-cs-env.sh || travis_terminate 1 - ./scripts/ci/check-env/check-cs-env.sh || travis_terminate 1
script: ./scripts/travis/e2e/e2e.sh script: ./scripts/travis/affected-contains.sh "content-services" && ./scripts/travis/e2e/e2e.sh
after_script: ./scripts/ci/job_hooks/after_e2e.sh after_script: ./scripts/ci/job_hooks/after_e2e.sh
workspaces: workspaces:
create: create:
@ -279,7 +279,7 @@ jobs:
before_script: before_script:
- ./scripts/ci/job_hooks/before_e2e.sh - ./scripts/ci/job_hooks/before_e2e.sh
- ./scripts/ci/check-env/check-cs-env.sh || travis_terminate 1 - ./scripts/ci/check-env/check-cs-env.sh || travis_terminate 1
script: ./scripts/travis/e2e/e2e.sh script: ./scripts/travis/affected-contains.sh "content-services" && ./scripts/travis/e2e/e2e.sh
after_script: ./scripts/ci/job_hooks/after_e2e.sh after_script: ./scripts/ci/job_hooks/after_e2e.sh
workspaces: workspaces:
create: create:
@ -300,7 +300,7 @@ jobs:
before_script: before_script:
- ./scripts/ci/job_hooks/before_e2e.sh - ./scripts/ci/job_hooks/before_e2e.sh
- ./scripts/ci/check-env/check-cs-env.sh || travis_terminate 1 - ./scripts/ci/check-env/check-cs-env.sh || travis_terminate 1
script: ./scripts/travis/e2e/e2e.sh script: ./scripts/travis/affected-contains.sh "content-services" && ./scripts/travis/e2e/e2e.sh
after_script: ./scripts/ci/job_hooks/after_e2e.sh after_script: ./scripts/ci/job_hooks/after_e2e.sh
workspaces: workspaces:
create: create:
@ -321,7 +321,7 @@ jobs:
before_script: before_script:
- ./scripts/ci/job_hooks/before_e2e.sh - ./scripts/ci/job_hooks/before_e2e.sh
- ./scripts/ci/check-env/check-cs-env.sh || travis_terminate 1 - ./scripts/ci/check-env/check-cs-env.sh || travis_terminate 1
script: ./scripts/travis/e2e/e2e.sh script: ./scripts/travis/affected-contains.sh "content-services" && ./scripts/travis/e2e/e2e.sh
after_script: ./scripts/ci/job_hooks/after_e2e.sh after_script: ./scripts/ci/job_hooks/after_e2e.sh
workspaces: workspaces:
create: create:
@ -343,7 +343,7 @@ jobs:
- ./scripts/ci/job_hooks/before_e2e.sh - ./scripts/ci/job_hooks/before_e2e.sh
- ./scripts/ci/check-env/check-ps-env.sh || travis_terminate 1 - ./scripts/ci/check-env/check-ps-env.sh || travis_terminate 1
- ./scripts/ci/check-env/check-external-cs-env.sh || travis_terminate 1 - ./scripts/ci/check-env/check-external-cs-env.sh || travis_terminate 1
script: ./scripts/travis/e2e/e2e.sh script: ./scripts/travis/affected-contains.sh "process-services" && ./scripts/travis/e2e/e2e.sh
after_script: ./scripts/ci/job_hooks/after_e2e.sh after_script: ./scripts/ci/job_hooks/after_e2e.sh
workspaces: workspaces:
create: create:
@ -365,7 +365,7 @@ jobs:
- ./scripts/ci/job_hooks/before_e2e.sh - ./scripts/ci/job_hooks/before_e2e.sh
- ./scripts/ci/check-env/check-ps-env.sh || travis_terminate 1 - ./scripts/ci/check-env/check-ps-env.sh || travis_terminate 1
- ./scripts/ci/check-env/check-external-cs-env.sh || travis_terminate 1 - ./scripts/ci/check-env/check-external-cs-env.sh || travis_terminate 1
script: ./scripts/travis/e2e/e2e.sh script: ./scripts/travis/affected-contains.sh "process-services" && ./scripts/travis/e2e/e2e.sh
after_script: ./scripts/ci/job_hooks/after_e2e.sh after_script: ./scripts/ci/job_hooks/after_e2e.sh
workspaces: workspaces:
create: create:
@ -387,7 +387,7 @@ jobs:
- ./scripts/ci/job_hooks/before_e2e.sh - ./scripts/ci/job_hooks/before_e2e.sh
- ./scripts/ci/check-env/check-ps-env.sh || travis_terminate 1 - ./scripts/ci/check-env/check-ps-env.sh || travis_terminate 1
- ./scripts/ci/check-env/check-external-cs-env.sh || travis_terminate 1 - ./scripts/ci/check-env/check-external-cs-env.sh || travis_terminate 1
script: ./scripts/travis/e2e/e2e.sh script: ./scripts/travis/affected-contains.sh "process-services" && ./scripts/travis/e2e/e2e.sh
after_script: ./scripts/ci/job_hooks/after_e2e.sh after_script: ./scripts/ci/job_hooks/after_e2e.sh
workspaces: workspaces:
create: create:
@ -409,7 +409,7 @@ jobs:
- ./scripts/ci/job_hooks/before_e2e.sh - ./scripts/ci/job_hooks/before_e2e.sh
- ./scripts/ci/check-env/check-ps-env.sh || travis_terminate 1 - ./scripts/ci/check-env/check-ps-env.sh || travis_terminate 1
- ./scripts/ci/check-env/check-external-cs-env.sh || travis_terminate 1 - ./scripts/ci/check-env/check-external-cs-env.sh || travis_terminate 1
script: ./scripts/travis/e2e/e2e.sh script: ./scripts/travis/affected-contains.sh "process-services" && ./scripts/travis/e2e/e2e.sh
after_script: ./scripts/ci/job_hooks/after_e2e.sh after_script: ./scripts/ci/job_hooks/after_e2e.sh
workspaces: workspaces:
create: create:
@ -431,7 +431,7 @@ jobs:
- ./scripts/ci/job_hooks/before_e2e.sh - ./scripts/ci/job_hooks/before_e2e.sh
- ./scripts/ci/check-env/check-cs-env.sh || travis_terminate 1 - ./scripts/ci/check-env/check-cs-env.sh || travis_terminate 1
- ./scripts/ci/check-env/check-ps-cloud-env.sh || travis_terminate 1 - ./scripts/ci/check-env/check-ps-cloud-env.sh || travis_terminate 1
script: ./scripts/travis/e2e/e2e.sh script: ./scripts/travis/affected-contains.sh "process-services-cloud" && ./scripts/travis/e2e/e2e.sh
after_script: ./scripts/ci/job_hooks/after_e2e.sh after_script: ./scripts/ci/job_hooks/after_e2e.sh
workspaces: workspaces:
create: create:
@ -454,7 +454,7 @@ jobs:
- ./scripts/ci/job_hooks/before_e2e.sh - ./scripts/ci/job_hooks/before_e2e.sh
- ./scripts/ci/check-env/check-cs-env.sh || travis_terminate 1 - ./scripts/ci/check-env/check-cs-env.sh || travis_terminate 1
- ./scripts/ci/check-env/check-ps-cloud-env.sh || travis_terminate 1 - ./scripts/ci/check-env/check-ps-cloud-env.sh || travis_terminate 1
script: ./scripts/travis/e2e/e2e.sh script: ./scripts/travis/affected-contains.sh "process-services-cloud" && ./scripts/travis/e2e/e2e.sh
after_script: ./scripts/ci/job_hooks/after_e2e.sh after_script: ./scripts/ci/job_hooks/after_e2e.sh
workspaces: workspaces:
create: create:
@ -477,7 +477,7 @@ jobs:
- ./scripts/ci/job_hooks/before_e2e.sh - ./scripts/ci/job_hooks/before_e2e.sh
- ./scripts/ci/check-env/check-cs-env.sh || travis_terminate 1 - ./scripts/ci/check-env/check-cs-env.sh || travis_terminate 1
- ./scripts/ci/check-env/check-ps-cloud-env.sh || travis_terminate 1 - ./scripts/ci/check-env/check-ps-cloud-env.sh || travis_terminate 1
script: ./scripts/travis/e2e/e2e.sh script: ./scripts/travis/affected-contains.sh "process-services-cloud" && ./scripts/travis/e2e/e2e.sh
after_script: ./scripts/ci/job_hooks/after_e2e.sh after_script: ./scripts/ci/job_hooks/after_e2e.sh
workspaces: workspaces:
create: create:
@ -500,7 +500,7 @@ jobs:
- ./scripts/ci/job_hooks/before_e2e.sh - ./scripts/ci/job_hooks/before_e2e.sh
- ./scripts/ci/check-env/check-cs-env.sh || travis_terminate 1 - ./scripts/ci/check-env/check-cs-env.sh || travis_terminate 1
- ./scripts/ci/check-env/check-ps-cloud-env.sh || travis_terminate 1 - ./scripts/ci/check-env/check-ps-cloud-env.sh || travis_terminate 1
script: ./scripts/travis/e2e/e2e.sh script: ./scripts/travis/affected-contains.sh "process-services-cloud" && ./scripts/travis/e2e/e2e.sh
after_script: ./scripts/ci/job_hooks/after_e2e.sh after_script: ./scripts/ci/job_hooks/after_e2e.sh
workspaces: workspaces:
create: create:
@ -523,7 +523,7 @@ jobs:
- ./scripts/ci/job_hooks/before_e2e.sh - ./scripts/ci/job_hooks/before_e2e.sh
- ./scripts/ci/check-env/check-cs-env.sh || travis_terminate 1 - ./scripts/ci/check-env/check-cs-env.sh || travis_terminate 1
- ./scripts/ci/check-env/check-ps-cloud-env.sh || travis_terminate 1 - ./scripts/ci/check-env/check-ps-cloud-env.sh || travis_terminate 1
script: ./scripts/travis/e2e/e2e.sh script: ./scripts/travis/affected-contains.sh "process-services-cloud" && ./scripts/travis/e2e/e2e.sh
after_script: ./scripts/ci/job_hooks/after_e2e.sh after_script: ./scripts/ci/job_hooks/after_e2e.sh
workspaces: workspaces:
create: create:

12
nx.json
View File

@ -2,11 +2,13 @@
"npmScope": "adf", "npmScope": "adf",
"implicitDependencies": { "implicitDependencies": {
"angular.json": "*", "angular.json": "*",
"package.json": "*", "package.json": {
"tsconfig.json": "*", "dependencies": {
"tslint.json": "*", "@alfresco/*": "*",
"nx.json": "*", "@angular/*": "*",
".travis.yml": "*", "rxjs": "*"
}
},
"demo-shell/src/index.html": "*", "demo-shell/src/index.html": "*",
"e2e/protractor.excludes.json": "*", "e2e/protractor.excludes.json": "*",
"e2e/protractor.conf.js": "*" "e2e/protractor.conf.js": "*"

View File

@ -0,0 +1,18 @@
#!/usr/bin/env bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
verifyLib=$1;
cd $DIR/../../
AFFECTED_LIBS="$(nx print-affected --type=lib --select=projects --base=$BASE_HASH --head=$HEAD_HASH --plain || exit 1)"
echo "Verify if affected build contains $1"
echo "Affected libs:$AFFECTED_LIBS"
if [[ $AFFECTED_LIBS =~ $verifyLib ]]; then
echo "Yep project:$verifyLib is affected carry on"
exit 0
else
echo "Nope project NOT affected save time"
exit 1
fi;