6
6
pull_request :
7
7
branches :
8
8
- " main"
9
-
10
9
permissions :
11
10
contents : " read"
12
-
13
11
jobs :
12
+ # PHP lint for different PHP versions
14
13
lint :
15
14
runs-on : " ubuntu-latest"
16
15
strategy :
@@ -23,50 +22,48 @@ jobs:
23
22
name : " PHP ${{ matrix.php-version }} lint"
24
23
steps :
25
24
- # git checkout
26
- name : " Checkout code "
25
+ name : " git checkout "
27
26
uses : " actions/checkout@v3"
28
- - # setup PHP
27
+ - # Setup PHP
29
28
name : " Setup PHP"
30
29
uses : " shivammathur/setup-php@v2"
31
30
with :
32
31
php-version : " ${{ matrix.php-version }}"
33
- - # check PHP version
32
+ - # Check PHP version
34
33
name : " Check PHP version"
35
34
run : " php -v"
36
- - # run lint
35
+ - # Lint PHP files
37
36
name : " Lint PHP files"
38
37
run : |
39
38
for file in $(find src/ -type f -name '*.php'); do
40
39
echo -n "==> ${file}: ";
41
40
php -l "${file}";
42
41
done
42
+ # install composer packages and validate coding standards
43
43
build :
44
-
45
44
runs-on : ubuntu-latest
46
-
47
45
name : " PHP composer & CodeSniffer"
48
-
49
46
steps :
50
- - uses : actions/checkout@v3
51
-
52
- - # check PHP version
47
+ - # git checkout
48
+ name : " git checkout"
49
+ uses : " actions/checkout@v3"
50
+ - # Check PHP version
53
51
name : " Check PHP version"
54
52
run : " php -v"
55
-
56
- - name : Validate composer.json and composer.lock
57
- run : composer validate --strict
58
-
59
- - name : Cache Composer packages
60
- id : composer-cache
61
- uses : actions/cache@v3
53
+ - # Validate composer.json and composer.lock
54
+ name : " Validate composer.json and composer.lock"
55
+ run : " composer validate --strict"
56
+ - # Cache Composer packages
57
+ name : " Cache Composer packages"
58
+ id : " composer-cache"
59
+ uses : " actions/cache@v3"
62
60
with :
63
- path : vendor
64
- key : ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
65
- restore-keys : |
66
- ${{ runner.os }}-php-
67
-
68
- - name : Install dependencies
69
- run : composer install --prefer-dist --no-progress
70
-
71
- - name : Run PHP_CodeSniffer validations
72
- run : vendor/bin/phpcs
61
+ path : " vendor"
62
+ key : " ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}"
63
+ restore-keys : " ${{ runner.os }}-php-"
64
+ - # Install dependencies
65
+ name : " Install composer dependencies"
66
+ run : " composer install --prefer-dist --no-progress"
67
+ - # Run PHP_CodeSniffer validations
68
+ name : " Run PHP_CodeSniffer validations"
69
+ run : " vendor/bin/phpcs"
0 commit comments