66 pull_request :
77 branches :
88 - " main"
9-
109permissions :
1110 contents : " read"
12-
1311jobs :
12+ # PHP lint for different PHP versions
1413 lint :
1514 runs-on : " ubuntu-latest"
1615 strategy :
@@ -23,50 +22,48 @@ jobs:
2322 name : " PHP ${{ matrix.php-version }} lint"
2423 steps :
2524 - # git checkout
26- name : " Checkout code "
25+ name : " git checkout "
2726 uses : " actions/checkout@v3"
28- - # setup PHP
27+ - # Setup PHP
2928 name : " Setup PHP"
3029 uses : " shivammathur/setup-php@v2"
3130 with :
3231 php-version : " ${{ matrix.php-version }}"
33- - # check PHP version
32+ - # Check PHP version
3433 name : " Check PHP version"
3534 run : " php -v"
36- - # run lint
35+ - # Lint PHP files
3736 name : " Lint PHP files"
3837 run : |
3938 for file in $(find src/ -type f -name '*.php'); do
4039 echo -n "==> ${file}: ";
4140 php -l "${file}";
4241 done
42+ # install composer packages and validate coding standards
4343 build :
44-
4544 runs-on : ubuntu-latest
46-
4745 name : " PHP composer & CodeSniffer"
48-
4946 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
5351 name : " Check PHP version"
5452 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"
6260 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