NEW e2e environment using playground cli #230
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 | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
pull_request: | |
paths: | |
- '.github/workflows/e2e-tests.yml' | |
- 'build/**' | |
- 'includes/**' | |
- 'src/**' | |
- 'test/e2e/**' | |
- '*.php' | |
- 'package.*' | |
# 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.event_name == 'pull_request' && github.head_ref || github.sha }} | |
cancel-in-progress: true | |
jobs: | |
e2e-tests: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
# matrix: | |
# node: ['14'] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- uses: actions/cache@v4 | |
id: playwright-cache | |
with: | |
path: | | |
~/.cache/ms-playwright | |
key: ${{ runner.os }}-playwright-${{ hashFiles('**/package-lock.json') }} | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: '.nvmrc' | |
# Enable built-in functionality for caching and restoring dependencies, which is disabled by default. | |
# The actions/setup-node uses actions/cache under the hood. | |
# https://github.com/actions/setup-node#caching-global-packages-data | |
cache: 'npm' | |
# Restoring the short lived node_modules cache | |
# to be used accross all workflows running on the last commit. | |
# https://github.com/actions/cache/blob/main/caching-strategies.md#creating-a-short-lived-cache | |
- uses: actions/cache/restore@v4 | |
id: node_modules-cache | |
with: | |
path: | | |
./node_modules | |
key: ${{ runner.os }}-node_modules-${{ github.sha }}-${{ hashFiles('package-lock.json') }} | |
- name: NPM install | |
if: steps.node_modules-cache.outputs.cache-hit != 'true' | |
run: npm ci --legacy-peer-deps | |
# Creating a short lived node_modules cache | |
- uses: actions/cache/save@v4 | |
if: steps.node_modules-cache.outputs.cache-hit != 'true' | |
with: | |
path: | | |
./node_modules | |
key: ${{ steps.node_modules-cache.outputs.cache-primary-key }} | |
- name: Install Playwright dependencies | |
run: npx playwright install --with-deps | |
if: steps.playwright-cache.outputs.cache-hit != 'true' | |
- run: npx playwright install-deps | |
if: steps.playwright-cache.outputs.cache-hit == 'true' | |
- name: Starting Playwright & Running the tests | |
run: | | |
npm run test:e2e | |
- name: Retain failed test results | |
uses: actions/upload-artifact@v4 | |
if: failure() | |
with: | |
name: test-results-matrix-less-debugging | |
path: artifacts/test-results/ |