Build(deps-dev): bump @wordpress/scripts from 26.10.0 to 26.11.0 #184
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: Lint and Test | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
jobs: | |
lint-js: | |
name: JS Lints | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 15 | |
cache: npm | |
- name: Install dependencies | |
run: npm ci | |
- name: Lint JS | |
run: npm run lint:js | |
- name: Lint CSS | |
run: npm run lint:css | |
lint-php: | |
name: PHP Lints | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: '7.4' | |
coverage: none | |
tools: composer, cs2pr | |
- name: Get Composer cache directory | |
id: composer-cache | |
run: echo "::set-output name=dir::$(composer config cache-files-dir)" | |
- name: Setup Composer cache | |
uses: pat-s/always-upload-cache@v3.0.11 | |
with: | |
path: ${{ steps.composer-cache.outputs.dir }} | |
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | |
restore-keys: | | |
${{ runner.os }}-composer- | |
${{ runner.os }}- | |
- name: Validate composer.json | |
run: composer validate --no-check-all --strict | |
- name: Install dependencies | |
run: composer install | |
- name: Lint PHP | |
run: composer lint | |
unit: | |
name: 'PHP ${{ matrix.php }} - WP ${{ matrix.wp }}' | |
runs-on: ubuntu-latest | |
services: | |
mysql: | |
image: mariadb:latest | |
env: | |
MARIADB_ALLOW_EMPTY_ROOT_PASSWORD: true | |
MARIADB_DATABASE: wordpress_test | |
MARIADB_MYSQL_LOCALHOST_USER: 1 | |
MARIADB_MYSQL_LOCALHOST_GRANTS: USAGE | |
ports: | |
- 3306 | |
options: --health-cmd="healthcheck.sh --su-mysql --connect --innodb_initialized" --health-interval=10s --health-timeout=5s --health-retries=3 | |
continue-on-error: ${{ matrix.experimental }} | |
strategy: | |
matrix: | |
php: ['7.0'] | |
wp: ['latest'] | |
coverage: [false] | |
experimental: [false] | |
include: | |
- php: '7.4' | |
wp: 'latest' | |
coverage: true | |
experimental: false | |
- php: '7.4' | |
wp: 'trunk' | |
experimental: true | |
- php: '8.0' | |
wp: 'latest' | |
experimental: true | |
- php: '8.1' | |
wp: 'trunk' | |
experimental: true | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Get Composer cache directory | |
id: composer-cache | |
run: echo "::set-output name=dir::$(composer config cache-files-dir)" | |
- name: Setup Composer cache | |
uses: pat-s/always-upload-cache@v3.0.11 | |
with: | |
path: ${{ steps.composer-cache.outputs.dir }} | |
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | |
restore-keys: | | |
${{ runner.os }}-composer- | |
${{ runner.os }}- | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php }} | |
extensions: mysql | |
coverage: xdebug | |
tools: composer, cs2pr | |
- name: Shutdown default MySQL service | |
run: sudo service mysql stop | |
- name: Verify MariaDB connection | |
run: | | |
while ! mysqladmin ping -h"127.0.0.1" -P"${{ job.services.mysql.ports[3306] }}" --silent; do | |
sleep 1 | |
done | |
- name: Set up tests | |
run: bash bin/install-wp-tests.sh wordpress_test root '' 127.0.0.1:${{ job.services.mysql.ports['3306'] }} ${{ matrix.wp }} true | |
- name: Install PHP dependencies | |
uses: 'ramsey/composer-install@v2' | |
with: | |
composer-options: '--prefer-dist --no-progress --no-interaction --no-scripts' | |
# Installs PHPUnit 9.5+ for tests against trunk and PHPUnit 7.5.x for older versions, | |
# because WordPress 5.8 and below don't support newer PHPUnit versions. | |
# PHPUnit 7.5 does support PHP 7.0 though, so we don't run an update there. | |
- name: Update PHPUnit | |
run: | | |
if [[ $WP_VERSION == "trunk" ]]; then | |
composer update --ignore-platform-reqs --no-interaction --no-scripts yoast/phpunit-polyfills --with-dependencies | |
elif [[ $PHP_VERSION != "7.0" ]] && [[ $PHP_VERSION != "5.6" ]]; then | |
composer require --ignore-platform-reqs --no-interaction --no-scripts phpunit/phpunit:^7.5 --with-dependencies | |
fi | |
env: | |
WP_VERSION: ${{ matrix.wp }} | |
PHP_VERSION: ${{ matrix.php }} | |
- name: Run tests | |
run: | | |
composer test | |
composer test:multisite | |
if: ${{ ! matrix.coverage }} | |
- name: Run tests with coverage | |
run: | | |
composer test -- --coverage-clover coverage.xml | |
composer test:multisite -- --coverage-clover coverage-multisite.xml | |
if: ${{ matrix.coverage }} | |
- name: Upload code coverage report | |
uses: codecov/codecov-action@v3.1.4 | |
with: | |
file: coverage.xml | |
flags: default | |
if: ${{ matrix.coverage }} | |
- name: Upload code coverage report | |
uses: codecov/codecov-action@v3.1.4 | |
with: | |
file: coverage-multisite.xml | |
flags: multisite | |
if: ${{ matrix.coverage }} |