Skip to content

Merge branch 'Automattic:trunk' into trunk #1

Merge branch 'Automattic:trunk' into trunk

Merge branch 'Automattic:trunk' into trunk #1

Workflow file for this run

name: Lint and Test
on:
push:
branches: [trunk]
pull_request:
branches: [trunk]
workflow_dispatch:
jobs:
lint:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
steps:
- uses: actions/checkout@v3
- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
extensions: mbstring, intl, zip
coverage: none
- name: Install root dependencies
run: npm ci
- name: Install example dependencies
working-directory: examples/copyright-date-block-with-tests
run: npm ci
- name: Install Composer dependencies
run: composer install --prefer-dist --no-progress
- name: Run PHP linting
run: composer run lint
- name: Run JavaScript linting
run: npm run lint:js
- name: Run CSS linting
run: npm run lint:css
test:
needs: lint
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
steps:
- uses: actions/checkout@v3
- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
# Tests for specific examples
# Currently, tests exist only in the 'copyright-date-block-with-tests' example
- name: Install example dependencies
working-directory: examples/copyright-date-block-with-tests
run: npm ci
- name: Run unit tests
working-directory: examples/copyright-date-block-with-tests
run: npm run test:unit
- name: Install Playwright dependencies
working-directory: examples/copyright-date-block-with-tests
run: npx playwright install --with-deps
- name: Start WordPress
working-directory: examples/copyright-date-block-with-tests
run: npm run env:start
- name: Run E2E tests
working-directory: examples/copyright-date-block-with-tests
run: xvfb-run npm run test:e2e -- --reporter=list