-
Notifications
You must be signed in to change notification settings - Fork 13
39 lines (39 loc) Β· 1.57 KB
/
playwright-cron.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
name: Playwright Cron Tests
on:
workflow_dispatch:
schedule:
# every hour, 9-17:00, Mon - Fri
- cron: "0 9-17 * * 1-5"
jobs:
test:
timeout-minutes: 60
runs-on: ubuntu-latest
env:
PAYPAL_TEST_PASSWORD: ${{ secrets.PAYPAL_TEST_PASSWORD }}
GOOGLE_CHAT_WEB_HOOK: ${{ secrets.GOOGLE_CHAT_WEB_HOOK }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20.11.0
- name: Install dependencies
working-directory: ./support-e2e
run: yarn install
- name: Install Playwright Browsers
working-directory: ./support-e2e
run: yarn playwright install --with-deps
- name: Run Playwright tests
working-directory: ./support-e2e
run: yarn test-cron
- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: playwright-report
path: support-e2e/playwright-report/
retention-days: 30
- name: Notify on Failure
if: ${{ failure() }}
run: |
failedWorkflowRun="https://github.com/guardian/support-frontend/actions/runs/$GITHUB_RUN_ID"
prTrigger="https://github.com/guardian/support-frontend/pull/${{ github.event.number }}"
curl -X POST -H "Content-Type: application/json" "$GOOGLE_CHAT_WEB_HOOK" -d '{"text": "π¨ The Playwright cron tests for support-frontend have failed π¨\n\n- <'"$failedWorkflowRun"'|You can see the reason for this failure on GitHub>. \n\n π <https://github.com/guardian/support-frontend/wiki/Post-deployment-test-runbook|Check the runbook for a step by step guide>"}'