Skip to content

Commit

Permalink
chore(ci): Update CRON for Cypress CI (#14686)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
akash-jain-10 and chirag-madlani authored Jan 12, 2024
1 parent dcbd6a8 commit 62c09ff
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 43 deletions.
45 changes: 3 additions & 42 deletions .github/workflows/cypress-integration-tests-mysql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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:
Expand All @@ -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
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/cypress-integration-tests-postgresql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,20 @@ 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
- opened
- synchronize
- reopened
- ready_for_review
paths:
- openmetadata-spec/**
- openmetadata-ui/**
- openmetadata-service/**
- openmetadata-clients/**
- common/**
paths-ignore:
- 'openmetadata-docs/**'

Expand Down

0 comments on commit 62c09ff

Please sign in to comment.