-
Notifications
You must be signed in to change notification settings - Fork 21
76 lines (64 loc) · 2.11 KB
/
e2e-tests.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
name: E2E Tests
on:
push:
branches:
- "release/**"
pull_request:
branches:
- "release/**"
workflow_dispatch:
inputs:
wp-rc-version:
description: 'WordPress version for Release Candidate (ex. 6.3-RC3)'
wc-rc-version:
description: 'WooCommerce version for Release Candidate (ex. 8.0.0-rc.1)'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
E2ETests:
name: E2E Tests
runs-on: ubuntu-latest
env:
FORCE_COLOR: 2
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Prepare PHP
uses: woocommerce/grow/prepare-php@actions-v1
with:
install-deps: "no"
- name: Prepare node
uses: woocommerce/grow/prepare-node@actions-v1
with:
node-version-file: ".nvmrc"
ignore-scripts: "no"
- name: Build production bundle
run: |
echo "::group::Build log"
npm run build
echo "::endgroup::"
- name: Start wp-env container
run: npm run wp-env:up
- name: Install WP release candidate (optional)
if: github.event.inputs.wp-rc-version != ''
run: |
npm run -- wp-env run tests-cli -- wp core update --version=${{ github.event.inputs.wp-rc-version }}
npm run -- wp-env run tests-cli -- wp core update-db
- name: Install WC release candidate (optional)
if: github.event.inputs.wc-rc-version != ''
run: |
npm run -- wp-env run tests-cli -- wp plugin update woocommerce --version=${{ github.event.inputs.wc-rc-version }}
npm run -- wp-env run tests-cli -- wp wc update
- name: Download and install Chromium browser.
run: npx playwright install chromium
- name: Run tests
run: npm run test:e2e
- name: Archive e2e failure screenshots
if: ${{ always() }}
uses: actions/upload-artifact@v3
with:
name: e2e-screenshots
path: tests/e2e/test-results/report/**/*.png
if-no-files-found: ignore
retention-days: 5