Skip to content

Add NPM workspaces, build using out of the box wp-scripts #698

Add NPM workspaces, build using out of the box wp-scripts

Add NPM workspaces, build using out of the box wp-scripts #698

Workflow file for this run

name: PHP CodeSniffer
on:
push:
branches: [main, stage, develop]
pull_request:
branches: [main, stage, develop]
paths:
- '**.php'
- 'composer.lock'
- '**.json'
- '**.yml'
# Cancels all previous workflow runs for pull requests that have not completed.
concurrency:
# The concurrency group contains the workflow name and the branch name for pull requests
# or the commit hash for any other events.
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
cancel-in-progress: true
jobs:
phpcs:
name: PHP coding standards
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Get Composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Set up Composer caching
uses: actions/cache@v3
env:
cache-name: cache-composer-dependencies
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
coverage: none
tools: composer, cs2pr
- name: Log debug information
run: |
php --version
composer --version
- name: Install Composer dependencies
env:
COMPOSER_AUTH: ${{ secrets.COMPOSER_AUTH }}
run: |
composer install --prefer-dist --no-suggest --no-progress --no-ansi --no-interaction
echo "vendor/bin" >> $GITHUB_PATH
- name: Log PHPCS debug information
run: vendor/bin/phpcs -i
- name: Run PHPCS on all files
run: vendor/bin/phpcs . -q -n --report=checkstyle | cs2pr