Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 17 additions & 6 deletions e2e/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@ inputs:
required: false
type: string
default: 'no-external-cache-key'
wp-env-config-path:
description: Path to a custom wp-env config file passed to wp-env --config. Default is '' (wp-env default discovery).
required: false
type: string
default: ''
playwright-cmd:
description: CLI command to run playwright tests. Default is 'npm run test:e2e'.
required: false
type: string
default: 'npm run test:e2e'

runs:
using: 'composite'
Expand Down Expand Up @@ -95,10 +105,12 @@ runs:

- name: Install WordPress and start the server
run: |
npm run wp-env start
if [ -n "${{ inputs.wp-env-config-path }}" ]; then
npm run wp-env start -- --config="${{ inputs.wp-env-config-path }}"
else
npm run wp-env start
fi
shell: bash
env:
WP_ENV_PHP_VERSION: '8.0'

- name: Save Docker image to cache
if: steps.docker-cache.outputs.cache-hit != 'true'
Expand All @@ -107,9 +119,8 @@ runs:
docker save $(docker images --format '{{.Repository}}:{{.Tag}}') -o wp-env-image.tar
shell: bash

- name: Run Playwright tests
run: |
npm run test:e2e
- name: Run Playwright tests with WordPress ${{ env.WP_VERSION }}
run: ${{ inputs.playwright-cmd }}
shell: bash

- name: Upload Playwright report
Expand Down