Skip to content

Instantly share code, notes, and snippets.

@Zifius
Last active August 9, 2023 09:25
Show Gist options
  • Save Zifius/adecc96c6279cfe490c38f13ca2281cd to your computer and use it in GitHub Desktop.
Save Zifius/adecc96c6279cfe490c38f13ca2281cd to your computer and use it in GitHub Desktop.
Magento phpcs using GitHub Actions
name: Coding Standards
on:
pull_request:
paths:
- "**.php"
- "**.phtml"
jobs:
phpcs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
- name: Install dependencies
run: |
composer install --no-dev --no-progress
- uses: tinovyatkin/action-php-codesniffer@v1
with:
files: "**"
scope: files
phpcs_path: vendor/bin/phpcs
standard: vendor/magento/magento-coding-standard/Magento2/ruleset.xml
{
"name": "vendor/name",
"description": "N/A",
"require": {
"magento/magento-coding-standard": "^6.0"
}
}
@Zifius
Copy link
Author

Zifius commented Dec 21, 2020

Note that I'm not using require-dev because of the specifics of the project I work on. So it should be "require-dev" and composer install --no-progress for a real-word extension's codestyle-check case

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment