From 62c09ff15bf98542fdcd2ad6f838f4c49ee3a503 Mon Sep 17 00:00:00 2001 From: Akash Jain <15995028+akash-jain-10@users.noreply.github.com> Date: Fri, 12 Jan 2024 12:50:31 +0530 Subject: [PATCH] chore(ci): Update CRON for Cypress CI (#14686) * chore(ci): Update CRON for Cypress CI * chore(ci): Run MySQL only with Schedule or dispatch. * chore(ci): Add Pull Request Target Path * Update .github/workflows/cypress-integration-tests-postgresql.yml Co-authored-by: Chirag Madlani <12962843+chirag-madlani@users.noreply.github.com> --------- Co-authored-by: Chirag Madlani <12962843+chirag-madlani@users.noreply.github.com> --- .../cypress-integration-tests-mysql.yml | 45 ++----------------- .../cypress-integration-tests-postgresql.yml | 8 +++- 2 files changed, 10 insertions(+), 43 deletions(-) diff --git a/.github/workflows/cypress-integration-tests-mysql.yml b/.github/workflows/cypress-integration-tests-mysql.yml index 932f00214e6..d0b44cc98e6 100644 --- a/.github/workflows/cypress-integration-tests-mysql.yml +++ b/.github/workflows/cypress-integration-tests-mysql.yml @@ -17,16 +17,7 @@ name: MySQL Cypress Integration Tests on: workflow_dispatch: schedule: - - cron: '30 2 * * 1-5' - pull_request_target: - types: - - labeled - - opened - - synchronize - - reopened - - ready_for_review - paths-ignore: - - 'openmetadata-docs/**' + - cron: '30 2 * * 2,4' permissions: contents: read @@ -37,12 +28,7 @@ concurrency: jobs: cypress-ci-mysql: - if: | - github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' - || ( github.event_name == 'pull_request_target' - && contains(github.event.pull_request.labels.*.name, 'e2e') - && github.event.pull_request.draft == false - ) + if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' runs-on: ubuntu-latest strategy: fail-fast: false @@ -52,15 +38,9 @@ jobs: steps: - name: Set Project ID Environment variable id: cypress-project-id - run: | - if [ "${{ github.event_name }}" == "schedule" ]; then + run: | echo "PROJECT_ID=${{ secrets.CYPRESS_SCHEDULE_PROJECT_ID }}" >> $GITHUB_OUTPUT echo "CYPRESS_RECORD_KEY=${{ secrets.CYPRESS_SCHEDULE_RECORD_KEY }}" >> $GITHUB_OUTPUT - else - echo "PROJECT_ID=${{ secrets.CYPRESS_PR_PROJECT_ID }}" >> $GITHUB_OUTPUT - echo "CYPRESS_RECORD_KEY=${{ secrets.CYPRESS_PR_RECORD_KEY }}" >> $GITHUB_OUTPUT - fi - - name: Free Disk Space (Ubuntu) uses: jlumbroso/free-disk-space@main with: @@ -71,28 +51,9 @@ jobs: large-packages: false swap-storage: true docker-images: false - - name: Wait for the labeler - uses: lewagon/wait-on-check-action@v1.3.3 - if: ${{ github.event_name == 'pull_request_target' }} - with: - ref: ${{ github.event.pull_request.head.sha }} - check-name: Team Label - repo-token: ${{ secrets.GITHUB_TOKEN }} - wait-interval: 90 - - - name: Verify PR labels - uses: jesusvasquez333/verify-pr-label-action@v1.4.0 - if: ${{ github.event_name == 'pull_request_target' }} - with: - github-token: '${{ secrets.GITHUB_TOKEN }}' - valid-labels: 'safe to test' - pull-request-number: '${{ github.event.pull_request.number }}' - disable-reviews: true # To not auto approve changes - name: Checkout uses: actions/checkout@v3 - with: - ref: ${{ github.event.pull_request.head.sha }} - name: Cache Maven Dependencies id: cache-output diff --git a/.github/workflows/cypress-integration-tests-postgresql.yml b/.github/workflows/cypress-integration-tests-postgresql.yml index d9007d8a749..575b8764725 100644 --- a/.github/workflows/cypress-integration-tests-postgresql.yml +++ b/.github/workflows/cypress-integration-tests-postgresql.yml @@ -17,7 +17,7 @@ name: PostgreSQL Cypress Integration Tests on: workflow_dispatch: schedule: - - cron: '30 2 * * 1-5' + - cron: '30 2 * * 1,3,5' pull_request_target: types: - labeled @@ -25,6 +25,12 @@ on: - synchronize - reopened - ready_for_review + paths: + - openmetadata-spec/** + - openmetadata-ui/** + - openmetadata-service/** + - openmetadata-clients/** + - common/** paths-ignore: - 'openmetadata-docs/**'