2023-04-17 12:01:41 +00:00
|
|
|
name: Playwright Tests
|
|
|
|
on:
|
|
|
|
push:
|
2023-04-21 11:07:37 +00:00
|
|
|
branches: [ trunk ]
|
2023-04-17 12:01:41 +00:00
|
|
|
pull_request:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
PlaywrightE2ETests:
|
2023-05-05 11:03:36 +00:00
|
|
|
|
2023-04-17 12:01:41 +00:00
|
|
|
name: Playwright E2E tests
|
|
|
|
timeout-minutes: 60
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-04-21 11:07:37 +00:00
|
|
|
- uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- name: Setup node version and npm cache
|
|
|
|
uses: actions/setup-node@v3
|
|
|
|
with:
|
|
|
|
node-version-file: '.nvmrc'
|
|
|
|
cache: 'npm'
|
|
|
|
|
|
|
|
- name: Install Node dependencies
|
2023-05-05 11:03:36 +00:00
|
|
|
run: npm ci
|
2023-04-21 11:07:37 +00:00
|
|
|
|
2023-05-05 11:03:36 +00:00
|
|
|
- name: Build Assets
|
|
|
|
run: FORCE_REDUCED_MOTION=true npm run build
|
2023-04-21 11:07:37 +00:00
|
|
|
|
2023-05-05 11:03:36 +00:00
|
|
|
- name: blocks.ini setup
|
|
|
|
run: |
|
|
|
|
echo -e 'woocommerce_blocks_phase = 3\nwoocommerce_blocks_env = tests' > blocks.ini
|
|
|
|
- name: Get Composer Cache Directory
|
|
|
|
id: composer-cache
|
2023-04-21 11:07:37 +00:00
|
|
|
run: |
|
2023-05-05 11:03:36 +00:00
|
|
|
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
|
|
|
- uses: actions/cache@v3
|
|
|
|
with:
|
|
|
|
path: ${{ steps.composer-cache.outputs.dir }}
|
|
|
|
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
|
|
|
|
restore-keys: ${{ runner.os }}-composer-
|
2023-04-21 11:07:37 +00:00
|
|
|
|
2023-05-05 11:03:36 +00:00
|
|
|
- name: Set up PHP
|
|
|
|
uses: shivammathur/setup-php@v2
|
|
|
|
with:
|
|
|
|
php-version: '8.0'
|
|
|
|
coverage: none
|
|
|
|
tools: composer
|
|
|
|
|
|
|
|
- name: Composer install
|
|
|
|
run: composer install
|
|
|
|
|
|
|
|
- name: Install Playwright
|
2023-04-21 11:07:37 +00:00
|
|
|
run: npx playwright install --with-deps
|
|
|
|
|
2023-05-05 11:03:36 +00:00
|
|
|
|
|
|
|
- name: Load wp-env
|
|
|
|
run: npm run env:start
|
|
|
|
|
2023-04-21 11:07:37 +00:00
|
|
|
- name: Run Playwright tests
|
2023-05-05 11:03:36 +00:00
|
|
|
run: npm run test:e2e-pw
|
|
|
|
|
2023-07-28 14:04:19 +00:00
|
|
|
- uses: actions/upload-artifact@v3.1.2
|
2023-04-21 11:07:37 +00:00
|
|
|
with:
|
|
|
|
name: playwright-report
|
2023-06-01 11:51:59 +00:00
|
|
|
path: playwright-report
|