-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Run Playwright tests on all PR merged on main branch (#6991)
* Run Playwright tests on all PR merged on main branch * ✨ * Only run if no SQL migrations are required
- Loading branch information
Showing
1 changed file
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,12 @@ | ||
name: Deploy And test Front Qa | ||
|
||
on: | ||
pull_request: | ||
types: [closed] | ||
branches: | ||
- main | ||
paths-ignore: | ||
- "**.md" | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
|
@@ -14,6 +20,9 @@ jobs: | |
build-and-deploy: | ||
runs-on: ubuntu-latest | ||
|
||
# We skip running the build and deploy if the PR contains a migration represented by the 'migration-ack' label. | ||
if: ${{ !contains(github.event.pull_request.labels.*.name, 'migration-ack') }} | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
@@ -53,7 +62,12 @@ jobs: | |
|
||
run-playwright-tests: | ||
needs: build-and-deploy | ||
|
||
runs-on: ubuntu-latest | ||
|
||
# We skip running the build and deploy if the PR contains a migration represented by the 'migration-ack' label. | ||
if: ${{ !contains(github.event.pull_request.labels.*.name, 'migration-ack') }} | ||
|
||
steps: | ||
- name: Run Playwright Tests | ||
id: trigger-tests | ||
|
@@ -116,3 +130,28 @@ jobs: | |
echo "Timeout: Playwright tests did not complete within 45 minutes" | ||
exit 1 | ||
- name: Post Failure Message to Slack | ||
id: slack-notification | ||
if: failure() | ||
uses: slackapi/[email protected] | ||
with: | ||
payload: | | ||
{ | ||
"text": "⚠️ Playwright tests failed! Commit: ${{ github.sha }} | PR merged by @${{ github.event.pull_request.user.login }} into main. Title: ${{ github.event.pull_request.title }} | Check ID: $CHECK_ID", | ||
"attachments": [ | ||
{ | ||
"text": "View Report", | ||
"actions": [ | ||
{ | ||
"type": "button", | ||
"text": "View Report", | ||
"url": "$PLAYWRIGHT_REPORT_URL" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
env: | ||
PLAYWRIGHT_REPORT_URL: ${{ secrets.PLAYWRIGHT_REPORT_BASE_URL }}/${{ env.CHECK_ID }}/playwright-report/index.html | ||
SLACK_WEBHOOK_URL: ${{ secrets.PLAYWRIGHT_TESTS_SLACK_WEBHOOK_URL }} |