Skip to content

Fix typo

Fix typo #33

# Runs against the entire project, not just the changed files.
name: Code Standards
on:
# run on pushes to all branches
push:
workflow_dispatch:
# used when called manually. 'secrets' are passed in automagically
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#workflow_dispatch
inputs:
COMPOSER_ROOT_VERSION:
description: 'branch alias to use instead of dev-SHA, must have branch-alias in composer.json for root project'
default: 'dev-main'
required: false
type: string
workflow_call:
# used when called by _another_ workflow (not when called on this repo!)
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#workflow_call
inputs:
COMPOSER_ROOT_VERSION:
description: 'branch alias to use instead of dev-SHA, must have branch-alias in composer.json for root project'
default: 'dev-main'
required: false
type: string
env:
COMPOSER_ROOT_VERSION: 'dev-main'
jobs:
code-standards:
runs-on: ubuntu-latest
steps:
# get the source code
- uses: actions/checkout@v3
- name: Print directory info after checkout
run: ls -lah
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3.12'
tools: cs2pr:1.8.5, composer:2.8.4, php-cs-fixer:3.65.0, phpcs:3.11.2
extensions: mailparse
- name: Setup problem matchers for PHP
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install Composer dependencies
if: ${{ steps.composer-cache.outputs.cache-hit != 'true' }}
env:
# use the inputs if supplied (from being called via another workflow), supplied vars, or env as a final fallback
COMPOSER_ROOT_VERSION: ${{ inputs.COMPOSER_ROOT_VERSION || vars.COMPOSER_ROOT_VERSION || env.COMPOSER_ROOT_VERSION }}
run: composer install --no-interaction --no-scripts --ignore-platform-req=php+
- name: Run PHPCS
id: run-phpcs
run: phpcs --standard=phpcs.xml --report=checkstyle .github cli src tests | cs2pr
- name: Run PHP-CS-Fixer
id: run-php-cs-fixer
run: php-cs-fixer fix -n --dry-run --format=checkstyle --config=.php-cs-fixer.php | cs2pr