tf-a-lts[2.8|2.10]-main: optimize build job

Skip the build if there are no new commits
in the repositories [1]

[1]: https://linaro.atlassian.net/browse/TFC-708

Change-Id: I14767a535e979b900c14266d10a351306d21387d
Signed-off-by: Arthur She <arthur.she@linaro.org>
diff --git a/scripts/lts-check-last-commit.sh b/scripts/lts-check-last-commit.sh
new file mode 100755
index 0000000..b9d66f9
--- /dev/null
+++ b/scripts/lts-check-last-commit.sh
@@ -0,0 +1,31 @@
+#!/bin/bash
+#
+set -ex
+
+last_build=$((${BUILD_NUMBER}-1))
+API_URL="${JOB_URL}/${last_build}/api/json"
+
+TO_BUILD_FILE="${WORKSPACE}/TO_BUILD"
+repos_to_check="trusted-firmware-a tf-a-tests tf-a-ci-scripts"
+last_build=$(curl -s ${API_URL})
+last_build_ts=$(echo ${last_build} | jq '.timestamp')
+last_build_ts=$((${last_build_ts}/1000))
+last_build_result=$(echo ${last_build} | jq -r '.result')
+
+if [ "${FORCE_TO_BUILD}" = "true" -o "${last_build_result}" = "FAILURE" ]; then
+    touch ${TO_BUILD_FILE}
+else
+    for r in ${repos_to_check}
+    do
+        pushd ${SHARE_FOLDER}/${r}
+        last_commit_ts=$(git show --no-patch --format=%ct)
+        # if the last commit was not covered by the last build
+        # the new build will be proceeded
+        if [ ${last_commit_ts} -ge ${last_build_ts} ]; then
+            touch ${TO_BUILD_FILE}
+            break
+        fi
+        popd
+    done
+fi
+
diff --git a/tf-a-lts2.10-main.yaml b/tf-a-lts2.10-main.yaml
index 23aad82..dbd85df 100644
--- a/tf-a-lts2.10-main.yaml
+++ b/tf-a-lts2.10-main.yaml
@@ -6,71 +6,75 @@
     disabled: false
     description: Main CI job for Trusted Firmware.
     properties:
-    - throttle:
-        option: project
-        enabled: true
-        max-total: 5
-    - build-discarder:
-        days-to-keep: 60
-        num-to-keep: 30
-    - authorization:
-        !include: authorization.yaml.inc
+      - throttle:
+          option: project
+          enabled: true
+          max-total: 5
+      - build-discarder:
+          days-to-keep: 60
+          num-to-keep: 30
     parameters:
-        - string:
-            name: TF_GERRIT_PROJECT
-            default: 'TF-A/trusted-firmware-a'
-        - string:
-            name: TF_GERRIT_BRANCH
-            default: 'refs/heads/lts-v2.10'
-        - string:
-            name: TF_GERRIT_REFSPEC
-            default: '+refs/heads/lts-v2.10:refs/remotes/origin/lts-v2.10'
-        - string:
-            name: TFTF_GERRIT_PROJECT
-            default: 'TF-A/tf-a-tests'
-        - string:
-            name: TFTF_GERRIT_BRANCH
-            default: 'refs/heads/lts-v2.10'
-        - string:
-            name: TFTF_GERRIT_REFSPEC
-            default: '+refs/heads/lts-v2.10:refs/remotes/origin/lts-v2.10'
-        - string:
-            name: TF_M_TESTS_GERRIT_REFSPEC
-            default: '95d3407a65e26fb3a4319ab38c257e50c9ee804f'
-            description: |
-              tf-m-tests refspec to use. The master branch is used by default.
-        - string:
-            name: TF_M_EXTRAS_GERRIT_REFSPEC
-            default: '+refs/heads/master:refs/remotes/origin/master'
-            description: |
-              tf-m-extras refspec to use. The master branch is used by default.
-        - string:
-           name: SPM_REFSPEC
-           default: 'v2.10'
-           description: |
-             SPM(Hafnium) refspec to use. The master branch is used by default.
-        - string:
-            name: CI_REFSPEC
-            default: '+refs/heads/lts-v2.10:refs/remotes/origin/lts-v2.10'
-        - string:
-            name: MBEDTLS_URL
-            default: 'https://github.com/Mbed-TLS/mbedtls/archive/mbedtls-3.6.1.tar.gz'
-        - string:
-            name: LAVA_RETRIES
-            default: 2
-            description: |
-              Number of tries submitting job to LAVA in case it fails (stopgap measure against nondeterministic failures)
-        - string:
-            name: USE_TUXSUITE_FVP
-            default: 1
-            description: |
-              Whether to submit FVP tests via TuxSuite (instead of LAVA)
-        - string:
-            name: SHARE_FOLDER
-            default: '/srv/shared/${JOB_NAME}/${BUILD_NUMBER}'
-            description: 'Folder containing shared repositories for downstream pipeline jobs'
+      - string:
+          name: TF_GERRIT_PROJECT
+          default: 'TF-A/trusted-firmware-a'
+      - string:
+          name: TF_GERRIT_BRANCH
+          default: 'refs/heads/lts-v2.10'
+      - string:
+          name: TF_GERRIT_REFSPEC
+          default: '+refs/heads/lts-v2.10:refs/remotes/origin/lts-v2.10'
+      - string:
+          name: TFTF_GERRIT_PROJECT
+          default: 'TF-A/tf-a-tests'
+      - string:
+          name: TFTF_GERRIT_BRANCH
+          default: 'refs/heads/lts-v2.10'
+      - string:
+          name: TFTF_GERRIT_REFSPEC
+          default: '+refs/heads/lts-v2.10:refs/remotes/origin/lts-v2.10'
+      - string:
+          name: TF_M_TESTS_GERRIT_REFSPEC
+          default: '95d3407a65e26fb3a4319ab38c257e50c9ee804f'
+          description: |
+            tf-m-tests refspec to use. The master branch is used by default.
+      - string:
+          name: TF_M_EXTRAS_GERRIT_REFSPEC
+          default: '+refs/heads/master:refs/remotes/origin/master'
+          description: |
+            tf-m-extras refspec to use. The master branch is used by default.
+      - string:
+         name: SPM_REFSPEC
+         default: 'v2.10'
+         description: |
+           SPM(Hafnium) refspec to use. The master branch is used by default.
+      - string:
+          name: CI_REFSPEC
+          default: '+refs/heads/lts-v2.10:refs/remotes/origin/lts-v2.10'
+      - string:
+          name: MBEDTLS_URL
+          default: 'https://github.com/Mbed-TLS/mbedtls/archive/mbedtls-3.6.1.tar.gz'
+      - bool:
+          name: FORCE_TO_BUILD
+          default: false
+          description: |
+            If there are no new commits in trusted-firmware-a tf-a-tests, or tf-a-ci-scripts the build will be sikpped.
+            However, you can always force to run the build
+      - string:
+          name: LAVA_RETRIES
+          default: 2
+          description: |
+            Number of tries submitting job to LAVA in case it fails (stopgap measure against nondeterministic failures)
+      - string:
+          name: USE_TUXSUITE_FVP
+          default: 1
+          description: |
+            Whether to submit FVP tests via TuxSuite (instead of LAVA)
+      - string:
+          name: SHARE_FOLDER
+          default: '/srv/shared/${JOB_NAME}/${BUILD_NUMBER}'
+          description: 'Folder containing shared repositories for downstream pipeline jobs'
     triggers:
-        - timed: 'H H(0-7) * * 1,3,5'
+      - timed: 'H H(0-7) * * 1,3,5'
     wrappers:
       - credentials-binding:
           - ssh-user-private-key:
@@ -81,270 +85,287 @@
       - workspace-cleanup
       - timestamps
     builders:
