Skip to content

Commit

Permalink
Merge pull request #4 from zalexki/update-readme
Browse files Browse the repository at this point in the history
udpate readme
  • Loading branch information
Quetzacoalt91 authored Dec 4, 2019
2 parents da7b546 + 3e706b8 commit b9b4a53
Showing 1 changed file with 19 additions and 46 deletions.
65 changes: 19 additions & 46 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,52 +7,25 @@ This actions runs `php -l` on all PHP files found in the current project.
Using this action can be done with this template:

```
workflow "Code Quality" {
on = "push"
resolves = [
"PHP 5.6 Syntax check",
"PHP 7.2 Syntax check",
"PHP 7.3 Syntax check",
]
}
action "PHP 5.6 Syntax check" {
uses = "docker://prestashop/github-action-php-lint:5.6"
}
action "PHP 7.2 Syntax check" {
uses = "docker://prestashop/github-action-php-lint:7.2"
}
action "PHP 7.3 Syntax check" {
uses = "docker://prestashop/github-action-php-lint:7.3"
}
steps:
- name: Checkout
uses: actions/checkout@v1
with:
fetch-depth: 0
- name: PHP syntax checker 7.2
uses: prestashop/github-action-php-lint/7.2@v1
with:
folder-to-exclude: "! -path \"./vendor/*\" ! -path \"./customer/folder/excluded/*\""
- name: PHP syntax checker 7.3
uses: prestashop/github-action-php-lint/7.3@v1
with:
folder-to-exclude: "! -path \"./vendor/*\" ! -path \"./customer/folder/excluded/*\""
- name: PHP syntax checker 5.6
uses: prestashop/github-action-php-lint/5.6@v1
with:
folder-to-exclude: "! -path \"./vendor/*\" ! -path \"./customer/folder/excluded/*\""
```

In this example, your workflow will run the PHP syntax check with PHP 5.6, 7.2 & 7.3.

## Customizing

By default the script will look for all PHP files in the project. You may want to filter on some directories or files, or adding other parameters to the `find` command.
The action ignores the folder `vendor` at root of project by default.

In this example, we exclude the folder `tools/` from the search:

```diff
workflow "Code Quality" {
on = "push"
resolves = [
"PHP 5.6 Syntax check",
"PHP 7.2 Syntax check",
]
}

action "PHP 5.6 Syntax check" {
uses = "docker://prestashop/github-action-php-lint:5.6"
+ args = "! -path \"./tools/*\""
}

action "PHP 7.2 Syntax check" {
uses = "docker://prestashop/github-action-php-lint:7.2"
+ args = "! -path \"./tools/*\""
}
```
In this example, your workflow will run the PHP syntax check with PHP 5.6, 7.2 & 7.3.

0 comments on commit b9b4a53

Please sign in to comment.