File tree 4 files changed +44
-53
lines changed
4 files changed +44
-53
lines changed Original file line number Diff line number Diff line change 5
5
- pull_request
6
6
7
7
env :
8
- COMPOSER_FLAGS : " --ansi --no-interaction --no-progress --prefer-dist"
9
8
SYMFONY_PHPUNIT_REMOVE_RETURN_TYPEHINT : " 1"
10
9
10
+ permissions :
11
+ contents : read
12
+
11
13
jobs :
12
14
tests :
13
15
name : " CI"
@@ -30,33 +32,22 @@ jobs:
30
32
- " 8.1"
31
33
- " 8.2"
32
34
- " 8.3"
35
+ - " 8.4"
33
36
34
37
steps :
35
- - name : " Checkout"
36
- uses : " actions/checkout@v4"
38
+ - uses : actions/checkout@v4
37
39
38
- - name : " Install PHP"
39
- uses : " shivammathur/setup-php@v2"
40
+ - uses : shivammathur/setup-php@v2
40
41
with :
41
- coverage : " none"
42
42
php-version : " ${{ matrix.php-version }}"
43
+ coverage : none
43
44
44
- - name : Get composer cache directory
45
- id : composercache
46
- run : " echo \" dir=$(composer config cache-files-dir)\" >> $GITHUB_OUTPUT"
45
+ - name : " Remove PHPStan as it requires a newer PHP"
46
+ run : composer remove phpstan/phpstan --dev --no-update
47
47
48
- - name : Cache dependencies
49
- uses : actions/cache@v4
48
+ - uses : ramsey/composer-install@v3
50
49
with :
51
- path : ${{ steps.composercache.outputs.dir }}
52
- key : ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
53
- restore-keys : ${{ runner.os }}-composer-
54
-
55
- - name : " Install latest dependencies"
56
- run : |
57
- # Remove PHPStan as it requires a newer PHP
58
- composer remove phpstan/phpstan --dev --no-update
59
- composer update ${{ env.COMPOSER_FLAGS }}
60
-
61
- - name : " Run tests"
62
- run : " vendor/bin/simple-phpunit --verbose"
50
+ dependency-versions : highest
51
+
52
+ - name : Run tests
53
+ run : vendor/bin/simple-phpunit --verbose
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"
@@ -15,17 +18,27 @@ jobs:
15
18
php-version :
16
19
- " 5.3"
17
20
- " 7.4"
18
- - " 8.3 "
21
+ - " nightly "
19
22
20
23
steps :
21
- - name : " Checkout"
22
- uses : " actions/checkout@v4"
24
+ - uses : actions/checkout@v4
23
25
24
- - name : " Install PHP"
25
- uses : " shivammathur/setup-php@v2"
26
+ - uses : shivammathur/setup-php@v2
26
27
with :
27
- coverage : " none"
28
28
php-version : " ${{ matrix.php-version }}"
29
+ coverage : none
29
30
30
31
- name : " Lint PHP files"
31
- run : " find src/ -type f -name '*.php' -print0 | xargs -0 -L1 -P4 -- php -l -f"
32
+ run : |
33
+ hasErrors=0
34
+ for f in $(find src/ tests/ -type f -name '*.php' ! -path '*/vendor/*' ! -path '*/Fixtures/*')
35
+ do
36
+ { error="$(php -derror_reporting=-1 -ddisplay_errors=1 -l -f $f 2>&1 1>&3 3>&-)"; } 3>&1;
37
+ if [ "$error" != "" ]; then
38
+ while IFS= read -r line; do echo "::error file=$f::$line"; done <<< "$error"
39
+ hasErrors=1
40
+ fi
41
+ done
42
+ if [ $hasErrors -eq 1 ]; then
43
+ exit 1
44
+ 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 :
@@ -23,30 +22,18 @@ jobs:
23
22
phpunit-version-constraint : " ^9.6"
24
23
25
24
steps :
26
- - name : " Checkout"
27
- uses : " actions/checkout@v4"
25
+ - uses : actions/checkout@v4
28
26
29
- - name : " Install PHP"
30
- uses : " shivammathur/setup-php@v2"
27
+ - uses : shivammathur/setup-php@v2
31
28
with :
32
- coverage : " none"
33
29
php-version : " ${{ matrix.php-version }}"
30
+ coverage : none
34
31
35
- - name : Get composer cache directory
36
- id : composercache
37
- run : " echo \" dir=$(composer config cache-files-dir)\" >> $GITHUB_OUTPUT"
38
-
39
- - name : Cache dependencies
40
- uses : actions/cache@v4
32
+ - uses : ramsey/composer-install@v3
41
33
with :
42
- path : ${{ steps.composercache.outputs.dir }}
43
- key : ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
44
- restore-keys : ${{ runner.os }}-composer-
45
-
46
- - name : " Install latest dependencies"
47
- run : " composer update ${{ env.COMPOSER_FLAGS }}"
34
+ dependency-versions : highest
48
35
49
36
- name : Run PHPStan
50
37
run : |
51
- composer require --dev phpunit/phpunit:"${{ matrix.phpunit-version-constraint }}" --with-all-dependencies ${{ env.COMPOSER_FLAGS }}
38
+ composer require --dev phpunit/phpunit:"${{ matrix.phpunit-version-constraint }}" --with-all-dependencies -n
52
39
vendor/bin/phpstan analyse
Original file line number Diff line number Diff line change 34
34
"php" : " ^5.3.2 || ^7.0 || ^8.0"
35
35
},
36
36
"require-dev" : {
37
- "symfony/phpunit-bridge" : " ^4.2 || ^5 " ,
38
- "phpstan/phpstan" : " ^1.4 "
37
+ "symfony/phpunit-bridge" : " ^3 || ^7 " ,
38
+ "phpstan/phpstan" : " ^1.11 "
39
39
},
40
40
"autoload" : {
41
41
"psr-4" : {
You can’t perform that action at this time.
0 commit comments