Add E2E support #24
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: Test e2e | |
on: | |
pull_request: | |
types: [opened, synchronize, ready_for_review] | |
branches-ignore: | |
- "update_dependencies" | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
e2e: | |
if: github.event.pull_request.draft == false && github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name | |
name: Playwright E2E tests | |
strategy: | |
fail-fast: false | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Setup PHP version | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: "7.4" | |
extensions: simplexml | |
- name: Check out source files | |
uses: actions/checkout@v4 | |
- name: Install composer deps | |
run: composer install --no-dev --prefer-dist --no-progress --no-suggest | |
- name: Install npm deps | |
run: | | |
npm ci | |
npm install -g playwright-cli | |
npx playwright install --with-deps chromium | |
- name: Install environment | |
run: | | |
cp ./bin/themeisle-sdk.php ./ | |
npm run wp-env start | |
- name: Run the tests | |
run: | | |
npm run test:e2e:playwright | |
env: | |
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }} | |
- name: Archive test results | |
if: failure() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: e2e-playwright-results | |
path: artifacts | |
retention-days: 1 | |
if-no-files-found: ignore |