Run the unit tests for the lowest and latest versions of wp/php #75
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: E2E Tests | |
# Only run the workflow for pull requests | |
on: pull_request | |
# Cancels all previous workflow runs for pull requests that have not completed. | |
concurrency: | |
# The concurrency group contains the workflow name and the branch name for pull requests | |
# or the commit hash for any other events. | |
group: ${{ github.workflow }}-${{ github.ref}} | |
cancel-in-progress: true | |
jobs: | |
e2e-tests-js: | |
name: WordPress E2E Tests | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: true | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up NodeJS | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 'lts/*' | |
cache: npm | |
- name: Install wordpress environment | |
run: npm -g install @wordpress/env | |
- name: Build the plugin | |
run: | | |
npm ci | |
- name: Install Playwright Browsers | |
run: npx playwright install chromium --with-deps | |
- name: Setup the wordpress environment | |
run: wp-env start | |
- name: Run Playwright tests | |
run: npx playwright test | |
- name: Upload playwright artifacts on failure | |
uses: actions/upload-artifact@v3 | |
if: failure() | |
with: | |
name: playwright-artifacts | |
path: artifacts/ |