Repository navigation
68 lines (55 loc) · 1.87 KB
/
Copy pathreusable-e2e.yml
File metadata and controls
68 lines (55 loc) · 1.87 KB
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: Run E2E Tests
on:
workflow_call:
inputs:
php-version:
description: 'PHP version to use'
required: true
type: string
permissions: {}
jobs:
e2e:
name: Playwright E2E Tests
runs-on: ubuntu-24.04
timeout-minutes: 20
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}
persist-credentials: false
- name: Set up PHP
uses: shivammathur/setup-php@eb7c497e18156a6bbabfef1d3a82760b9eda3962 # v2.40.0
with:
php-version: ${{ inputs.php-version }}
coverage: none
- name: Install Composer dependencies
uses: ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda # v4.0.0
- name: Setup Node.js
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
with:
node-version-file: '.nvmrc'
cache: 'npm'
- name: Install npm dependencies
run: npm ci
- name: Build development assets
run: npm run build:dev
- name: Install Playwright dependencies
run: |
npx playwright install chromium firefox webkit --with-deps
- name: Start the Docker testing environment
uses: nick-fields/retry@ad984534de44a9489a53aefd81eb77f87c70dc60 # v4.0.0
with:
timeout_minutes: 10
max_attempts: 3
command: npm run wp-env:test start
- name: Run E2E tests
run: npm run test:e2e
- name: Upload E2E test results as artifact
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
if: always()
with:
name: playwright-report
path: tests/_output
retention-days: 2
if-no-files-found: ignore