feat: (phpcs): *use yoast configuration #1
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: PHP Lint | |
on: | |
workflow_call: | |
inputs: | |
PROJECT: | |
type: string | |
required: true | |
PATH: | |
type: string | |
required: false | |
default: . | |
COMPOSER_PATH: | |
type: string | |
required: false | |
default: . | |
COMPOSER_PHP_VERSION: | |
type: string | |
required: false | |
default: "7.4" | |
COMPOSER_VERSION: | |
type: string | |
required: false | |
default: "1.x" | |
COMPOSER_DEV: | |
type: string | |
required: false | |
default: "no" | |
COMPOSER_MEMORY_LIMIT: | |
type: string | |
required: false | |
default: "256M" | |
PHP_EXTENSIONS: | |
type: string | |
required: false | |
default: "amqp" | |
PHPCS_PATH: | |
type: string | |
required: false | |
default: . | |
FLAVOUR: | |
type: string | |
required: false | |
default: phpcs | |
description: "one of phpcs, phpstan" | |
secrets: | |
SSH_KEY: | |
required: false | |
SSH_KEY_PUB: | |
required: false | |
jobs: | |
php-lint: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: checkout | |
uses: actions/[email protected] | |
- name: Cache Composer dependencies | |
uses: actions/[email protected] | |
with: | |
path: /tmp/composer-cache | |
key: ${{ runner.os }}-${{ hashFiles('**/composer.lock') }} | |
- uses: php-actions/[email protected] | |
run: composer config http-basic.my.yoast.com token ${YOAST_COMPOSER_TOKEN} | |
with: | |
php_version: ${{inputs.COMPOSER_PHP_VERSION}} | |
version: ${{inputs.COMPOSER_VERSION}} | |
args: "--ignore-platform-reqs --working-dir ${{inputs.COMPOSER_PATH}}" | |
php_extensions: ${{inputs.PHP_EXTENSIONS}} | |
dev: ${{inputs.COMPOSER_DEV}} | |
ssh_key: ${{secrets.SSH_KEY}} | |
ssh_key_pub: ${{secrets.SSH_KEY_PUB}} | |
memory_limit: ${{inputs.COMPOSER_MEMORY_LIMIT}} | |
- uses: php-actions/[email protected] | |
with: | |
path: ${{inputs.PATH}} | |
memory_limit: ${{inputs.COMPOSER_MEMORY_LIMIT}} | |
if: inputs.FLAVOUR == 'phpstan' | |
- name: phpcs | |
run: ./vendor/bin/phpcs --standard=${{inputs.PATH}}/phpcs.xml.dist ${{inputs.PHPCS_PATH}} | |
if: inputs.FLAVOUR == 'phpcs' |