Skip to content

Commit

Permalink
add php syntax check as github action (OpenMage#853)
Browse files Browse the repository at this point in the history
  • Loading branch information
Flyingmana committed Dec 4, 2019
1 parent 96e9dde commit 33e45b2
Showing 1 changed file with 61 additions and 0 deletions.
61 changes: 61 additions & 0 deletions .github/workflows/static-code-analyses.yml
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 "^"'

0 comments on commit 33e45b2

Please sign in to comment.