-    - shell:
-        !include-raw: scripts/clone.sh
-    - shell: |
-        #!/bin/bash
-        set -e
-        cat << EOF > tf-a-env.param
-        GERRIT_PROJECT=${TF_GERRIT_PROJECT}
-        GERRIT_BRANCH=${TF_GERRIT_BRANCH}
-        GERRIT_REFSPEC=${TF_GERRIT_REFSPEC}
-        QA_SERVER_PROJECT=${JOB_NAME}
-        QA_SERVER_VERSION=${BUILD_NUMBER}
-        SHARE_FOLDER=${SHARE_FOLDER}
-        EOF
-        cat << EOF > tf-a-tests-env.param
-        GERRIT_PROJECT=${TFTF_GERRIT_PROJECT}
-        GERRIT_BRANCH=${TFTF_GERRIT_BRANCH}
-        GERRIT_REFSPEC=${TFTF_GERRIT_REFSPEC}
-        QA_SERVER_PROJECT=${JOB_NAME}
-        QA_SERVER_VERSION=${BUILD_NUMBER}
-        SHARE_FOLDER=${SHARE_FOLDER}
-        EOF
-    - multijob:
-        name: Run static checks on the code
-        condition: COMPLETED
-        projects:
-        - name: tf-a-static-checks
-          current-parameters: true
-          kill-phase-on: NEVER
-          property-file: tf-a-env.param
-    - multijob:
-        name: Build Trusted Firmware
-        condition: COMPLETED
-        projects:
-        - name: tf-a-lts2.10-ci-gateway
-          alias: tf-l1-build-fvp tf-l2-build-fvp
-          current-parameters: true
-          kill-phase-on: NEVER
-          predefined-parameters: |
-            TEST_GROUPS=tf-l1-build-fvp tf-l2-build-fvp
-          property-file: tf-a-env.param
-        - name: tf-a-lts2.10-ci-gateway
-          alias: tf-l1-build-juno tf-l2-build-juno
-          current-parameters: true
-          kill-phase-on: NEVER
-          predefined-parameters: TEST_GROUPS=tf-l1-build-juno tf-l2-build-juno
-          property-file: tf-a-env.param
-        - name: tf-a-lts2.10-ci-gateway
-          alias: tf-l1-build-plat
-          current-parameters: true
-          kill-phase-on: NEVER
-          predefined-parameters: TEST_GROUPS=tf-l1-build-plat
-          property-file: tf-a-env.param
-        - name: tf-a-lts2.10-ci-gateway
-          alias: tf-l1-build-clang
-          current-parameters: true
-          kill-phase-on: NEVER
-          predefined-parameters: TEST_GROUPS=tf-l1-build-clang
-          property-file: tf-a-env.param
-    - multijob:
-        name: TFTF Tests for FVP
-        condition: COMPLETED
-        projects:
-        - name: tf-a-lts2.10-ci-gateway
-          alias: tftf-l2-fwu
-          current-parameters: true
-          kill-phase-on: NEVER
-          predefined-parameters: TEST_GROUPS=tftf-l2-fwu
-          property-file: tf-a-tests-env.param
-        - name: tf-a-lts2.10-ci-gateway
-          alias: tftf-l1-fvp tftf-l2-fvp-auxiliary
-          current-parameters: true
-          kill-phase-on: NEVER
-          predefined-parameters: TEST_GROUPS=tftf-l1-fvp tftf-l2-fvp-auxiliary
-          property-file: tf-a-tests-env.param
-        - name: tf-a-lts2.10-ci-gateway
-          alias: tftf-l2-fvp tftf-l2-fvp-dynamiq
-          current-parameters: true
-          kill-phase-on: NEVER
-          predefined-parameters: TEST_GROUPS=tftf-l2-fvp tftf-l2-fvp-dynamiq
-          property-file: tf-a-tests-env.param
-        - name: tf-a-lts2.10-ci-gateway
-          alias: tftf-l2-extensive-tests-fvp
-          current-parameters: true
-          kill-phase-on: NEVER
-          predefined-parameters: TEST_GROUPS=tftf-l2-extensive-tests-fvp
-          property-file: tf-a-tests-env.param
-    - multijob:
-        name: Boot up to the Linux shell prompt
-        condition: COMPLETED
-        projects:
-        - name: tf-a-lts2.10-ci-gateway
-          alias: tf-l2-boot-tests-aarch32
-          current-parameters: true
-          kill-phase-on: NEVER
-          predefined-parameters: TEST_GROUPS=tf-l2-boot-tests-aarch32
-          property-file: tf-a-env.param
-        - name: tf-a-lts2.10-ci-gateway
-          alias: tf-l2-boot-tests-rootfs
-          current-parameters: true
-          kill-phase-on: NEVER
-          predefined-parameters: TEST_GROUPS=tf-l2-boot-tests-rootfs
-          property-file: tf-a-env.param
-        - name: tf-a-lts2.10-ci-gateway
-          alias: tf-l2-boot-tests-spm-mm
-          current-parameters: true
-          kill-phase-on: NEVER
-          predefined-parameters: TEST_GROUPS=tf-l2-boot-tests-spm-mm
-          property-file: tf-a-env.param
-        - name: tf-a-lts2.10-ci-gateway
-          alias: spm-l2-boot-tests
-          current-parameters: true
-          kill-phase-on: NEVER
-          predefined-parameters: TEST_GROUPS=spm-l2-boot-tests
-          property-file: tf-a-env.param
-    - multijob:
-        name: Boot up to the Linux shell prompt - Part 2
-        condition: COMPLETED
-        projects:
-        - name: tf-a-lts2.10-ci-gateway
-          alias: tf-l2-boot-tests-misc
-          current-parameters: true
-          kill-phase-on: NEVER
-          predefined-parameters: TEST_GROUPS=tf-l2-boot-tests-misc
-          property-file: tf-a-env.param
-        - name: tf-a-lts2.10-ci-gateway
-          alias: tf-l2-boot-tests-latest
-          current-parameters: true
-          kill-phase-on: NEVER
-          predefined-parameters: TEST_GROUPS=tf-l2-boot-tests-latest
-          property-file: tf-a-env.param
-        - name: tf-a-lts2.10-ci-gateway
-          alias: tf-l2-boot-tests-cortex
-          current-parameters: true
-          kill-phase-on: NEVER
-          predefined-parameters: TEST_GROUPS=tf-l2-boot-tests-cortex
-          property-file: tf-a-env.param
-        - name: tf-a-lts2.10-ci-gateway
-          alias: tf-l2-boot-tests-gicv2
-          current-parameters: true
-          kill-phase-on: NEVER
-          predefined-parameters: TEST_GROUPS=tf-l2-boot-tests-gicv2
-          property-file: tf-a-env.param
-        - name: tf-a-lts2.10-ci-gateway
-          alias: tf-l2-boot-tests-bl2_el3
-          current-parameters: true
-          kill-phase-on: NEVER
-          predefined-parameters: TEST_GROUPS=tf-l2-boot-tests-bl2_el3
-          property-file: tf-a-env.param
-        - name: tf-a-lts2.10-ci-gateway
-          alias: qemu-boot-tests
-          current-parameters: true
-          kill-phase-on: NEVER
-          predefined-parameters: TEST_GROUPS=qemu-boot-tests
-          property-file: tf-a-env.param
-    - multijob:
-        name: Juno Boot Tests
-        condition: COMPLETED
-        projects:
-        - name: tf-a-lts2.10-ci-gateway
-          alias: tf-l2-boot-tests-juno
-          current-parameters: true
-          kill-phase-on: NEVER
-          predefined-parameters: TEST_GROUPS=tf-l2-boot-tests-juno
-          property-file: tf-a-env.param
-        - name: tf-a-lts2.10-ci-gateway
-          alias: tftf-l1-juno
-          current-parameters: true
-          kill-phase-on: NEVER
-          predefined-parameters: TEST_GROUPS=tftf-l1-juno
-          property-file: tf-a-env.param
-    - multijob:
-        name: Miscellaneous tests
-        condition: COMPLETED
-        projects:
-        - name: tf-a-lts2.10-ci-gateway
-          alias: tf-l3-boot-tests-css
-          current-parameters: true
-          kill-phase-on: NEVER
-          predefined-parameters: TEST_GROUPS=tf-l3-boot-tests-css
-          property-file: tf-a-env.param
-        - name: tf-a-lts2.10-ci-gateway
-          alias: tf-l3-boot-tests-spm-mm
-          current-parameters: true
-          kill-phase-on: NEVER
-          predefined-parameters: TEST_GROUPS=tf-l3-boot-tests-spm-mm
-          property-file: tf-a-env.param
-        - name: tf-a-lts2.10-ci-gateway
-          alias: tf-l3-boot-tests-ras
-          current-parameters: true
-          kill-phase-on: NEVER
-          predefined-parameters: TEST_GROUPS=tf-l3-boot-tests-ras
-          property-file: tf-a-env.param
-        - name: tf-a-lts2.10-ci-gateway
-          alias: tf-l3-boot-tests-misc
-          current-parameters: true
-          kill-phase-on: NEVER
-          predefined-parameters: TEST_GROUPS=tf-l3-boot-tests-misc
-          property-file: tf-a-env.param
-        - name: tf-a-lts2.10-ci-gateway
-          alias: tf-l3-boot-tests-n1sdp
-          current-parameters: true
-          kill-phase-on: NEVER
-          predefined-parameters: TEST_GROUPS=tf-l3-boot-tests-n1sdp
-          property-file: tf-a-env.param
-        - name: tf-a-lts2.10-ci-gateway
-          alias: spm-l3-boot-tests
-          current-parameters: true
-          kill-phase-on: NEVER
-          predefined-parameters: TEST_GROUPS=spm-l3-boot-tests
-          property-file: tf-a-env.param
-        - name: tf-a-lts2.10-ci-gateway
-          alias: tf-l2-boot-tests-partner-boards
-          current-parameters: true
-          kill-phase-on: NEVER
-          predefined-parameters: TEST_GROUPS=tf-l2-boot-tests-partner-boards
-          property-file: tf-a-env.param
-        # Platform-specific self-tests.
-        # These tests run from the BL31 image then halt the target.
-        - name: tf-a-lts2.10-ci-gateway
-          alias: tf-l2-boot-tests-arm-plats
-          current-parameters: true
-          kill-phase-on: NEVER
-          predefined-parameters: TEST_GROUPS=tf-l2-boot-tests-arm-plats
-          property-file: tf-a-env.param
-    - multijob:
-        name: Run doc build check
-        condition: COMPLETED
-        projects:
-        - name: tf-a-lts2.10-ci-gateway
-          alias: tf-l1-check-docs
-          current-parameters: true
-          kill-phase-on: NEVER
-          predefined-parameters: TEST_GROUPS=tf-l1-check-docs
-          property-file: tf-a-env.param
-    - multijob:
-        name: Generate visualizations
-        condition: COMPLETED
-        projects:
-          - name: tf-a-sloc-visualization
-            current-parameters: true
-            kill-phase-on: NEVER
-            property-file: tf-a-env.param
-          - name: tf-a-test-category-visualization
-            current-parameters: true
-            kill-phase-on: NEVER
-            property-file: tf-a-env.param
-          - name: tf-a-test-result-visualization
-            current-parameters: true
-            kill-phase-on: NEVER
-            predefined-parameters: TARGET_BUILD=${JOB_NAME}/${BUILD_NUMBER}
-            property-file: tf-a-env.param
-    # Run the unstable TF-A Tests at the end but do not let their results
-    # participate in the job's success/failure.
-    - trigger-builds:
-        - project: tf-a-lts2.10-ci-gateway
-          current-parameters: True
-          property-file: tf-a-tests-env.param
-          property-file-fail-on-missing: True
-          predefined-parameters: TEST_GROUPS=tftf-unstable
-          block: True
-          block-thresholds:
-            build-step-failure-threshold: never
-            unstable-threshold: never
-            failure-threshold: never
+      - shell:
+          !include-raw: scripts/clone.sh
+      - shell: |
+          #!/bin/bash
+          set -e
+          cat << EOF > tf-a-env.param
+          GERRIT_PROJECT=${TF_GERRIT_PROJECT}
+          GERRIT_BRANCH=${TF_GERRIT_BRANCH}
+          GERRIT_REFSPEC=${TF_GERRIT_REFSPEC}
+          QA_SERVER_PROJECT=${JOB_NAME}
+          QA_SERVER_VERSION=${BUILD_NUMBER}
+          SHARE_FOLDER=${SHARE_FOLDER}
+          EOF
+          cat << EOF > tf-a-tests-env.param
+          GERRIT_PROJECT=${TFTF_GERRIT_PROJECT}
+          GERRIT_BRANCH=${TFTF_GERRIT_BRANCH}
+          GERRIT_REFSPEC=${TFTF_GERRIT_REFSPEC}
+          QA_SERVER_PROJECT=${JOB_NAME}
+          QA_SERVER_VERSION=${BUILD_NUMBER}
+          SHARE_FOLDER=${SHARE_FOLDER}
+          EOF
+      - shell:
+          !include-raw: scripts/lts-check-last-commit.sh
+      - conditional-step:
+          condition-kind: file-exists
+          condition-filename: TO_BUILD
+          condition-basedir: workspace
+          steps:
+            - multijob:
+                name: Run static checks on the code
+                condition: COMPLETED
+                projects:
+                - name: tf-a-static-checks
+                  current-parameters: true
+                  kill-phase-on: NEVER
+                  property-file: tf-a-env.param
+            - multijob:
+                name: Build Trusted Firmware
+                condition: COMPLETED
+                projects:
+                - name: tf-a-lts2.10-ci-gateway
+                  alias: tf-l1-build-fvp tf-l2-build-fvp
+                  current-parameters: true
+                  kill-phase-on: NEVER
+                  predefined-parameters: |
+                    TEST_GROUPS=tf-l1-build-fvp tf-l2-build-fvp
+                  property-file: tf-a-env.param
+                - name: tf-a-lts2.10-ci-gateway
+                  alias: tf-l1-build-juno tf-l2-build-juno
+                  current-parameters: true
+                  kill-phase-on: NEVER
+                  predefined-parameters: TEST_GROUPS=tf-l1-build-juno tf-l2-build-juno
+                  property-file: tf-a-env.param
+                - name: tf-a-lts2.10-ci-gateway
+                  alias: tf-l1-build-plat
+                  current-parameters: true
+                  kill-phase-on: NEVER
+                  predefined-parameters: TEST_GROUPS=tf-l1-build-plat
+                  property-file: tf-a-env.param
+                - name: tf-a-lts2.10-ci-gateway
+                  alias: tf-l1-build-clang
+                  current-parameters: true
+                  kill-phase-on: NEVER
+                  predefined-parameters: TEST_GROUPS=tf-l1-build-clang
+                  property-file: tf-a-env.param
+            - multijob:
+                name: TFTF Tests for FVP
+                condition: COMPLETED
+                projects:
+                - name: tf-a-lts2.10-ci-gateway
+                  alias: tftf-l2-fwu
+                  current-parameters: true
+                  kill-phase-on: NEVER
+                  predefined-parameters: TEST_GROUPS=tftf-l2-fwu
+                  property-file: tf-a-tests-env.param
+                - name: tf-a-lts2.10-ci-gateway
+                  alias: tftf-l1-fvp tftf-l2-fvp-auxiliary
+                  current-parameters: true
+                  kill-phase-on: NEVER
+                  predefined-parameters: TEST_GROUPS=tftf-l1-fvp tftf-l2-fvp-auxiliary
+                  property-file: tf-a-tests-env.param
+                - name: tf-a-lts2.10-ci-gateway
+                  alias: tftf-l2-fvp tftf-l2-fvp-dynamiq
+                  current-parameters: true
+                  kill-phase-on: NEVER
+                  predefined-parameters: TEST_GROUPS=tftf-l2-fvp tftf-l2-fvp-dynamiq
+                  property-file: tf-a-tests-env.param
+                - name: tf-a-lts2.10-ci-gateway
+                  alias: tftf-l2-extensive-tests-fvp
+                  current-parameters: true
+                  kill-phase-on: NEVER
+                  predefined-parameters: TEST_GROUPS=tftf-l2-extensive-tests-fvp
+                  property-file: tf-a-tests-env.param
+            - multijob:
+                name: Boot up to the Linux shell prompt
+                condition: COMPLETED
+                projects:
+                - name: tf-a-lts2.10-ci-gateway
+                  alias: tf-l2-boot-tests-aarch32
+                  current-parameters: true
+                  kill-phase-on: NEVER
+                  predefined-parameters: TEST_GROUPS=tf-l2-boot-tests-aarch32
+                  property-file: tf-a-env.param
+                - name: tf-a-lts2.10-ci-gateway
+                  alias: tf-l2-boot-tests-rootfs
+                  current-parameters: true
+                  kill-phase-on: NEVER
+                  predefined-parameters: TEST_GROUPS=tf-l2-boot-tests-rootfs
+                  property-file: tf-a-env.param
+                - name: tf-a-lts2.10-ci-gateway
+                  alias: tf-l2-boot-tests-spm-mm
+                  current-parameters: true
+                  kill-phase-on: NEVER
+                  predefined-parameters: TEST_GROUPS=tf-l2-boot-tests-spm-mm
+                  property-file: tf-a-env.param
+                - name: tf-a-lts2.10-ci-gateway
+                  alias: spm-l2-boot-tests
+                  current-parameters: true
+                  kill-phase-on: NEVER
+                  predefined-parameters: TEST_GROUPS=spm-l2-boot-tests
+                  property-file: tf-a-env.param
+            - multijob:
+                name: Boot up to the Linux shell prompt - Part 2
+                condition: COMPLETED
+                projects:
+                - name: tf-a-lts2.10-ci-gateway
+                  alias: tf-l2-boot-tests-misc
+                  current-parameters: true
+                  kill-phase-on: NEVER
+                  predefined-parameters: TEST_GROUPS=tf-l2-boot-tests-misc
+                  property-file: tf-a-env.param
+                - name: tf-a-lts2.10-ci-gateway
+                  alias: tf-l2-boot-tests-latest
+                  current-parameters: true
+                  kill-phase-on: NEVER
+                  predefined-parameters: TEST_GROUPS=tf-l2-boot-tests-latest
+                  property-file: tf-a-env.param
+                - name: tf-a-lts2.10-ci-gateway
+                  alias: tf-l2-boot-tests-cortex
+                  current-parameters: true
+                  kill-phase-on: NEVER
+                  predefined-parameters: TEST_GROUPS=tf-l2-boot-tests-cortex
+                  property-file: tf-a-env.param
+                - name: tf-a-lts2.10-ci-gateway
+                  alias: tf-l2-boot-tests-gicv2
+                  current-parameters: true
+                  kill-phase-on: NEVER
+                  predefined-parameters: TEST_GROUPS=tf-l2-boot-tests-gicv2
+                  property-file: tf-a-env.param
+                - name: tf-a-lts2.10-ci-gateway
+                  alias: tf-l2-boot-tests-bl2_el3
+                  current-parameters: true
+                  kill-phase-on: NEVER
+                  predefined-parameters: TEST_GROUPS=tf-l2-boot-tests-bl2_el3
+                  property-file: tf-a-env.param
+                - name: tf-a-lts2.10-ci-gateway
+                  alias: qemu-boot-tests
+                  current-parameters: true
+                  kill-phase-on: NEVER
+                  predefined-parameters: TEST_GROUPS=qemu-boot-tests
+                  property-file: tf-a-env.param
+            - multijob:
+                name: Juno Boot Tests
+                condition: COMPLETED
+                projects:
+                - name: tf-a-lts2.10-ci-gateway
+                  alias: tf-l2-boot-tests-juno
+                  current-parameters: true
+                  kill-phase-on: NEVER
+                  predefined-parameters: TEST_GROUPS=tf-l2-boot-tests-juno
+                  property-file: tf-a-env.param
+                - name: tf-a-lts2.10-ci-gateway
+                  alias: tftf-l1-juno
+                  current-parameters: true
+                  kill-phase-on: NEVER
+                  predefined-parameters: TEST_GROUPS=tftf-l1-juno
+                  property-file: tf-a-env.param
+            - multijob:
+                name: Miscellaneous tests
+                condition: COMPLETED
+                projects:
+                - name: tf-a-lts2.10-ci-gateway
+                  alias: tf-l3-boot-tests-css
+                  current-parameters: true
+                  kill-phase-on: NEVER
+                  predefined-parameters: TEST_GROUPS=tf-l3-boot-tests-css
+                  property-file: tf-a-env.param
+                - name: tf-a-lts2.10-ci-gateway
+                  alias: tf-l3-boot-tests-spm-mm
+                  current-parameters: true
+                  kill-phase-on: NEVER
+                  predefined-parameters: TEST_GROUPS=tf-l3-boot-tests-spm-mm
+                  property-file: tf-a-env.param
+                - name: tf-a-lts2.10-ci-gateway
+                  alias: tf-l3-boot-tests-ras
+                  current-parameters: true
+                  kill-phase-on: NEVER
+                  predefined-parameters: TEST_GROUPS=tf-l3-boot-tests-ras
+                  property-file: tf-a-env.param
+                - name: tf-a-lts2.10-ci-gateway
+                  alias: tf-l3-boot-tests-misc
+                  current-parameters: true
+                  kill-phase-on: NEVER
+                  predefined-parameters: TEST_GROUPS=tf-l3-boot-tests-misc
+                  property-file: tf-a-env.param
+                - name: tf-a-lts2.10-ci-gateway
+                  alias: tf-l3-boot-tests-n1sdp
+                  current-parameters: true
+                  kill-phase-on: NEVER
+                  predefined-parameters: TEST_GROUPS=tf-l3-boot-tests-n1sdp
+                  property-file: tf-a-env.param
+                - name: tf-a-lts2.10-ci-gateway
+                  alias: spm-l3-boot-tests
+                  current-parameters: true
+                  kill-phase-on: NEVER
+                  predefined-parameters: TEST_GROUPS=spm-l3-boot-tests
+                  property-file: tf-a-env.param
+                - name: tf-a-lts2.10-ci-gateway
+                  alias: tf-l2-boot-tests-partner-boards
+                  current-parameters: true
+                  kill-phase-on: NEVER
+                  predefined-parameters: TEST_GROUPS=tf-l2-boot-tests-partner-boards
+                  property-file: tf-a-env.param
+                # Platform-specific self-tests.
+                # These tests run from the BL31 image then halt the target.
+                - name: tf-a-lts2.10-ci-gateway
+                  alias: tf-l2-boot-tests-arm-plats
+                  current-parameters: true
+                  kill-phase-on: NEVER
+                  predefined-parameters: TEST_GROUPS=tf-l2-boot-tests-arm-plats
+                  property-file: tf-a-env.param
+            - multijob:
+                name: Run doc build check
+                condition: COMPLETED
+                projects:
+                - name: tf-a-lts2.10-ci-gateway
+                  alias: tf-l1-check-docs
+                  current-parameters: true
+                  kill-phase-on: NEVER
+                  predefined-parameters: TEST_GROUPS=tf-l1-check-docs
+                  property-file: tf-a-env.param
+            - multijob:
+                name: Generate visualizations
+                condition: COMPLETED
+                projects:
+                  - name: tf-a-sloc-visualization
+                    current-parameters: true
+                    kill-phase-on: NEVER
+                    property-file: tf-a-env.param
+                  - name: tf-a-test-category-visualization
+                    current-parameters: true
+                    kill-phase-on: NEVER
+                    property-file: tf-a-env.param
+                  - name: tf-a-test-result-visualization
+                    current-parameters: true
+                    kill-phase-on: NEVER
+                    predefined-parameters: TARGET_BUILD=${JOB_NAME}/${BUILD_NUMBER}
+                    property-file: tf-a-env.param
+            # Run the unstable TF-A Tests at the end but do not let their results
+            # participate in the job's success/failure.
+            - trigger-builds:
+                - project: tf-a-lts2.10-ci-gateway
+                  current-parameters: True
+                  property-file: tf-a-tests-env.param
+                  property-file-fail-on-missing: True
+                  predefined-parameters: TEST_GROUPS=tftf-unstable
+                  block: True
+                  block-thresholds:
+                    build-step-failure-threshold: never
+                    unstable-threshold: never
+                    failure-threshold: never
     publishers:
