-
Notifications
You must be signed in to change notification settings - Fork 15
68 lines (56 loc) · 1.81 KB
/
e2e.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: E2E Tests
on:
push:
branches:
- 'master'
- 'release/**'
paths-ignore:
- '**.md'
- '**.txt'
pull_request:
branches:
- 'master'
env:
DB_DATABASE: wordpress_test
DB_USER: root
DB_PASSWORD: ''
jobs:
e2e:
name: 'WP ${{ matrix.core.name }} on PHP ${{ matrix.php }}'
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
php:
- '7.4'
- '8.2'
core:
- {name: 'tested', version: 'null'}
- {name: 'minimum', version: 'WordPress/WordPress#5.6'}
- {name: 'trunk', version: 'WordPress/WordPress#master'}
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/build-plugin
- name: Overwrite PHP versions & core for wp-env
if: matrix.core.version != 'null'
run: jq '. + {"phpVersion":"${{ matrix.php }}","core":"${{ matrix.core.version }}"}' tests/cypress/wordpress-files/e2e-override.json > .wp-env.override.json
- name: setup wp env
run: npm run env:start
- name: Overwrite PHP version for wp-env
if: matrix.core.version == 'null'
run: jq '. + {"phpVersion":"${{ matrix.php }}"}' tests/cypress/wordpress-files/e2e-override.json > .wp-env.override.json
- name: setup wp env
run: npm run env:start
- name: install test data for e2e test
run: npm run cypress:setup
- name: Cypress run
uses: cypress-io/github-action@v6
with:
install: false
config-file: tests/cypress/cypress.config.js
- name: Upload Cypress screenshots
if: ${{ always() }}
uses: actions/upload-artifact@v3
with:
name: cypress-screenshots-${{ matrix.php }}_${{ matrix.core.name }}
path: ${{ github.workspace }}/tests/cypress/screenshots/