Update README.md #81
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: Code Quality | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
phpcs: | |
name: PHPCS check | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: '8.2' | |
ini-values: 'memory_limit=1G' | |
coverage: none | |
tools: cs2pr | |
- name: Get Composer Cache Directory | |
id: composer-cache | |
run: echo "::set-output name=dir::$(composer config cache-files-dir)" | |
- name: Configure Composer cache | |
uses: actions/cache@v4 | |
with: | |
path: ${{ steps.composer-cache.outputs.dir }} | |
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | |
restore-keys: | | |
${{ runner.os }}-composer- | |
- name: Install Composer dependencies | |
uses: ramsey/composer-install@v2 | |
with: | |
custom-cache-suffix: $(date -u "+%Y-%m") | |
- name: Validate composer.json | |
run: composer --no-interaction validate --no-check-all | |
- name: Detect coding standard violations (PHPCS) | |
run: vendor/bin/phpcs --report-full --report-checkstyle=./phpcs-report.txt | |
- name: Upload PHPCS report | |
uses: actions/upload-artifact@v2 | |
with: | |
name: phpcs-report | |
path: phpcs-report.txt | |
stylelint: | |
name: 'Lint: CSS' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20.12.2' | |
cache: 'npm' | |
- name: Unset npm_config_prefix | |
run: unset npm_config_prefix | |
- name: Check Node version | |
run: node -v | |
- name: Install Node dependencies | |
run: npm ci | |
env: | |
CI: true | |
- name: Lint Stylesheets | |
run: npm run lint:css | |
eslint: | |
name: 'Lint: JS' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20.12.2' | |
cache: 'npm' | |
- name: Unset npm_config_prefix | |
run: unset npm_config_prefix | |
- name: Check Node version | |
run: node -v | |
- name: Install Node dependencies | |
run: npm ci | |
env: | |
CI: true | |
- name: Lint JavaScript | |
run: npm run lint:js |