forked from woocommerce/grow
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request woocommerce#109 from woocommerce/dev/4-phpcs
Add PHP linter and PHP linting in GitHub Actions
- Loading branch information
Showing
23 changed files
with
587 additions
and
121 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: PHP Coding Standards | ||
|
||
on: | ||
push: | ||
branches: | ||
- "trunk" | ||
paths: | ||
- "**.php" | ||
- .github/workflows/php-coding-standards.yml | ||
pull_request: | ||
paths: | ||
- "**.php" | ||
- .github/workflows/php-coding-standards.yml | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
phpcs: | ||
name: PHP coding standards | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Prepare PHP | ||
uses: woocommerce/grow/prepare-php@actions-v1 | ||
with: | ||
php-version: 7.4 | ||
tools: cs2pr | ||
install-deps: "no" | ||
|
||
- name: Install Composer dependencies | ||
run: | | ||
# Skip installing packages from private repos. | ||
composer remove --dev woocommerce/woorelease | ||
composer install --prefer-dist --no-interaction | ||
- name: Log PHPCS information | ||
run: vendor/bin/phpcs -i | ||
|
||
- name: Run PHPCS on all files | ||
run: vendor/bin/phpcs -q --report=checkstyle | cs2pr |
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.