Skip to content

Merge pull request #86 from woocommerce/add-nvm-and-autobranching #20

Merge pull request #86 from woocommerce/add-nvm-and-autobranching

Merge pull request #86 from woocommerce/add-nvm-and-autobranching #20

name: PHP Coding Standards
on:
push:
branches:
- "trunk"
paths:
- "**.php"
- .github/workflows/php-coding-standards.yml
pull_request:
paths:
- "**.php"
- .github/workflows/php-coding-standards.yml
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
phpcs:
name: PHP coding standards
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Prepare PHP
uses: woocommerce/grow/prepare-php@actions-v2
with:
php-version: 7.4
tools: cs2pr
install-deps: "no"
- name: Install Composer dependencies
run: |
# Skip installing packages from private repos.
composer remove --dev woocommerce/woorelease
composer install --prefer-dist --no-interaction
- name: Log PHPCS information
run: vendor/bin/phpcs -i
- name: Run PHPCS on all files
run: vendor/bin/phpcs -q --report=checkstyle | cs2pr