Styling #10940
This file contains hidden or 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: Styling | |
on: | |
push: | |
branches: | |
- master | |
- rel-* | |
pull_request: | |
branches: | |
- master | |
- rel-* | |
permissions: | |
contents: read | |
jobs: | |
php_styling: | |
runs-on: ubuntu-24.04 | |
name: PHP | |
strategy: | |
matrix: | |
# Single-element matrix provides named variable and job title | |
php-version: ['8.4'] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v5 | |
- name: Install PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php-version }} | |
coverage: none | |
- name: Get Composer Cache Directory | |
id: composer-cache | |
run: | | |
{ | |
printf 'dir=' | |
composer config cache-files-dir | |
} >> "$GITHUB_OUTPUT" | |
- name: Cache Composer | |
uses: actions/cache@v4 | |
with: | |
path: ${{ steps.composer-cache.outputs.dir }} | |
key: ${{ runner.os }}-composer-${{ matrix.php-version }}-${{ hashFiles('**/composer.lock') }} | |
restore-keys: | | |
${{ runner.os }}-composer-${{ matrix.php-version }}- | |
${{ runner.os }}-composer- | |
- name: Composer Install | |
run: composer install --prefer-dist --no-progress | |
- name: Check PHP Styling | |
run: ./vendor/bin/phpcs -p -n --extensions=php,inc --report-width=120 --standard=ci/phpcs.xml --report=full . | |
css_styling: | |
runs-on: ubuntu-24.04 | |
name: CSS | |
strategy: | |
matrix: | |
# Single-element matrix provides named variable and job title | |
node-version: ['22'] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v5 | |
- name: Install npm package | |
uses: actions/setup-node@v5 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Get NPM Cache Directory | |
id: npm-cache-dir | |
run: | | |
{ | |
printf 'dir=' | |
npm config get cache | |
} >> "$GITHUB_OUTPUT" | |
- name: Cache node modules | |
uses: actions/cache@v4 | |
with: | |
path: ${{ steps.npm-cache-dir.outputs.dir }} | |
key: ${{ runner.os }}-node-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node-${{ matrix.node-version }}- | |
${{ runner.os }}-node- | |
- name: NPM CI | |
run: npm ci | |
- name: Check CSS Styling | |
run: npm run stylelint | |
js_linting: | |
runs-on: ubuntu-24.04 | |
name: JS | |
strategy: | |
matrix: | |
# Single-element matrix provides named variable and job title | |
node-version: ['22'] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v5 | |
- name: Install npm package | |
uses: actions/setup-node@v5 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Get NPM Cache Directory | |
id: npm-cache-dir | |
run: | | |
{ | |
printf 'dir=' | |
npm config get cache | |
} >> "$GITHUB_OUTPUT" | |
- name: Cache node modules | |
uses: actions/cache@v4 | |
with: | |
path: ${{ steps.npm-cache-dir.outputs.dir }} | |
key: ${{ runner.os }}-node-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node-${{ matrix.node-version }}- | |
${{ runner.os }}-node- | |
- name: NPM CI | |
run: npm ci | |
- name: Check JS Linting | |
run: npm run lint:js |