Skip to content

Modernize Testing Infrastructure and Theme Structure #21

Modernize Testing Infrastructure and Theme Structure

Modernize Testing Infrastructure and Theme Structure #21

Workflow file for this run

name: Code Quality
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
php-quality:
name: PHP
runs-on: ubuntu-latest
container: php:8.2-cli
steps:
- uses: actions/checkout@v4
- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Install dependencies
run: |
apt-get update && apt-get install -y git unzip
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
composer install
- name: Run PHP CodeSniffer
run: ./vendor/bin/phpcs --standard=.phpcs.xml.dist .
style-quality:
name: CSS/JS
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies
run: npm install
- name: Run CSS linter
run: npm run lint:css -- --formatter=github
- name: Run JS linter
run: npm run lint:js -- --format=stylish