Skip to content

Commit 6abc48f

Browse files
committed
Add PHP linting to the CI build
This ensures that the PHP files have valid syntax, and blocks the unit tests if there are any errors found.
1 parent c055c73 commit 6abc48f

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

.github/workflows/ci.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,33 @@ on:
99
name: CI
1010

1111
jobs:
12+
php-lint:
13+
name: PHP Lint
14+
runs-on: ubuntu-20.04
15+
strategy:
16+
matrix:
17+
php-version: [ '5.3', '5.4', '5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4' ]
18+
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v2
22+
23+
- name: Install PHP
24+
uses: shivammathur/setup-php@v2
25+
with:
26+
php-version: ${{ matrix.php-version }}
27+
coverage: none
28+
29+
- name: PHP Lint
30+
run: find lib tests -name '*.php' -print0 | xargs -0 -n 1 -P 4 php -l
31+
1232
unit-tests:
1333
name: Unit tests
1434

1535
runs-on: ubuntu-20.04
1636

37+
needs: [ php-lint ]
38+
1739
strategy:
1840
fail-fast: false
1941
matrix:

0 commit comments

Comments
 (0)