-        - email:
-            recipients: okash@google.com, bipin.ravi@arm.com, vwadekar@nvidia.com, joanna.farley@arm.com
+      - groovy-postbuild:
+          script: |
+            def currentBuild = Thread.currentThread().executable
+            def workspace = System.getenv('WORKSPACE') ?: '.'
+            def toBuildFile = new File("${workspace}/TO_BUILD")
+
+            if (!toBuildFile.exists()) {
+                currentBuild.setDescription("There are no new commits in the repositories, skip the build!")
+            }
+          on-failure: "nothing"
+      - email:
+          recipients: bipin.ravi@arm.com, vwadekar@nvidia.com, yann.gautier@st.com, palmer@google.com, govindraj.raja@arm.com
diff --git a/tf-a-lts2.8-main.yaml b/tf-a-lts2.8-main.yaml
index 7890df7..e4962e7 100644
--- a/tf-a-lts2.8-main.yaml
+++ b/tf-a-lts2.8-main.yaml
@@ -6,61 +6,65 @@
     disabled: false
     description: Main CI job for Trusted Firmware.
     properties:
-    - throttle:
-        option: project
-        enabled: true
-        max-total: 5
-    - build-discarder:
-        days-to-keep: 60
-        num-to-keep: 30
-    - authorization:
-        !include: authorization.yaml.inc
+      - throttle:
+          option: project
+          enabled: true
+          max-total: 5
+      - build-discarder:
+          days-to-keep: 60
+          num-to-keep: 30
     parameters:
-        - string:
-            name: TF_GERRIT_PROJECT
-            default: 'TF-A/trusted-firmware-a'
-        - string:
-            name: TF_GERRIT_BRANCH
-            default: 'refs/heads/lts-v2.8'
-        - string:
-            name: TF_GERRIT_REFSPEC
-            default: '+refs/heads/lts-v2.8:refs/remotes/origin/lts-v2.8'
-        - string:
-            name: TFTF_GERRIT_PROJECT
-            default: 'TF-A/tf-a-tests'
-        - string:
-            name: TFTF_GERRIT_BRANCH
-            default: 'refs/heads/lts-v2.8'
-        - string:
-            name: TFTF_GERRIT_REFSPEC
-            default: '+refs/heads/lts-v2.8:refs/remotes/origin/lts-v2.8'
-        - string:
-           name: SPM_REFSPEC
-           default: 'v2.8'
-           description: |
-             SPM(Hafnium) refspec to use. The master branch is used by default.
-        - string:
-            name: CI_REFSPEC
-            default: '+refs/heads/lts-v2.8:refs/remotes/origin/lts-v2.8'
-        - string:
-            name: MBEDTLS_URL
-            default: 'https://github.com/Mbed-TLS/mbedtls/archive/mbedtls-3.6.1.tar.gz'
-        - string:
-            name: LAVA_RETRIES
-            default: 2
-            description: |
-              Number of tries submitting job to LAVA in case it fails (stopgap measure against nondeterministic failures)
-        - string:
-            name: USE_TUXSUITE_FVP
-            default: 1
-            description: |
-              Whether to submit FVP tests via TuxSuite (instead of LAVA)
-        - string:
-            name: SHARE_FOLDER
-            default: '/srv/shared/${JOB_NAME}/${BUILD_NUMBER}'
-            description: 'Folder containing shared repositories for downstream pipeline jobs'
+      - string:
+          name: TF_GERRIT_PROJECT
+          default: 'TF-A/trusted-firmware-a'
+      - string:
+          name: TF_GERRIT_BRANCH
+          default: 'refs/heads/lts-v2.8'
+      - string:
+          name: TF_GERRIT_REFSPEC
+          default: '+refs/heads/lts-v2.8:refs/remotes/origin/lts-v2.8'
+      - string:
+          name: TFTF_GERRIT_PROJECT
+          default: 'TF-A/tf-a-tests'
+      - string:
+          name: TFTF_GERRIT_BRANCH
+          default: 'refs/heads/lts-v2.8'
+      - string:
+          name: TFTF_GERRIT_REFSPEC
+          default: '+refs/heads/lts-v2.8:refs/remotes/origin/lts-v2.8'
+      - string:
+         name: SPM_REFSPEC
+         default: 'v2.8'
+         description: |
+           SPM(Hafnium) refspec to use. The master branch is used by default.
+      - string:
+          name: CI_REFSPEC
+          default: '+refs/heads/lts-v2.8:refs/remotes/origin/lts-v2.8'
+      - string:
+          name: MBEDTLS_URL
+          default: 'https://github.com/Mbed-TLS/mbedtls/archive/mbedtls-3.6.1.tar.gz'
+      - string:
+          name: LAVA_RETRIES
+          default: 2
+          description: |
+            Number of tries submitting job to LAVA in case it fails (stopgap measure against nondeterministic failures)
+      - string:
+          name: USE_TUXSUITE_FVP
+          default: 1
+          description: |
+            Whether to submit FVP tests via TuxSuite (instead of LAVA)
+      - bool:
+          name: FORCE_TO_BUILD
+          default: false
+          description: |
+            If there are no new commits in trusted-firmware-a tf-a-tests, or tf-a-ci-scripts the build will be sikpped.
+            However, you can always force to run the build
+      - string:
+          name: SHARE_FOLDER
+          default: '/srv/shared/${JOB_NAME}/${BUILD_NUMBER}'
+          description: 'Folder containing shared repositories for downstream pipeline jobs'
     triggers:
