Skip to content

Commit 7cafee3

Browse files
committed
Merge branch '2.x'
2 parents c8bfe21 + 9424d5f commit 7cafee3

File tree

4 files changed

+57
-63
lines changed

4 files changed

+57
-63
lines changed

.github/workflows/continuous-integration.yml

Lines changed: 14 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ on:
44
- push
55
- pull_request
66

7-
env:
8-
SYMFONY_PHPUNIT_REMOVE_RETURN_TYPEHINT: "1"
7+
permissions:
8+
contents: read
99

1010
jobs:
1111
tests:
1212
name: "CI"
1313

14-
runs-on: ubuntu-latest
14+
runs-on: ${{ matrix.os }}
1515
continue-on-error: ${{ matrix.experimental }}
1616

1717
strategy:
@@ -22,37 +22,27 @@ jobs:
2222
- "8.1"
2323
- "8.2"
2424
- "8.3"
25+
- "8.4"
2526
experimental: [false]
27+
os: [ubuntu-latest]
2628
include:
27-
- php-version: "8.4"
28-
experimental: true
29+
- php-version: "8.3"
30+
os: windows-latest
31+
experimental: false
2932

3033
steps:
31-
- name: "Checkout"
32-
uses: "actions/checkout@v4"
34+
- uses: actions/checkout@v4
3335

34-
- name: "Install PHP"
35-
uses: "shivammathur/setup-php@v2"
36+
- uses: shivammathur/setup-php@v2
3637
with:
37-
coverage: "none"
3838
php-version: "${{ matrix.php-version }}"
39+
coverage: none
3940

40-
- name: Get composer cache directory
41-
id: composercache
42-
run: "echo \"dir=$(composer config cache-files-dir)\" >> $GITHUB_OUTPUT"
43-
44-
- name: Cache dependencies
45-
uses: actions/cache@v4
41+
- uses: ramsey/composer-install@v3
4642
with:
47-
path: ${{ steps.composercache.outputs.dir }}
48-
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
49-
restore-keys: ${{ runner.os }}-composer-
50-
51-
- name: "Install latest dependencies"
52-
run: |
53-
composer update ${{ env.COMPOSER_FLAGS }}
43+
dependency-versions: highest
5444

55-
- name: "Run tests"
45+
- name: Run tests
5646
run: |
5747
vendor/bin/phpunit
5848
vendor/bin/phpunit --testsuite phpstan

.github/workflows/lint.yml

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ on:
44
- push
55
- pull_request
66

7+
permissions:
8+
contents: read
9+
710
jobs:
811
tests:
912
name: "Lint"
@@ -14,17 +17,27 @@ jobs:
1417
matrix:
1518
php-version:
1619
- "7.4"
17-
- "8.3"
20+
- "nightly"
1821

1922
steps:
20-
- name: "Checkout"
21-
uses: "actions/checkout@v4"
23+
- uses: actions/checkout@v4
2224

23-
- name: "Install PHP"
24-
uses: "shivammathur/setup-php@v2"
25+
- uses: shivammathur/setup-php@v2
2526
with:
26-
coverage: "none"
2727
php-version: "${{ matrix.php-version }}"
28+
coverage: none
2829

2930
- name: "Lint PHP files"
30-
run: "find src/ -type f -name '*.php' -print0 | xargs -0 -L1 -P4 -- php -l -f"
31+
run: |
32+
hasErrors=0
33+
for f in $(find src/ tests/ -type f -name '*.php' ! -path '*/vendor/*' ! -path '*/Fixtures/*')
34+
do
35+
{ error="$(php -derror_reporting=-1 -ddisplay_errors=1 -l -f $f 2>&1 1>&3 3>&-)"; } 3>&1;
36+
if [ "$error" != "" ]; then
37+
while IFS= read -r line; do echo "::error file=$f::$line"; done <<< "$error"
38+
hasErrors=1
39+
fi
40+
done
41+
if [ $hasErrors -eq 1 ]; then
42+
exit 1
43+
fi

.github/workflows/phpstan.yml

Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@ on:
44
- push
55
- pull_request
66

7-
env:
8-
COMPOSER_FLAGS: "--ansi --no-interaction --no-progress --prefer-dist"
9-
SYMFONY_PHPUNIT_VERSION: ""
7+
permissions:
8+
contents: read
109

1110
jobs:
1211
tests:
@@ -21,28 +20,16 @@ jobs:
2120
- "8.3"
2221

2322
steps:
24-
- name: "Checkout"
25-
uses: "actions/checkout@v4"
23+
- uses: actions/checkout@v4
2624

27-
- name: "Install PHP"
28-
uses: "shivammathur/setup-php@v2"
25+
- uses: shivammathur/setup-php@v2
2926
with:
30-
coverage: "none"
3127
php-version: "${{ matrix.php-version }}"
28+
coverage: none
3229

33-
- name: Get composer cache directory
34-
id: composercache
35-
run: "echo \"dir=$(composer config cache-files-dir)\" >> $GITHUB_OUTPUT"
36-
37-
- name: Cache dependencies
38-
uses: actions/cache@v4
30+
- uses: ramsey/composer-install@v3
3931
with:
40-
path: ${{ steps.composercache.outputs.dir }}
41-
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
42-
restore-keys: ${{ runner.os }}-composer-
43-
44-
- name: "Install latest dependencies"
45-
run: "composer update ${{ env.COMPOSER_FLAGS }}"
32+
dependency-versions: highest
4633

47-
- name: "Run PHPStan"
48-
run: "composer phpstan"
34+
- name: Run PHPStan
35+
run: composer phpstan

phpunit.xml.dist

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
<?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"
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
53
backupGlobals="false"
4+
backupStaticAttributes="false"
65
colors="true"
6+
convertErrorsToExceptions="true"
7+
convertNoticesToExceptions="true"
8+
convertWarningsToExceptions="true"
9+
processIsolation="false"
10+
stopOnFailure="false"
711
bootstrap="vendor/autoload.php"
12+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
813
defaultTestSuite="pcre"
9-
>
14+
>
1015
<testsuites>
1116
<testsuite name="pcre">
1217
<directory>tests/PregTests</directory>
@@ -16,10 +21,9 @@
1621
<directory>tests/PHPStanTests</directory>
1722
</testsuite>
1823
</testsuites>
19-
20-
<filter>
21-
<whitelist>
22-
<directory>src</directory>
23-
</whitelist>
24-
</filter>
24+
<coverage>
25+
<include>
26+
<directory>./src/</directory>
27+
</include>
28+
</coverage>
2529
</phpunit>

0 commit comments

Comments
 (0)