Skip to content

Commit

Permalink
Run Playwright tests on all PR merged on main branch (#6991)
Browse files Browse the repository at this point in the history
* Run Playwright tests on all PR merged on main branch

* ✨

* Only run if no SQL migrations are required
  • Loading branch information
flvndvd authored Aug 29, 2024
1 parent 87cce11 commit 43f8112
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/deploy-and-test-front-qa.yml
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:
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 }}

0 comments on commit 43f8112

Please sign in to comment.