diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index cda35ebdad..734db6338d 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -191,7 +191,7 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v3 - with: + with: fetch-depth: 0 # Fetch all history for all tags and branches - uses: ./.github/actions/setup - name: install @@ -302,42 +302,49 @@ jobs: auth: "OAUTH" check-cs-env: "true" check-ps-env: "true" + deps: "testing" - description: "Content: Components" test-id: "content-services" folder: "content-services/components" provider: "ECM" auth: "BASIC" check-cs-env: "true" + deps: "testing" - description: "Content: Directives" test-id: "content-services" folder: "content-services/directives" provider: "ECM" auth: "BASIC" check-cs-env: "true" + deps: "testing" - description: "Content: Document List" test-id: "content-services" folder: "content-services/document-list" provider: "ECM" auth: "BASIC" check-cs-env: "true" + deps: "testing" - description: "Content: Metadata" test-id: "content-services" folder: "content-services/metadata" provider: "ECM" auth: "BASIC" check-cs-env: "true" + deps: "testing" - description: "Content: Upload and Versioning" test-id: "content-services" folder: "content-services/upload" provider: "ECM" auth: "BASIC" check-cs-env: "true" + deps: "testing" - description: "Search" test-id: "content-services" folder: "search" provider: "ECM" auth: "BASIC" check-cs-env: "true" + deps: "testing" - description: "Process: Form" test-id: "process-services" folder: "process-services/form" @@ -345,6 +352,7 @@ jobs: auth: "OAUTH" check-ps-env: "true" check-external-cs-env: "true" + deps: "testing" - description: "Process: Process" test-id: "process-services" folder: "process-services/process" @@ -352,6 +360,7 @@ jobs: auth: "OAUTH" check-ps-env: "true" check-external-cs-env: "true" + deps: "testing" - description: "Process: Tasks" test-id: "process-services" folder: "process-services/tasks" @@ -359,6 +368,7 @@ jobs: auth: "OAUTH" check-ps-env: "true" check-external-cs-env: "true" + deps: "testing" - description: "Process: Widget" test-id: "process-services" folder: "process-services/widgets" @@ -366,6 +376,7 @@ jobs: auth: "OAUTH" check-ps-env: "true" check-external-cs-env: "true" + deps: "testing" - description: "Process Cloud: Form" test-id: "process-services-cloud" folder: "process-services-cloud/form-field" @@ -374,6 +385,7 @@ jobs: apa-proxy: true check-cs-env: "true" check-ps-cloud-env: "true" + deps: "testing" - description: "Process Cloud: People" test-id: "process-services-cloud" folder: "process-services-cloud/people" @@ -382,6 +394,7 @@ jobs: apa-proxy: true check-cs-env: "true" check-ps-cloud-env: "true" + deps: "testing" - description: "Process Cloud: Process" test-id: "process-services-cloud" folder: "process-services-cloud/process" @@ -390,6 +403,7 @@ jobs: apa-proxy: true check-cs-env: "true" check-ps-cloud-env: "true" + deps: "testing" - description: "Process Cloud: Start Task" test-id: "process-services-cloud" folder: "process-services-cloud/start-task" @@ -398,6 +412,7 @@ jobs: apa-proxy: true check-cs-env: "true" check-ps-cloud-env: "true" + deps: "testing" - description: "Process Cloud: Tasks List" test-id: "process-services-cloud" folder: "process-services-cloud/task-list" @@ -406,6 +421,7 @@ jobs: apa-proxy: true check-cs-env: "true" check-ps-cloud-env: "true" + deps: "testing" steps: - name: Checkout repository diff --git a/scripts/github/affected-contains.sh b/scripts/github/affected-contains.sh index 1e65436534..f1743be5bf 100755 --- a/scripts/github/affected-contains.sh +++ b/scripts/github/affected-contains.sh @@ -2,6 +2,7 @@ set -e DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" verifyLib=$1; +deps=$2; cd $DIR/../../ if [ "${GITHUB_EVENT_NAME}" == "schedule" ]; then @@ -9,13 +10,27 @@ if [ "${GITHUB_EVENT_NAME}" == "schedule" ]; then echo true exit 0 fi +isAffected=false AFFECTED_LIBS=$(npx nx print-affected --type=lib --select=projects ${NX_CALCULATION_FLAGS} --plain) #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" - echo true -else - #echo "Nope project NOT affected save time" - echo false +#echo "Yep project:$verifyLib is affected carry on" + isAffected=true fi; + +if [[ $isAffected == false ]]; then +# echo "Read the deps as array" + IFS=',' read -ra depsArray <<< "$deps" + +#echo "Loop through the deps to check if they are affected" + for i in "${depsArray[@]}" + do + if [[ $AFFECTED_LIBS =~ $i ]]; then + isAffected=true; + break + fi; + done; +fi; + +echo $isAffected; diff --git a/scripts/github/e2e/e2e.sh b/scripts/github/e2e/e2e.sh index 2de0779f0f..c7e599da94 100755 --- a/scripts/github/e2e/e2e.sh +++ b/scripts/github/e2e/e2e.sh @@ -7,6 +7,7 @@ cd $DIR/../../../ BASE_DIRECTORY=$(echo "$FOLDER" | cut -d "/" -f1) verifyLib=$1; +deps=$3; REGEX="(repository|workflow)_dispatch" # set test-e2e params @@ -16,12 +17,12 @@ else e2eParams="" fi -echo "Step1 - Verify if affected libs contains $verifyLib" +echo "Step1 - Verify if affected libs contains $verifyLib or if deps $deps are affected" -AFFECTED_LIB=$(./scripts/github/affected-contains.sh $verifyLib ) +AFFECTED_LIB=$(./scripts/github/affected-contains.sh $verifyLib $deps) if [ ${AFFECTED_LIB} == true ]; then - echo "Step2 - $verifyLib affected... will execute e2e" + echo "Step2 - $verifyLib OR deps $deps affected... will execute e2e" if [ "${GITHUB_EVENT_NAME}" == "pull_request" ]; then echo "Calculate affected e2e $BASE_HASH $HEAD_HASH" @@ -54,6 +55,6 @@ if [ ${AFFECTED_LIB} == true ]; then fi; else - echo "Step2 - Lib $verifyLib NOT affected. No need to run e2e" + echo "Step2 - Lib $verifyLib OR deps $deps NOT affected. No need to run e2e" exit 0 fi