Last active
August 9, 2023 09:25
-
-
Save Zifius/adecc96c6279cfe490c38f13ca2281cd to your computer and use it in GitHub Desktop.
Magento phpcs using GitHub Actions
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: 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 |
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": "vendor/name", | |
"description": "N/A", | |
"require": { | |
"magento/magento-coding-standard": "^6.0" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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