From 88eaa666cd97eb0d36d98eeb8e6053b42a20db94 Mon Sep 17 00:00:00 2001 From: Saroj <43822041+sarojsarab@users.noreply.github.com> Date: Tue, 9 Jan 2024 16:22:38 +0530 Subject: [PATCH] ci: Schedule TBP workflow to run 4 times a day with 3hrs interval (#30081) ## Description - Scheduled TBP workflow to run 4 times a day with 3hrs interval - Made changes in TBP workflow to run all the steps only while running with schedule or manual workflow trigger - Added condition to run ci-test and ci-test-result only during schedule or manual workflow run. #### Type of change - Workflow changes ## Testing > #### How Has This Been Tested? - [x] CI Run > > ## Summary by CodeRabbit - **Chores** - Updated the workflow schedule for Docker image build tests to run at new times: 7:00 AM, 10:00 AM, 1:00 PM, and 4:00 PM IST on weekdays. - Modified conditional triggers in the CI pipeline to exclude jobs from running on push events. --- .github/workflows/test-build-docker-image.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-build-docker-image.yml b/.github/workflows/test-build-docker-image.yml index f0c261efa2..c93b10b3d8 100644 --- a/.github/workflows/test-build-docker-image.yml +++ b/.github/workflows/test-build-docker-image.yml @@ -1,9 +1,9 @@ name: Test, build and push Docker Image on: - # This workflow will run everyday at 06:00 AM IST (12:30 AM UTC) on weekdays + # This workflow will run everyday at 7:00AM, 10:00AM, 1:00PM, 4:00PM IST on weekdays schedule: - - cron: "30 00 * * 1-5" + - cron: "30 1-12/3 * * 1-5" # This line enables manual triggering of this workflow. workflow_dispatch: inputs: @@ -86,7 +86,7 @@ jobs: ci-test: needs: [setup, build-docker-image] # Only run if the build step is successful - if: success() + if: success() && ( github.event_name != 'push' || github.ref == 'refs/heads/master' ) name: ci-test uses: ./.github/workflows/ci-test-custom-script.yml secrets: inherit @@ -98,6 +98,7 @@ jobs: server-unit-tests: name: server-unit-tests needs: [build-docker-image] + if: success() && ( github.event_name != 'push' || github.ref == 'refs/heads/master' ) uses: ./.github/workflows/server-build.yml secrets: inherit with: @@ -107,6 +108,7 @@ jobs: client-unit-tests: name: client-unit-tests needs: [build-docker-image] + if: success() && ( github.event_name != 'push' || github.ref == 'refs/heads/master' ) uses: ./.github/workflows/client-unit-tests.yml secrets: inherit with: @@ -116,8 +118,8 @@ jobs: needs: [ci-test, client-unit-tests, server-unit-tests] if: always() && (github.event_name == 'workflow_dispatch' || - github.event_name == 'push' || github.event_name == 'schedule' || + ( github.event_name != 'push' || github.ref == 'refs/heads/master' ) || (github.event_name == 'pull_request_review' && github.event.review.state == 'approved' && github.event.pull_request.head.repo.full_name == github.repository))