-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[github-actions] [static-analysis] [CI] Add static analysis & phpcs t…
…ools for supported PHP versions 5.6-8.0+. (#646) * [github-actions] [static-analysis] [CI] Add static analysis & phpcs tools for supported PHP versions 5.6-8.0+. * [github-actions] Remove specific branch actions test. --------- Co-authored-by: Laurence Bahiirwa <[email protected]>
- Loading branch information
Showing
15 changed files
with
678 additions
and
103 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,9 @@ | ||
root = true | ||
|
||
[*.yml] | ||
indent_style = space | ||
indent_size = 2 | ||
|
||
[*.neon] | ||
indent_style = space | ||
indent_size = 4 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Run CI tests via Github. | ||
name: PHPCS and Static Analysis. | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- develop | ||
- master | ||
|
||
jobs: | ||
run: | ||
runs-on: ubuntu-latest | ||
name: PHPCS | ||
continue-on-error: ${{ matrix.experimental }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
php: [ '7.4', '8.0', '8.1', '8.2' ] | ||
experimental: [false] | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php }} | ||
tools: composer | ||
coverage: none | ||
|
||
- name: Install dependencies | ||
uses: ramsey/composer-install@v2 | ||
with: | ||
composer-options: "--no-progress --no-ansi --no-interaction" | ||
dependency-versions: "lowest" | ||
|
||
- name: Log debug information | ||
run: | | ||
php --version | ||
composer --version | ||
- name: PHP Static Analysis | ||
run: composer phpstan | ||
|
||
- name: Run PHPCS | ||
run: composer phpcs:ci |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
/** | ||
* Hold classes and constants to be ignored in PHPStan checks. | ||
* | ||
* @see: https://phpstan.org/user-guide/discovering-symbols | ||
*/ | ||
|
||
// Constants. | ||
define( 'WP_FS__SCRIPT_START_TIME', 1 ); | ||
define( 'WP_PLUGIN_DIR', dirname( __FILE__, 2) ); | ||
define( 'WP_FS__SDK_VERSION', 1 ); | ||
define( 'WP_LANG_DIR', dirname( __FILE__, 2) . 'languages' ); | ||
define( 'WP_FS__REMOTE_ADDR', 1 ); | ||
define( 'WP_CONTENT_DIR', dirname( __FILE__, 3) ); | ||
|
||
// Classes. |
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
Oops, something went wrong.