-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
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,20 @@ | ||
name: Test | ||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@master | ||
- name: Set up php${{ matrix.php-versions }} | ||
uses: shivammathur/setup-php@v1 | ||
- name: add problem matcher for php lint | ||
run: ./index.js | ||
- name: lint PHP file with syntax error | ||
run: php -l test/error.php || true | ||
|
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,11 @@ | ||
# phplint-problem-matcher | ||
|
||
This problem matcher lets you show errors from `php -l` as annotation in GitHub Actions. | ||
|
||
## Usage | ||
|
||
Add the step to your workflow, before `php -l` is called. | ||
|
||
```yaml | ||
- uses: korelstar/phplint-problem-matcher@v1 | ||
``` |
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 @@ | ||
name: 'phplint problem matcher' | ||
author: 'Kristof Hamann' | ||
description: 'Shows php lint errors as annotation (with file and code line) in GitHub Actions' | ||
runs: | ||
using: 'node12' | ||
main: 'index.js' | ||
branding: | ||
icon: 'check-square' | ||
color: 'green' |
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,2 @@ | ||
#!/usr/bin/env node | ||
console.log(`::add-matcher::${__dirname}/phplint-matcher.json`); |
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 @@ | ||
{ | ||
"problemMatcher": [ | ||
{ | ||
"owner": "phplint-matcher", | ||
"pattern": [ | ||
{ | ||
"regexp": "^(.+):\\s+\\s+(.+) in (.+) on line (\\d+)$", | ||
"code": 1, | ||
"message": 2, | ||
"file": 3, | ||
"line": 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<?php | ||
|
||
echo "syntax error" |