Skip to content

Commit 34269b9

Browse files
pprkutdanhunsaker
authored andcommitted
Split PHPCS and PHPStan out into separate CI-steps (#51)
1 parent 213f28b commit 34269b9

File tree

1 file changed

+48
-11
lines changed

1 file changed

+48
-11
lines changed

.github/workflows/php-test.yml

Lines changed: 48 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ name: PHP Tests
22
on: [push, pull_request]
33

44
jobs:
5-
php:
5+
phpunit:
66
runs-on: ubuntu-latest
77
continue-on-error: ${{ matrix.experimental }}
8-
name: "PHP-${{ matrix.php-versions }}: CS/PHPStan/PHPUnit"
8+
name: "PHP-${{ matrix.php-versions }}: PHPUnit"
99
strategy:
1010
matrix:
1111
php-versions: ['7.3', '7.4']
@@ -21,27 +21,64 @@ jobs:
2121
uses: shivammathur/setup-php@v2
2222
with:
2323
php-version: ${{ matrix.php-versions }}
24-
tools: cs2pr, phpcs, phpstan, phpunit
24+
tools: phpunit
2525
extensions: redis
2626

2727
- name: Setup problem matchers for PHP
2828
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"
2929

30-
- name: Run PHPCS
31-
continue-on-error: true
32-
run: phpcs -q --report=checkstyle lib | cs2pr
33-
3430
- name: Install dependencies
3531
run: composer install
3632

37-
- name: Run PHPStan
38-
run: phpstan analyse lib -l1
39-
4033
- name: Install redis
4134
run: sudo apt-get install -y redis-server
4235

4336
- name: Setup problem matchers for PHPUnit
4437
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
4538

4639
- name: Run PHPunit
47-
run: phpunit --configuration phpunit.xml.dist
40+
run: phpunit --configuration phpunit.xml.dist
41+
42+
phpcs:
43+
runs-on: ubuntu-latest
44+
continue-on-error: true
45+
name: "PHPCS"
46+
steps:
47+
- name: Checkout
48+
uses: actions/checkout@v2
49+
50+
- name: Setup PHPCS
51+
uses: shivammathur/setup-php@v2
52+
with:
53+
php-version: '7.4'
54+
tools: cs2pr, phpcs
55+
56+
- name: Setup problem matchers for PHP
57+
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"
58+
59+
- name: Run PHPCS
60+
run: phpcs -q --report=checkstyle lib | cs2pr
61+
62+
phpstan:
63+
runs-on: ubuntu-latest
64+
continue-on-error: false
65+
name: "PHPStan"
66+
steps:
67+
- name: Checkout
68+
uses: actions/checkout@v2
69+
70+
- name: Setup PHPStan
71+
uses: shivammathur/setup-php@v2
72+
with:
73+
php-version: '7.4'
74+
tools: phpstan
75+
76+
- name: Setup problem matchers for PHP
77+
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"
78+
79+
- name: Install dependencies
80+
run: composer install
81+
82+
- name: Run PHPStan
83+
run: phpstan analyse lib -l1
84+

0 commit comments

Comments
 (0)