-        - timed: 'H H(0-7) * * 3,6'
+      - timed: 'H H(0-7) * * 3,6'
     wrappers:
       - credentials-binding:
           - ssh-user-private-key:
@@ -71,255 +75,272 @@
       - workspace-cleanup
       - timestamps
     builders:
-    - shell:
-        !include-raw: scripts/clone.sh
-    - shell: |
-        #!/bin/bash
-        set -e
-        cat << EOF > tf-a-env.param
-        GERRIT_PROJECT=${TF_GERRIT_PROJECT}
-        GERRIT_BRANCH=${TF_GERRIT_BRANCH}
-        GERRIT_REFSPEC=${TF_GERRIT_REFSPEC}
-        QA_SERVER_PROJECT=${JOB_NAME}
-        QA_SERVER_VERSION=${BUILD_NUMBER}
-        SHARE_FOLDER=${SHARE_FOLDER}
-        EOF
-        cat << EOF > tf-a-tests-env.param
-        GERRIT_PROJECT=${TFTF_GERRIT_PROJECT}
-        GERRIT_BRANCH=${TFTF_GERRIT_BRANCH}
-        GERRIT_REFSPEC=${TFTF_GERRIT_REFSPEC}
-        QA_SERVER_PROJECT=${JOB_NAME}
-        QA_SERVER_VERSION=${BUILD_NUMBER}
-        SHARE_FOLDER=${SHARE_FOLDER}
-        EOF
-    - multijob:
-        name: Run static checks on the code
-        condition: COMPLETED
-        projects:
-        - name: tf-a-static-checks
-          current-parameters: true
-          kill-phase-on: NEVER
-          property-file: tf-a-env.param
-    - multijob:
-        name: Build Trusted Firmware
-        condition: COMPLETED
-        projects:
-        - name: tf-a-lts2.8-ci-gateway
-          alias: tf-l1-build-fvp tf-l2-build-fvp
-          current-parameters: true
-          kill-phase-on: NEVER
-          predefined-parameters: |
-            TEST_GROUPS=tf-l1-build-fvp tf-l2-build-fvp
-          property-file: tf-a-env.param
-        - name: tf-a-lts2.8-ci-gateway
-          alias: tf-l1-build-juno tf-l2-build-juno
-          current-parameters: true
-          kill-phase-on: NEVER
-          predefined-parameters: TEST_GROUPS=tf-l1-build-juno tf-l2-build-juno
-          property-file: tf-a-env.param
-        - name: tf-a-lts2.8-ci-gateway
-          alias: tf-l1-build-plat
-          current-parameters: true
-          kill-phase-on: NEVER
-          predefined-parameters: TEST_GROUPS=tf-l1-build-plat
-          property-file: tf-a-env.param
-        - name: tf-a-lts2.8-ci-gateway
-          alias: tf-l1-build-clang
-          current-parameters: true
-          kill-phase-on: NEVER
-          predefined-parameters: TEST_GROUPS=tf-l1-build-clang
-          property-file: tf-a-env.param
-    - multijob:
-        name: TFTF Tests for FVP
-        condition: COMPLETED
-        projects:
-        - name: tf-a-lts2.8-ci-gateway
-          alias: tftf-l2-fwu
-          current-parameters: true
-          kill-phase-on: NEVER
-          predefined-parameters: TEST_GROUPS=tftf-l2-fwu
-          property-file: tf-a-tests-env.param
-        - name: tf-a-lts2.8-ci-gateway
-          alias: tftf-l1-fvp tftf-l2-fvp-auxiliary
-          current-parameters: true
-          kill-phase-on: NEVER
-          predefined-parameters: TEST_GROUPS=tftf-l1-fvp tftf-l2-fvp-auxiliary
-          property-file: tf-a-tests-env.param
-        - name: tf-a-lts2.8-ci-gateway
-          alias: tftf-l2-fvp tftf-l2-fvp-dynamiq
-          current-parameters: true
-          kill-phase-on: NEVER
-          predefined-parameters: TEST_GROUPS=tftf-l2-fvp tftf-l2-fvp-dynamiq
-          property-file: tf-a-tests-env.param
-        - name: tf-a-lts2.8-ci-gateway
-          alias: tftf-l2-extensive-tests-fvp
-          current-parameters: true
-          kill-phase-on: NEVER
-          predefined-parameters: TEST_GROUPS=tftf-l2-extensive-tests-fvp
-          property-file: tf-a-tests-env.param
-    - multijob:
-        name: Boot up to the Linux shell prompt
-        condition: COMPLETED
-        projects:
-        - name: tf-a-lts2.8-ci-gateway
-          alias: tf-l2-boot-tests-aarch32
-          current-parameters: true
-          kill-phase-on: NEVER
-          predefined-parameters: TEST_GROUPS=tf-l2-boot-tests-aarch32
-          property-file: tf-a-env.param
-        - name: tf-a-lts2.8-ci-gateway
-          alias: tf-l2-boot-tests-rootfs
-          current-parameters: true
-          kill-phase-on: NEVER
-          predefined-parameters: TEST_GROUPS=tf-l2-boot-tests-rootfs
-          property-file: tf-a-env.param
-        - name: tf-a-lts2.8-ci-gateway
-          alias: tf-l2-boot-tests-spm-mm
-          current-parameters: true
-          kill-phase-on: NEVER
-          predefined-parameters: TEST_GROUPS=tf-l2-boot-tests-spm-mm
-          property-file: tf-a-env.param
-        - name: tf-a-lts2.8-ci-gateway
-          alias: spm-l2-boot-tests
-          current-parameters: true
-          kill-phase-on: NEVER
-          predefined-parameters: TEST_GROUPS=spm-l2-boot-tests
-          property-file: tf-a-env.param
-    - multijob:
-        name: Boot up to the Linux shell prompt - Part 2
-        condition: COMPLETED
-        projects:
-        - name: tf-a-lts2.8-ci-gateway
-          alias: tf-l2-boot-tests-misc
-          current-parameters: true
-          kill-phase-on: NEVER
-          predefined-parameters: TEST_GROUPS=tf-l2-boot-tests-misc
-          property-file: tf-a-env.param
-        - name: tf-a-lts2.8-ci-gateway
-          alias: tf-l2-boot-tests-latest
-          current-parameters: true
-          kill-phase-on: NEVER
-          predefined-parameters: TEST_GROUPS=tf-l2-boot-tests-latest
-          property-file: tf-a-env.param
-        - name: tf-a-lts2.8-ci-gateway
-          alias: tf-l2-boot-tests-cortex
-          current-parameters: true
-          kill-phase-on: NEVER
-          predefined-parameters: TEST_GROUPS=tf-l2-boot-tests-cortex
-          property-file: tf-a-env.param
-        - name: tf-a-lts2.8-ci-gateway
-          alias: tf-l2-boot-tests-gicv2
-          current-parameters: true
-          kill-phase-on: NEVER
-          predefined-parameters: TEST_GROUPS=tf-l2-boot-tests-gicv2
-          property-file: tf-a-env.param
-        - name: tf-a-lts2.8-ci-gateway
-          alias: tf-l2-boot-tests-bl2_el3
-          current-parameters: true
-          kill-phase-on: NEVER
-          predefined-parameters: TEST_GROUPS=tf-l2-boot-tests-bl2_el3
-          property-file: tf-a-env.param
-        - name: tf-a-lts2.8-ci-gateway
-          alias: qemu-boot-tests
-          current-parameters: true
-          kill-phase-on: NEVER
-          predefined-parameters: TEST_GROUPS=qemu-boot-tests
-          property-file: tf-a-env.param
-    - multijob:
-        name: Juno Boot Tests
-        condition: COMPLETED
-        projects:
-        - name: tf-a-lts2.8-ci-gateway
-          alias: tf-l2-boot-tests-juno
-          current-parameters: true
-          kill-phase-on: NEVER
-          predefined-parameters: TEST_GROUPS=tf-l2-boot-tests-juno
-          property-file: tf-a-env.param
-        - name: tf-a-lts2.8-ci-gateway
-          alias: tftf-l1-juno
-          current-parameters: true
-          kill-phase-on: NEVER
-          predefined-parameters: TEST_GROUPS=tftf-l1-juno
-          property-file: tf-a-env.param
-    - multijob:
-        name: Miscellaneous tests
-        condition: COMPLETED
-        projects:
-        - name: tf-a-lts2.8-ci-gateway
-          alias: tf-l3-boot-tests-css
-          current-parameters: true
-          kill-phase-on: NEVER
-          predefined-parameters: TEST_GROUPS=tf-l3-boot-tests-css
-          property-file: tf-a-env.param
-        - name: tf-a-lts2.8-ci-gateway
-          alias: tf-l3-boot-tests-spm-mm
-          current-parameters: true
-          kill-phase-on: NEVER
-          predefined-parameters: TEST_GROUPS=tf-l3-boot-tests-spm-mm
-          property-file: tf-a-env.param
-        - name: tf-a-lts2.8-ci-gateway
-          alias: tf-l3-boot-tests-ras
-          current-parameters: true
-          kill-phase-on: NEVER
-          predefined-parameters: TEST_GROUPS=tf-l3-boot-tests-ras
-          property-file: tf-a-env.param
-        - name: tf-a-lts2.8-ci-gateway
-          alias: tf-l3-boot-tests-misc
-          current-parameters: true
-          kill-phase-on: NEVER
-          predefined-parameters: TEST_GROUPS=tf-l3-boot-tests-misc
-          property-file: tf-a-env.param
-        - name: tf-a-lts2.8-ci-gateway
-          alias: spm-l3-boot-tests
-          current-parameters: true
-          kill-phase-on: NEVER
-          predefined-parameters: TEST_GROUPS=spm-l3-boot-tests
-          property-file: tf-a-env.param
-        - name: tf-a-lts2.8-ci-gateway
-          alias: tf-l1-boot-tests-plat
-          current-parameters: true
-          kill-phase-on: NEVER
-          predefined-parameters: TEST_GROUPS=tf-l1-boot-tests-plat
-          property-file: tf-a-env.param
-    - multijob:
-        name: Run doc build check
-        condition: COMPLETED
-        projects:
-        - name: tf-a-lts2.8-ci-gateway
-          current-parameters: true
-          kill-phase-on: NEVER
-          predefined-parameters: TEST_GROUPS=tf-l1-check-docs
-          property-file: tf-a-env.param
-    - multijob:
-       name: Generate visualizations
-       condition: COMPLETED
-       projects:
-#        - name: tf-a-sloc-visualization
-#          current-parameters: true
-#          kill-phase-on: NEVER
-#          property-file: tf-a-env.param
-#        - name: tf-a-test-category-visualization
-#          current-parameters: true
-#          kill-phase-on: NEVER
-#          property-file: tf-a-env.param
-        - name: tf-a-test-result-visualization
-          current-parameters: true
-          kill-phase-on: NEVER
-          predefined-parameters: TARGET_BUILD=${JOB_NAME}/${BUILD_NUMBER}
-          property-file: tf-a-env.param
-    # Run the unstable TF-A Tests at the end but do not let their results
-    # participate in the job's success/failure.
-    - trigger-builds:
-        - project: tf-a-lts2.8-ci-gateway
-          current-parameters: True
-          property-file: tf-a-tests-env.param
-          property-file-fail-on-missing: True
-          predefined-parameters: TEST_GROUPS=tftf-unstable
-          block: True
-          block-thresholds:
-            build-step-failure-threshold: never
-            unstable-threshold: never
-            failure-threshold: never
+      - shell:
+          !include-raw: scripts/clone.sh
+      - shell: |
+          #!/bin/bash
+          set -e
+          cat << EOF > tf-a-env.param
+          GERRIT_PROJECT=${TF_GERRIT_PROJECT}
+          GERRIT_BRANCH=${TF_GERRIT_BRANCH}
+          GERRIT_REFSPEC=${TF_GERRIT_REFSPEC}
+          QA_SERVER_PROJECT=${JOB_NAME}
+          QA_SERVER_VERSION=${BUILD_NUMBER}
+          SHARE_FOLDER=${SHARE_FOLDER}
+          EOF
+          cat << EOF > tf-a-tests-env.param
+          GERRIT_PROJECT=${TFTF_GERRIT_PROJECT}
+          GERRIT_BRANCH=${TFTF_GERRIT_BRANCH}
+          GERRIT_REFSPEC=${TFTF_GERRIT_REFSPEC}
+          QA_SERVER_PROJECT=${JOB_NAME}
+          QA_SERVER_VERSION=${BUILD_NUMBER}
+          SHARE_FOLDER=${SHARE_FOLDER}
+          EOF
+      - shell:
+          !include-raw: scripts/lts-check-last-commit.sh
+      - conditional-step:
+          condition-kind: file-exists
+          condition-filename: TO_BUILD
+          condition-basedir: workspace
+          steps:
+            - multijob:
+                name: Run static checks on the code
+                condition: COMPLETED
+                projects:
+                - name: tf-a-static-checks
+                  current-parameters: true
+                  kill-phase-on: NEVER
+                  property-file: tf-a-env.param
+            - multijob:
+                name: Build Trusted Firmware
+                condition: COMPLETED
+                projects:
+                - name: tf-a-lts2.8-ci-gateway
+                  alias: tf-l1-build-fvp tf-l2-build-fvp
+                  current-parameters: true
+                  kill-phase-on: NEVER
+                  predefined-parameters: |
+                    TEST_GROUPS=tf-l1-build-fvp tf-l2-build-fvp
+                  property-file: tf-a-env.param
+                - name: tf-a-lts2.8-ci-gateway
+                  alias: tf-l1-build-juno tf-l2-build-juno
+                  current-parameters: true
+                  kill-phase-on: NEVER
+                  predefined-parameters: TEST_GROUPS=tf-l1-build-juno tf-l2-build-juno
+                  property-file: tf-a-env.param
+                - name: tf-a-lts2.8-ci-gateway
+                  alias: tf-l1-build-plat
+                  current-parameters: true
+                  kill-phase-on: NEVER
+                  predefined-parameters: TEST_GROUPS=tf-l1-build-plat
+                  property-file: tf-a-env.param
+                - name: tf-a-lts2.8-ci-gateway
+                  alias: tf-l1-build-clang
+                  current-parameters: true
+                  kill-phase-on: NEVER
+                  predefined-parameters: TEST_GROUPS=tf-l1-build-clang
+                  property-file: tf-a-env.param
+            - multijob:
+                name: TFTF Tests for FVP
+                condition: COMPLETED
+                projects:
+                - name: tf-a-lts2.8-ci-gateway
+                  alias: tftf-l2-fwu
+                  current-parameters: true
+                  kill-phase-on: NEVER
+                  predefined-parameters: TEST_GROUPS=tftf-l2-fwu
+                  property-file: tf-a-tests-env.param
+                - name: tf-a-lts2.8-ci-gateway
+                  alias: tftf-l1-fvp tftf-l2-fvp-auxiliary
+                  current-parameters: true
+                  kill-phase-on: NEVER
+                  predefined-parameters: TEST_GROUPS=tftf-l1-fvp tftf-l2-fvp-auxiliary
+                  property-file: tf-a-tests-env.param
+                - name: tf-a-lts2.8-ci-gateway
+                  alias: tftf-l2-fvp tftf-l2-fvp-dynamiq
+                  current-parameters: true
+                  kill-phase-on: NEVER
+                  predefined-parameters: TEST_GROUPS=tftf-l2-fvp tftf-l2-fvp-dynamiq
+                  property-file: tf-a-tests-env.param
+                - name: tf-a-lts2.8-ci-gateway
+                  alias: tftf-l2-extensive-tests-fvp
+                  current-parameters: true
+                  kill-phase-on: NEVER
+                  predefined-parameters: TEST_GROUPS=tftf-l2-extensive-tests-fvp
+                  property-file: tf-a-tests-env.param
+            - multijob:
+                name: Boot up to the Linux shell prompt
+                condition: COMPLETED
+                projects:
+                - name: tf-a-lts2.8-ci-gateway
+                  alias: tf-l2-boot-tests-aarch32
+                  current-parameters: true
+                  kill-phase-on: NEVER
+                  predefined-parameters: TEST_GROUPS=tf-l2-boot-tests-aarch32
+                  property-file: tf-a-env.param
+                - name: tf-a-lts2.8-ci-gateway
+                  alias: tf-l2-boot-tests-rootfs
+                  current-parameters: true
+                  kill-phase-on: NEVER
+                  predefined-parameters: TEST_GROUPS=tf-l2-boot-tests-rootfs
+                  property-file: tf-a-env.param
+                - name: tf-a-lts2.8-ci-gateway
+                  alias: tf-l2-boot-tests-spm-mm
+                  current-parameters: true
+                  kill-phase-on: NEVER
+                  predefined-parameters: TEST_GROUPS=tf-l2-boot-tests-spm-mm
+                  property-file: tf-a-env.param
+                - name: tf-a-lts2.8-ci-gateway
+                  alias: spm-l2-boot-tests
+                  current-parameters: true
+                  kill-phase-on: NEVER
+                  predefined-parameters: TEST_GROUPS=spm-l2-boot-tests
+                  property-file: tf-a-env.param
+            - multijob:
+                name: Boot up to the Linux shell prompt - Part 2
+                condition: COMPLETED
+                projects:
+                - name: tf-a-lts2.8-ci-gateway
+                  alias: tf-l2-boot-tests-misc
+                  current-parameters: true
+                  kill-phase-on: NEVER
+                  predefined-parameters: TEST_GROUPS=tf-l2-boot-tests-misc
+                  property-file: tf-a-env.param
+                - name: tf-a-lts2.8-ci-gateway
+                  alias: tf-l2-boot-tests-latest
+                  current-parameters: true
+                  kill-phase-on: NEVER
+                  predefined-parameters: TEST_GROUPS=tf-l2-boot-tests-latest
+                  property-file: tf-a-env.param
+                - name: tf-a-lts2.8-ci-gateway
+                  alias: tf-l2-boot-tests-cortex
+                  current-parameters: true
+                  kill-phase-on: NEVER
+                  predefined-parameters: TEST_GROUPS=tf-l2-boot-tests-cortex
+                  property-file: tf-a-env.param
+                - name: tf-a-lts2.8-ci-gateway
+                  alias: tf-l2-boot-tests-gicv2
+                  current-parameters: true
+                  kill-phase-on: NEVER
+                  predefined-parameters: TEST_GROUPS=tf-l2-boot-tests-gicv2
+                  property-file: tf-a-env.param
+                - name: tf-a-lts2.8-ci-gateway
+                  alias: tf-l2-boot-tests-bl2_el3
+                  current-parameters: true
+                  kill-phase-on: NEVER
+                  predefined-parameters: TEST_GROUPS=tf-l2-boot-tests-bl2_el3
+                  property-file: tf-a-env.param
+                - name: tf-a-lts2.8-ci-gateway
+                  alias: qemu-boot-tests
+                  current-parameters: true
+                  kill-phase-on: NEVER
+                  predefined-parameters: TEST_GROUPS=qemu-boot-tests
+                  property-file: tf-a-env.param
+            - multijob:
+                name: Juno Boot Tests
+                condition: COMPLETED
+                projects:
+                - name: tf-a-lts2.8-ci-gateway
+                  alias: tf-l2-boot-tests-juno
+                  current-parameters: true
+                  kill-phase-on: NEVER
+                  predefined-parameters: TEST_GROUPS=tf-l2-boot-tests-juno
+                  property-file: tf-a-env.param
+                - name: tf-a-lts2.8-ci-gateway
+                  alias: tftf-l1-juno
+                  current-parameters: true
+                  kill-phase-on: NEVER
+                  predefined-parameters: TEST_GROUPS=tftf-l1-juno
+                  property-file: tf-a-env.param
+            - multijob:
+                name: Miscellaneous tests
+                condition: COMPLETED
+                projects:
+                - name: tf-a-lts2.8-ci-gateway
+                  alias: tf-l3-boot-tests-css
+                  current-parameters: true
+                  kill-phase-on: NEVER
+                  predefined-parameters: TEST_GROUPS=tf-l3-boot-tests-css
+                  property-file: tf-a-env.param
+                - name: tf-a-lts2.8-ci-gateway
+                  alias: tf-l3-boot-tests-spm-mm
+                  current-parameters: true
+                  kill-phase-on: NEVER
+                  predefined-parameters: TEST_GROUPS=tf-l3-boot-tests-spm-mm
+                  property-file: tf-a-env.param
+                - name: tf-a-lts2.8-ci-gateway
+                  alias: tf-l3-boot-tests-ras
+                  current-parameters: true
+                  kill-phase-on: NEVER
+                  predefined-parameters: TEST_GROUPS=tf-l3-boot-tests-ras
+                  property-file: tf-a-env.param
+                - name: tf-a-lts2.8-ci-gateway
+                  alias: tf-l3-boot-tests-misc
+                  current-parameters: true
+                  kill-phase-on: NEVER
+                  predefined-parameters: TEST_GROUPS=tf-l3-boot-tests-misc
+                  property-file: tf-a-env.param
+                - name: tf-a-lts2.8-ci-gateway
+                  alias: spm-l3-boot-tests
+                  current-parameters: true
+                  kill-phase-on: NEVER
+                  predefined-parameters: TEST_GROUPS=spm-l3-boot-tests
+                  property-file: tf-a-env.param
+                - name: tf-a-lts2.8-ci-gateway
+                  alias: tf-l1-boot-tests-plat
+                  current-parameters: true
+                  kill-phase-on: NEVER
+                  predefined-parameters: TEST_GROUPS=tf-l1-boot-tests-plat
+                  property-file: tf-a-env.param
+            - multijob:
+                name: Run doc build check
+                condition: COMPLETED
+                projects:
+                - name: tf-a-lts2.8-ci-gateway
+                  current-parameters: true
+                  kill-phase-on: NEVER
+                  predefined-parameters: TEST_GROUPS=tf-l1-check-docs
+                  property-file: tf-a-env.param
+            - multijob:
+                name: Generate visualizations
+                condition: COMPLETED
+                projects:
+#                  - name: tf-a-sloc-visualization
+#                    current-parameters: true
+#                    kill-phase-on: NEVER
+#                    property-file: tf-a-env.param
+#                  - name: tf-a-test-category-visualization
+#                    current-parameters: true
+#                    kill-phase-on: NEVER
+#                    property-file: tf-a-env.param
+                  - name: tf-a-test-result-visualization
+                    current-parameters: true
+                    kill-phase-on: NEVER
+                    predefined-parameters: TARGET_BUILD=${JOB_NAME}/${BUILD_NUMBER}
+                    property-file: tf-a-env.param
+            # Run the unstable TF-A Tests at the end but do not let their results
+            # participate in the job's success/failure.
+            - trigger-builds:
+                - project: tf-a-lts2.8-ci-gateway
+                  current-parameters: True
+                  property-file: tf-a-tests-env.param
+                  property-file-fail-on-missing: True
+                  predefined-parameters: TEST_GROUPS=tftf-unstable
+                  block: True
+                  block-thresholds:
+                    build-step-failure-threshold: never
+                    unstable-threshold: never
+                    failure-threshold: never
     publishers:
-        - email:
-            recipients: okash@google.com, bipin.ravi@arm.com, vwadekar@nvidia.com, joanna.farley@arm.com
+      - groovy-postbuild:
+          script: |
+            def currentBuild = Thread.currentThread().executable
+            def workspace = System.getenv('WORKSPACE') ?: '.'
+            def toBuildFile = new File("${workspace}/TO_BUILD")
+
+            if (!toBuildFile.exists()) {
+                currentBuild.setDescription("There are no new commits in the repositories, skip the build!")
+            }
+          on-failure: "nothing"
+      - email:
+          recipients: bipin.ravi@arm.com, vwadekar@nvidia.com, yann.gautier@st.com, palmer@google.com, govindraj.raja@arm.com