-
Notifications
You must be signed in to change notification settings - Fork 220
77 lines (73 loc) · 2.73 KB
/
e2e_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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: Monitor Cron e2e Tests
on:
schedule:
- cron: '0 8 * * *'
workflow_dispatch:
inputs:
environment:
description: 'Environment to run the e2e against'
required: false
default: 'stage'
type: choice
options:
- stage
- prod
- heroku
jobs:
e2e-tests:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22.2
- name: Install dependencies
run: npm ci
- name: Copy env var
run: cp .env-dist .env
- name: Store Playwright's Version
run: |
# The regular expression matches everything containing
# `<number>.<number>.<number>`, and returns only that bit:
PLAYWRIGHT_VERSION=$(npm ls @playwright/test | grep @playwright | sed --regexp-extended 's/.*([0-9]+\.[0-9]+\.[0-9]+).*/\1/') | head -1
echo "Playwright's Version: $PLAYWRIGHT_VERSION"
echo "PLAYWRIGHT_VERSION=$PLAYWRIGHT_VERSION" >> $GITHUB_ENV
- name: Cache Playwright Browsers for Playwright's Version
id: cache-playwright-browsers
uses: actions/cache@v4
with:
path: ~/.cache/ms-playwright
key: playwright-browsers-${{ env.PLAYWRIGHT_VERSION }}
- name: Setup Playwright Browser
if: steps.cache-playwright-browsers.outputs.cache-hit != 'true'
run: npx playwright install --with-deps
- name: Run Playwright tests - ${{ inputs.environment != null && inputs.environment || 'stage' }}
if: github.actor != 'dependabot[bot]'
run: npm run e2e
timeout-minutes: 20
env:
E2E_TEST_ENV: ${{ inputs.environment != null && inputs.environment || 'stage' }}
E2E_TEST_BASE_URL: ${{ secrets.E2E_TEST_BASE_URL }}
E2E_TEST_ACCOUNT_EMAIL: ${{ secrets.E2E_TEST_ACCOUNT_EMAIL }}
E2E_TEST_ACCOUNT_PASSWORD: ${{ secrets.E2E_TEST_ACCOUNT_PASSWORD }}
ADMINS: ${{ secrets.ADMINS }}
FXA_ENABLED: true
OAUTH_CLIENT_SECRET: ${{ secrets.OAUTH_CLIENT_SECRET }}
ONEREP_API_KEY: ${{ secrets.ONEREP_API_KEY }}
NEXTAUTH_SECRET: ${{ secrets.NEXTAUTH_SECRET }}
NEXTAUTH_URL: ${{ secrets.NEXTAUTH_URL }}
HIBP_KANON_API_TOKEN: ${{ secrets.HIBP_KANON_API_TOKEN }}
HIBP_API_TOKEN: ${{ secrets.HIBP_API_TOKEN }}
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30
- uses: actions/upload-artifact@v4
if: always()
with:
name: test-results
path: src/e2e/test-results/
retention-days: 30