Skip to content

Commit 0b5bd86

Browse files
committed
Add php linting to the test step
Run php -l on all PHP files. This makes sure the files are at least parsable by the current PHP version - not a comprehensive compatibility test but a good first step. Theoretically this could be it's own flow, but since we already have the whole environment setup and in place and it makes no sense to run unit tests when the files not even lint, it's simple to add it here.
1 parent 23660d6 commit 0b5bd86

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

.github/workflows/test.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,10 @@ jobs:
4545
- name: Setup PHPUnit
4646
run: |
4747
php _test/fetchphpunit.php
48-
cd _test
48+
49+
- name: Check Syntax
50+
run: |
51+
find ${{ steps.dokuwiki-env.outputs.dir }} -name '*.php' -print0 | xargs -0L1 php -l
4952
5053
- name: Run PHPUnit
5154
run: |

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ Uses the `phpmatrix` action to create the appropriate strategy matrixes for test
5858

5959
### test.yml
6060

61-
This workflow executes all unit tests that have been marked with the `@group plugin_example` annotation. The PHP and DokuWiki versions to be used are supplied as JSON via input variables.
61+
This workflow first checks all `php` files for syntax errors, then executes all unit tests that have been marked with the `@group plugin_example` annotation.
62+
63+
The PHP and DokuWiki versions to be used are supplied as JSON via input variables.
6264

6365
The workflow will run on every push and on pull requests.
6466

0 commit comments

Comments
 (0)