mirror of
https://gh.wpcy.net/https://github.com/oblakstudio/wp-plugin-installer.git
synced 2026-07-14 18:36:23 +08:00
33 lines
970 B
YAML
33 lines
970 B
YAML
name: "Validate PHP Code Standards"
|
|
on:
|
|
pull_request:
|
|
paths:
|
|
- "**.php"
|
|
- "phpcs.xml"
|
|
- ".github/workflows/phpcs.yml"
|
|
jobs:
|
|
phpcs:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout repo
|
|
uses: actions/checkout@v4.1.1
|
|
with:
|
|
fetch-depth: 0 # important!
|
|
- name: Cache Composer dependencies
|
|
uses: actions/cache@v3.3.1
|
|
with:
|
|
path: /tmp/composer-cache
|
|
key: ${{ runner.os }}-${{ hashFiles('**/composer.lock') }}
|
|
- name: Install composer dependencies
|
|
uses: php-actions/composer@v6
|
|
with:
|
|
php_version: 7.3
|
|
version: 2
|
|
dev: yes
|
|
quiet: yes
|
|
args: --optimize-autoloader --classmap-authoritative --prefer-dist
|
|
- uses: tinovyatkin/action-php-codesniffer@v1
|
|
with:
|
|
files: "**.php" # you may customize glob as needed
|
|
phpcs_path: ./vendor/bin/phpcs
|
|
standard: "phpcs.xml"
|