-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #255 from Icinga/add-lint-and-style-tests
Add php action workflow
- Loading branch information
Showing
11 changed files
with
103 additions
and
16 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,47 @@ | ||
name: PHP Tests | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
- release/* | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
lint: | ||
name: Static analysis for php ${{ matrix.php }} on ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
php: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0'] | ||
os: ['ubuntu-latest'] | ||
include: | ||
- php: '5.6' | ||
allow_failure: true | ||
- php: '7.0' | ||
allow_failure: true | ||
|
||
steps: | ||
- name: Checkout code base | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php }} | ||
tools: phpcs | ||
|
||
- name: Setup dependencies | ||
run: composer require -n --no-progress overtrue/phplint | ||
|
||
- name: PHP Lint | ||
if: success() || matrix.allow_failure | ||
run: ./vendor/bin/phplint -n --exclude={^vendor/.*} -- . | ||
|
||
- name: PHP CodeSniffer | ||
if: success() || matrix.allow_failure | ||
run: phpcs |
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,25 @@ | ||
<?xml version="1.0"?> | ||
<ruleset name="PHP_CodeSniffer"> | ||
<description>Sniff our code a while</description> | ||
|
||
<file>./</file> | ||
|
||
<exclude-pattern>vendor/*</exclude-pattern> | ||
|
||
<arg value="wps"/> | ||
<arg name="report-width" value="auto"/> | ||
<arg name="report-full"/> | ||
<arg name="report-gitblame"/> | ||
<arg name="report-summary"/> | ||
<arg name="encoding" value="UTF-8"/> | ||
<arg name="extensions" value="php"/> | ||
|
||
<rule ref="PSR2"/> | ||
|
||
<rule ref="Generic.Files.LineLength"> | ||
<properties> | ||
<property name="lineLimit" value="120"/> | ||
<property name="absoluteLineLimit" value="0"/> | ||
</properties> | ||
</rule> | ||
</ruleset> |
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
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
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
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
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
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
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
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
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