Skip to content

Commit be87040

Browse files
committed
Add php action workflow
1 parent e37aaf0 commit be87040

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

.github/workflows/php.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: PHP Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- release/*
8+
pull_request:
9+
branches:
10+
- master
11+
12+
jobs:
13+
lint:
14+
name: Static analysis for php ${{ matrix.php }} on ${{ matrix.os }}
15+
runs-on: ${{ matrix.os }}
16+
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
php: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0']
21+
os: ['ubuntu-latest']
22+
include:
23+
- php: '5.6'
24+
allow_failure: true
25+
- php: '7.0'
26+
allow_failure: true
27+
28+
steps:
29+
- name: Checkout code base
30+
uses: actions/checkout@v2
31+
32+
- name: Setup PHP
33+
uses: shivammathur/setup-php@v2
34+
with:
35+
php-version: ${{ matrix.php }}
36+
tools: phpcs
37+
38+
- name: Setup dependencies
39+
run: composer require -n --no-progress overtrue/phplint
40+
41+
- name: PHP Lint
42+
if: success() || matrix.allow_failure
43+
run: ./vendor/bin/phplint -n --exclude={^vendor/.*} -- .
44+
45+
- name: PHP CodeSniffer
46+
if: success() || matrix.allow_failure
47+
run: phpcs

0 commit comments

Comments
 (0)