File tree 3 files changed +41
-54
lines changed
3 files changed +41
-54
lines changed 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 "
7
+ permissions :
8
+ contents : read
9
9
10
10
jobs :
11
11
tests :
@@ -31,31 +31,19 @@ jobs:
31
31
- " 8.3"
32
32
33
33
steps :
34
- - name : " Checkout"
35
- uses : " actions/checkout@v4"
34
+ - uses : actions/checkout@v4
36
35
37
- - name : " Install PHP"
38
- uses : " shivammathur/setup-php@v2"
36
+ - uses : shivammathur/setup-php@v2
39
37
with :
40
- coverage : " none"
41
38
php-version : " ${{ matrix.php-version }}"
39
+ coverage : none
42
40
43
- - name : Get composer cache directory
44
- id : composercache
45
- run : echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
41
+ - name : " Remove PHPStan as it requires a newer PHP"
42
+ run : composer remove phpstan/phpstan --dev --no-update
46
43
47
- - name : Cache dependencies
48
- uses : actions/cache@v3
44
+ - uses : ramsey/composer-install@v3
49
45
with :
50
- path : ${{ steps.composercache.outputs.dir }}
51
- key : ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
52
- restore-keys : ${{ runner.os }}-composer-
53
-
54
- - name : " Install latest dependencies"
55
- run : |
56
- # Remove PHPStan as it requires a newer PHP
57
- composer remove phpstan/phpstan --dev --no-update
58
- composer update ${{ env.COMPOSER_FLAGS }}
59
-
60
- - name : " Run tests"
61
- run : " composer test"
46
+ dependency-versions : highest
47
+
48
+ - name : Run tests
49
+ run : composer test
Original file line number Diff line number Diff line change 1
1
name : " PHP Lint"
2
2
3
3
on :
4
- push :
5
- pull_request :
4
+ - push
5
+ - pull_request
6
+
7
+ permissions :
8
+ contents : read
6
9
7
10
jobs :
8
11
tests :
@@ -14,19 +17,27 @@ jobs:
14
17
matrix :
15
18
php-version :
16
19
- " 5.3"
17
- - " 7.4 "
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
- extensions : " intl"
28
- ini-values : " memory_limit=-1"
29
27
php-version : " ${{ matrix.php-version }}"
28
+ coverage : none
30
29
31
30
- name : " Lint PHP files"
32
- 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 "
7
+ permissions :
8
+ contents : read
9
9
10
10
jobs :
11
11
tests :
@@ -19,28 +19,16 @@ jobs:
19
19
- " 8.0"
20
20
21
21
steps :
22
- - name : " Checkout"
23
- uses : " actions/checkout@v4"
22
+ - uses : actions/checkout@v4
24
23
25
- - name : " Install PHP"
26
- uses : " shivammathur/setup-php@v2"
24
+ - uses : shivammathur/setup-php@v2
27
25
with :
28
- coverage : " none"
29
26
php-version : " ${{ matrix.php-version }}"
27
+ coverage : none
30
28
31
- - name : Get composer cache directory
32
- id : composercache
33
- run : echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
34
-
35
- - name : Cache dependencies
36
- uses : actions/cache@v3
29
+ - uses : ramsey/composer-install@v3
37
30
with :
38
- path : ${{ steps.composercache.outputs.dir }}
39
- key : ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
40
- restore-keys : ${{ runner.os }}-composer-
41
-
42
- - name : " Install latest dependencies"
43
- run : " composer update ${{ env.COMPOSER_FLAGS }}"
31
+ dependency-versions : highest
44
32
45
33
- name : Run PHPStan
46
34
run : composer phpstan
You can’t perform that action at this time.
0 commit comments