For PHP8+: Remove deprecated stylelint rule and rename PHPCS rule #129
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
# @Author: Roni Laukkarinen | |
# @Date: 2023-02-15 17:39:37 | |
# @Last Modified by: Roni Laukkarinen | |
# @Last Modified time: 2023-05-18 17:26:05 | |
name: PHP | |
on: [push, pull_request] | |
env: | |
PHPCOMPAT_DIR: /tmp/phpcompatibility | |
SNIFFS_DIR: /tmp/sniffs | |
WPCS_DIR: /tmp/wpcs | |
jobs: | |
build: | |
name: Test php | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout the repository | |
uses: actions/checkout@v3 | |
- name: Setup PHP with Xdebug 2.x | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: '8.2' | |
coverage: xdebug2 | |
- name: Set up PHPCS and WordPress-Coding-Standards | |
run: | | |
composer global require --dev dealerdirect/phpcodesniffer-composer-installer | |
composer global config allow-plugins.dealerdirect/phpcodesniffer-composer-installer true | |
composer global require --dev phpcsstandards/phpcsextra:"^1.1.0" | |
composer global require phpcsstandards/phpcsutils:"^1.0" | |
composer global require --dev wp-coding-standards/wpcs:"^3.0" | |
git clone -b master --depth 1 https://github.com/wimg/PHPCompatibility.git $PHPCOMPAT_DIR | |
- name: Run PHPCS | |
run: | | |
phpcs -p . --ignore=node_modules,*/css/*,*/sass/* --standard=phpcs.xml | |
- name: Test PHP for syntax errors | |
run: find -L . -name '*.php' -print0 | xargs -0 -n 1 -P 4 php -l |