Skip to content

Commit 3b7bf94

Browse files
committed
Fork off phpstan CI in another job
1 parent bbc50e2 commit 3b7bf94

File tree

4 files changed

+65
-4
lines changed

4 files changed

+65
-4
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,6 @@
1414
/phpstan.neon.dist export-ignore
1515
/phpstan-baseline.neon export-ignore
1616
/phpunit.xml.dist export-ignore
17+
/phpunit-phpstan.xml.dist export-ignore
1718
/tests export-ignore
1819
/CONTRIBUTING.md export-ignore

.github/workflows/continuous-integration.yml

Lines changed: 42 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ on:
55
- pull_request
66

77
env:
8-
COMPOSER_FLAGS: "--ansi --no-interaction --no-progress --prefer-dist"
98
SYMFONY_PHPUNIT_REMOVE_RETURN_TYPEHINT: "1"
109

1110
jobs:
@@ -49,9 +48,49 @@ jobs:
4948

5049
- name: "Install latest dependencies"
5150
run: |
52-
# Remove PHPStan as it requires a newer PHP
53-
composer remove phpstan/phpstan phpstan/phpstan-strict-rules --dev --no-update
5451
composer update ${{ env.COMPOSER_FLAGS }}
5552
5653
- name: "Run tests"
5754
run: "vendor/bin/simple-phpunit --verbose"
55+
56+
phpstan_tests:
57+
name: "CI PHPStan Ext"
58+
59+
runs-on: ubuntu-latest
60+
61+
strategy:
62+
matrix:
63+
php-version:
64+
- "7.3"
65+
- "8.3"
66+
67+
steps:
68+
- name: "Checkout"
69+
uses: "actions/checkout@v2"
70+
71+
- name: "Install PHP"
72+
uses: "shivammathur/setup-php@v2"
73+
with:
74+
coverage: "none"
75+
php-version: "${{ matrix.php-version }}"
76+
77+
- name: Get composer cache directory
78+
id: composercache
79+
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
80+
81+
- name: Cache dependencies
82+
uses: actions/cache@v2
83+
with:
84+
path: ${{ steps.composercache.outputs.dir }}
85+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
86+
restore-keys: ${{ runner.os }}-composer-
87+
88+
- name: "Install latest dependencies"
89+
run: |
90+
# Require PHPUnit directly bypassing the symfony bridge
91+
composer remove symfony/phpunit-bridge --no-update
92+
composer require phpunit/phpunit:^9 --dev --no-update
93+
composer update ${{ env.COMPOSER_FLAGS }}
94+
95+
- name: "Run tests"
96+
run: vendor/bin/phpunit -c phpunit-phpstan.xml.dist

phpunit-phpstan.xml.dist

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.5/phpunit.xsd"
5+
backupGlobals="false"
6+
colors="true"
7+
bootstrap="vendor/autoload.php"
8+
>
9+
<testsuites>
10+
<testsuite name="PCRE Test Suite">
11+
<directory>tests/PHPStanTests</directory>
12+
</testsuite>
13+
</testsuites>
14+
15+
<filter>
16+
<whitelist>
17+
<directory>src</directory>
18+
</whitelist>
19+
</filter>
20+
</phpunit>

phpunit.xml.dist

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
>
99
<testsuites>
1010
<testsuite name="PCRE Test Suite">
11-
<directory>tests</directory>
11+
<directory>tests/PregTests</directory>
12+
<directory>tests/RegexTests</directory>
1213
</testsuite>
1314
</testsuites>
1415

0 commit comments

Comments
 (0)