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>
This commit is contained in:
Akash Jain 2024-01-12 12:50:31 +05:30 committed by GitHub
parent dcbd6a842a
commit 62c09ff15b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 43 deletions

View File

@ -17,16 +17,7 @@ name: MySQL Cypress Integration Tests
on: on:
workflow_dispatch: workflow_dispatch:
schedule: schedule:
- cron: '30 2 * * 1-5' - cron: '30 2 * * 2,4'
pull_request_target:
types:
- labeled
- opened
- synchronize
- reopened
- ready_for_review
paths-ignore:
- 'openmetadata-docs/**'
permissions: permissions:
contents: read contents: read
@ -37,12 +28,7 @@ concurrency:
jobs: jobs:
cypress-ci-mysql: cypress-ci-mysql:
if: | if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
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
)
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy: strategy:
fail-fast: false fail-fast: false
@ -52,15 +38,9 @@ jobs:
steps: steps:
- name: Set Project ID Environment variable - name: Set Project ID Environment variable
id: cypress-project-id id: cypress-project-id
run: | run: |
if [ "${{ github.event_name }}" == "schedule" ]; then
echo "PROJECT_ID=${{ secrets.CYPRESS_SCHEDULE_PROJECT_ID }}" >> $GITHUB_OUTPUT echo "PROJECT_ID=${{ secrets.CYPRESS_SCHEDULE_PROJECT_ID }}" >> $GITHUB_OUTPUT
echo "CYPRESS_RECORD_KEY=${{ secrets.CYPRESS_SCHEDULE_RECORD_KEY }}" >> $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) - name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main uses: jlumbroso/free-disk-space@main
with: with:
@ -71,28 +51,9 @@ jobs:
large-packages: false large-packages: false
swap-storage: true swap-storage: true
docker-images: false 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 - name: Checkout
uses: actions/checkout@v3 uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Cache Maven Dependencies - name: Cache Maven Dependencies
id: cache-output id: cache-output

View File

@ -17,7 +17,7 @@ name: PostgreSQL Cypress Integration Tests
on: on:
workflow_dispatch: workflow_dispatch:
schedule: schedule:
- cron: '30 2 * * 1-5' - cron: '30 2 * * 1,3,5'
pull_request_target: pull_request_target:
types: types:
- labeled - labeled
@ -25,6 +25,12 @@ on:
- synchronize - synchronize
- reopened - reopened
- ready_for_review - ready_for_review
paths:
- openmetadata-spec/**
- openmetadata-ui/**
- openmetadata-service/**
- openmetadata-clients/**
- common/**
paths-ignore: paths-ignore:
- 'openmetadata-docs/**' - 'openmetadata-docs/**'