11name : PHP Quality Assurance
22on : [push, pull_request]
33jobs :
4- QA :
4+
5+ Unit Tests :
56 runs-on : ubuntu-latest
67 if : ${{ !contains(github.event.head_commit.message, 'ci skip') }}
78
89 strategy :
910 matrix :
1011 php : ['7.0', '7.1', '7.2', '7.3', '7.4']
11- prefer-lowest :
12- - " --prefer- lowest"
13- - " "
12+ prefer :
13+ - " lowest"
14+ - " highest "
1415 ignore-platform :
1516 - " "
1617 experimental :
1718 - false
1819 include :
19- - php : " 8.0"
20- prefer : " "
21- ignore-platform : " --ignore-platform-reqs"
22- experimental : true
20+ - php : " 8.0"
21+ prefer : " highest "
22+ ignore-platform : " --ignore-platform-reqs"
23+ experimental : true
2324
2425 continue-on-error : ${{ matrix.experimental }}
2526
@@ -35,24 +36,39 @@ jobs:
3536 run : find ./src/ ./tests/src/ ./tests/cases/ -type f -name '*.php' -print0 | xargs -0 -L 1 -P 4 -- php -l
3637
3738 - name : Install dependencies
38- run : composer update -q -n -a --no-progress --prefer-dist${{ matrix.prefer-lowest }}${{ matrix.ignore-platform }}
39+ uses : " ramsey/composer-install@v1"
40+ with :
41+ dependency-versions : ${{ matrix.prefer }}
42+ composer-options : ${{ matrix.ignore-platform }}
3943
40- - name : Run unit tests (>= 7.3 )
41- if : ${{ (matrix.php >= 7.3) && (matrix.prefer-lowest == '') }}
44+ - name : Run unit tests (PHPUnit 9 )
45+ if : ${{ (matrix.php >= 7.3) && (matrix.prefer == 'highest ') }}
4246 run : ./vendor/bin/phpunit --migrate-configuration
4347
44- - name : Run unit tests (< 7.3 )
45- if : ${{ matrix.php-versions < 7.3 }}
48+ - name : Run unit tests (PHPUnit 7 )
49+ if : ${{ ( matrix.php < 7.3) || ((matrix.php == 7.3) && (matrix.prefer == 'lowest')) }}
4650 run : ./vendor/bin/phpunit
4751
48- - name : Check code styles
49- if : ${{ (matrix.php == '7.4') && (matrix.prefer-lowest == '') }}
50- run : ./vendor/bin/phpcs
52+ Static Analisys :
53+ runs-on : ubuntu-latest
54+ if : ${{ !contains(github.event.head_commit.message, 'ci skip') }}
55+
56+ steps :
57+ - uses : actions/checkout@v2
58+
59+ - name : Setup PHP version
60+ uses : shivammathur/setup-php@v2
61+ with :
62+ php-version : ' 7.4'
63+
64+ - name : Install dependencies
65+ uses : " ramsey/composer-install@v1"
66+
67+ - name : Check code styles
68+ run : ./vendor/bin/phpcs
5169
52- - name : Check cross-version PHP compatibility
53- if : ${{ (matrix.php == '7.4') && (matrix.prefer-lowest == '') }}
54- run : composer phpcompat
70+ - name : Check cross-version PHP compatibility
71+ run : composer phpcompat
5572
56- - name : Check Psalm
57- if : ${{ (matrix.php == '7.4') && (matrix.prefer-lowest == '') }}
58- run : ./vendor/bin/psalm
73+ - name : Check Psalm
74+ run : ./vendor/bin/psalm
0 commit comments