File tree Expand file tree Collapse file tree 4 files changed +57
-63
lines changed Expand file tree Collapse file tree 4 files changed +57
-63
lines changed Original file line number Diff line number Diff line change 4
4
- push
5
5
- pull_request
6
6
7
- env :
8
- SYMFONY_PHPUNIT_REMOVE_RETURN_TYPEHINT : " 1 "
7
+ permissions :
8
+ contents : read
9
9
10
10
jobs :
11
11
tests :
12
12
name : " CI"
13
13
14
- runs-on : ubuntu-latest
14
+ runs-on : ${{ matrix.os }}
15
15
continue-on-error : ${{ matrix.experimental }}
16
16
17
17
strategy :
@@ -22,37 +22,27 @@ jobs:
22
22
- " 8.1"
23
23
- " 8.2"
24
24
- " 8.3"
25
+ - " 8.4"
25
26
experimental : [false]
27
+ os : [ubuntu-latest]
26
28
include :
27
- - php-version : " 8.4"
28
- experimental : true
29
+ - php-version : " 8.3"
30
+ os : windows-latest
31
+ experimental : false
29
32
30
33
steps :
31
- - name : " Checkout"
32
- uses : " actions/checkout@v4"
34
+ - uses : actions/checkout@v4
33
35
34
- - name : " Install PHP"
35
- uses : " shivammathur/setup-php@v2"
36
+ - uses : shivammathur/setup-php@v2
36
37
with :
37
- coverage : " none"
38
38
php-version : " ${{ matrix.php-version }}"
39
+ coverage : none
39
40
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
46
42
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
54
44
55
- - name : " Run tests"
45
+ - name : Run tests
56
46
run : |
57
47
vendor/bin/phpunit
58
48
vendor/bin/phpunit --testsuite phpstan
Original file line number Diff line number Diff line change 4
4
- push
5
5
- pull_request
6
6
7
+ permissions :
8
+ contents : read
9
+
7
10
jobs :
8
11
tests :
9
12
name : " Lint"
@@ -14,17 +17,27 @@ jobs:
14
17
matrix :
15
18
php-version :
16
19
- " 7.4"
17
- - " 8.3 "
20
+ - " nightly "
18
21
19
22
steps :
20
- - name : " Checkout"
21
- uses : " actions/checkout@v4"
23
+ - uses : actions/checkout@v4
22
24
23
- - name : " Install PHP"
24
- uses : " shivammathur/setup-php@v2"
25
+ - uses : shivammathur/setup-php@v2
25
26
with :
26
- coverage : " none"
27
27
php-version : " ${{ matrix.php-version }}"
28
+ coverage : none
28
29
29
30
- 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
Original file line number Diff line number Diff line change 4
4
- push
5
5
- pull_request
6
6
7
- env :
8
- COMPOSER_FLAGS : " --ansi --no-interaction --no-progress --prefer-dist"
9
- SYMFONY_PHPUNIT_VERSION : " "
7
+ permissions :
8
+ contents : read
10
9
11
10
jobs :
12
11
tests :
@@ -21,28 +20,16 @@ jobs:
21
20
- " 8.3"
22
21
23
22
steps :
24
- - name : " Checkout"
25
- uses : " actions/checkout@v4"
23
+ - uses : actions/checkout@v4
26
24
27
- - name : " Install PHP"
28
- uses : " shivammathur/setup-php@v2"
25
+ - uses : shivammathur/setup-php@v2
29
26
with :
30
- coverage : " none"
31
27
php-version : " ${{ matrix.php-version }}"
28
+ coverage : none
32
29
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
39
31
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
46
33
47
- - name : " Run PHPStan"
48
- run : " composer phpstan"
34
+ - name : Run PHPStan
35
+ run : composer phpstan
Original file line number Diff line number Diff line change 1
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"
2
+ <phpunit xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
5
3
backupGlobals =" false"
4
+ backupStaticAttributes =" false"
6
5
colors =" true"
6
+ convertErrorsToExceptions =" true"
7
+ convertNoticesToExceptions =" true"
8
+ convertWarningsToExceptions =" true"
9
+ processIsolation =" false"
10
+ stopOnFailure =" false"
7
11
bootstrap =" vendor/autoload.php"
12
+ xsi : noNamespaceSchemaLocation =" https://schema.phpunit.de/9.3/phpunit.xsd"
8
13
defaultTestSuite =" pcre"
9
- >
14
+ >
10
15
<testsuites >
11
16
<testsuite name =" pcre" >
12
17
<directory >tests/PregTests</directory >
16
21
<directory >tests/PHPStanTests</directory >
17
22
</testsuite >
18
23
</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 >
25
29
</phpunit >
You can’t perform that action at this time.
0 commit comments