-
-
Notifications
You must be signed in to change notification settings - Fork 436
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add php syntax check as github action (#853)
- Loading branch information
1 parent
96e9dde
commit 33e45b2
Showing
1 changed file
with
61 additions
and
0 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,61 @@ | ||
name: "Static Code Analyses" | ||
on: | ||
push: | ||
pull_request: | ||
|
||
|
||
jobs: | ||
php_syntax: | ||
name: PHP Syntax ${{ matrix.php-versions }} | ||
runs-on: ${{ matrix.operating-system }} | ||
strategy: | ||
max-parallel: 5 | ||
matrix: | ||
operating-system: [ubuntu-latest] | ||
php-versions: ['5.6', '7.0', '7.1', '7.2', '7.3'] | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Setup PHP | ||
uses: shivammathur/setup-php@master | ||
with: | ||
php-version: ${{ matrix.php-versions }} | ||
extension-csv: mbstring #optional, setup extensions | ||
ini-values-csv: post_max_size=256M, short_open_tag=On #optional, setup php.ini configuration | ||
coverage: none #optional, setup coverage driver | ||
pecl: true #optional, setup PECL | ||
- name: Check PHP Version | ||
run: php -v | ||
- name: Check .php files | ||
run: '! find . -not \( -path ./.phpstorm.meta.php -prune \) -not \( -path ./lib/PEAR -prune \) -not \( -path ./lib/phpseclib -prune \) -not \( -path ./lib/Zend -prune \) -type f -name "*.php" -exec php -d error_reporting=32767 -l {} \; 2>&1 1> /dev/null | grep "^"' | ||
- name: Check .phtml files | ||
run: '! find app/design -type f -name "*.phtml" -exec php -d error_reporting=32767 -l {} \; 2>&1 1> /dev/null | grep "^"' | ||
|
||
php_syntax_experimental: | ||
name: PHP Syntax ${{ matrix.php-versions }} - experimental | ||
runs-on: ${{ matrix.operating-system }} | ||
needs: php_syntax | ||
strategy: | ||
max-parallel: 1 | ||
fail-fast: false | ||
matrix: | ||
operating-system: [ubuntu-latest] | ||
php-versions: ['7.4', '8.0'] | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Setup PHP | ||
uses: shivammathur/setup-php@master | ||
with: | ||
php-version: ${{ matrix.php-versions }} | ||
extension-csv: mbstring #optional, setup extensions | ||
ini-values-csv: post_max_size=256M, short_open_tag=On #optional, setup php.ini configuration | ||
coverage: none #optional, setup coverage driver | ||
pecl: true #optional, setup PECL | ||
- name: Check PHP Version | ||
run: php -v | ||
- name: Check .php files | ||
continue-on-error: true | ||
run: '! find . -not \( -path ./.phpstorm.meta.php -prune \) -not \( -path ./lib/PEAR -prune \) -not \( -path ./lib/phpseclib -prune \) -not \( -path ./lib/Zend -prune \) -type f -name "*.php" -exec php -d error_reporting=32767 -l {} \; 2>&1 1> /dev/null | grep "^"' | ||
- name: Check .phtml files | ||
continue-on-error: true | ||
run: '! find app/design -type f -name "*.phtml" -exec php -d error_reporting=32767 -l {} \; 2>&1 1> /dev/null | grep "^"' | ||
|