This repository has been archived by the owner on Nov 7, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 36
68 lines (66 loc) · 2.09 KB
/
e2e_pr_test.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
name: Playwright Test
on:
# [deployment_status]
workflow_dispatch:
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
env:
YARN_CHECKSUM_BEHAVIOR: update
jobs:
matrix:
runs-on: ubuntu-latest
outputs:
module: ${{ steps.matrix.outputs.MODULE }}
steps:
- name: Checkout the codebase
uses: actions/checkout@v3
- name: Setup NodeJS
uses: actions/setup-node@v3
with:
node-version: 18
cache: yarn
- name: Run yarn install
run: yarn install --immutable
- name: Set Matrix
id: matrix
run: |
yarn e2e-testing module
echo "::set-output name=MODULE::$(cat tools/e2e-testing/MODULE)"
playwright:
name: Playwright Test
if: github.event.deployment_status.state == 'success' && (github.event.deployment_status.environment == 'pr_preview' || github.event.deployment_status.environment == 'trunk')
needs: matrix
runs-on: ubuntu-latest
continue-on-error: true
timeout-minutes: 60
strategy:
matrix:
browser: ['chromium', 'firefox']
module: ${{ fromJson(needs.matrix.outputs.module) }}
fail-fast: false
steps:
- name: Checkout the codebase
uses: actions/checkout@v3
- name: Setup NodeJS
uses: actions/setup-node@v3
with:
node-version: 18
cache: yarn
- name: Run yarn install
run: yarn install --immutable
- name: Install Playwright
run: yarn e2e-testing install-deps ${{ matrix.browser }}
- name: Run Playwright tests
run: yarn e2e-testing parallel --module=${{ matrix.module }} --project=${{ matrix.browser }}
env:
NODE_OPTIONS: '--max-old-space-size=5950'
PLAYWRIGHT_BASE_URL: ${{ github.event.deployment_status.environment_url }}
- name: Upload Playwright traces (when failed)
if: failure()
uses: actions/upload-artifact@v3
with:
name: playwright-test-results
if-no-files-found: ignore
retention-days: 2
path: tools/e2e-testing/test-results/