Skip to content

Flex Hero [TMZ-213] #418

Flex Hero [TMZ-213]

Flex Hero [TMZ-213] #418

name: PHP Lint
on:
push:
branches:
- master
pull_request:
workflow_dispatch:
concurrency:
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.ref }}
permissions:
contents: read
jobs:
PHP-Code-Standards:
name: Lint PHP files
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[skip PHPCS]') || !contains(github.event.head_commit.message, '[skip CI]')"
steps:
- name: Check out source code
uses: actions/checkout@v4
- name: Set up PHP
uses: shivammathur/setup-php@a36e1e52ff4a1c9e9c9be31551ee4712a6cb6bd0 # 2.27.1
with:
php-version: '7.4'
coverage: none
tools: composer, cs2pr, phpcs
env:
fail-fast: 'true'
- name: Log debug information
run: |
export PATH=$HOME/.composer/vendor/bin:$PATH
php --version
phpcs -i
composer --version
- name: Oauth Composer authentication
run: composer config -g github-oauth.github.com ${{ secrets.GITHUB_TOKEN }}
- name: Install dependencies
uses: ramsey/composer-install@83af392bf5f031813d25e6fe4cd626cdba9a2df6 # 2.2.0
- name: Add error matcher
run: echo "::add-matcher::$(pwd)/.github/checkstyle-problem-matcher.json"
- name: Run style check
run: |
export PATH=$HOME/.composer/vendor/bin:$PATH
composer run lint -- --report=checkstyle