@@ -2,42 +2,49 @@ name: CI
22
33on :
44 push :
5- branches : [ master, develop ]
5+ branches : [ develop ]
66 pull_request :
7- branches : [ master, develop ]
7+ branches : [ develop ]
88
99jobs :
1010 build :
1111
1212 runs-on : ubuntu-latest
13+ strategy :
14+ fail-fast : false
15+ matrix :
16+ php-version :
17+ - " 7.3"
18+ - " 7.4"
19+ dependencies :
20+ - " lowest"
21+ - " highest"
22+ name : Tests with PHP ${{ matrix.php-version }} and ${{ matrix.dependencies }} dependencies
1323
1424 steps :
1525 - uses : actions/checkout@v2
1626
17- - name : Update PHP
18- run : sudo update-alternatives --set php /usr/bin/php7.4
27+ - name : Setup PHP
28+ uses : shivammathur/setup-php@v2
29+ with :
30+ php-version : ${{ matrix.php-version }}
31+ env :
32+ COMPOSER_TOKEN : ${{ secrets.GITHUB_TOKEN }}
1933
2034 - name : Validate composer
2135 run : composer validate
2236
23- - name : Cache Composer packages
24- id : composer-cache
25- uses : actions/cache@v2
37+ - name : Composer install
38+ uses : " ramsey/composer-install@v1"
2639 with :
27- path : vendor
28- key : ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
29- restore-keys : |
30- ${{ runner.os }}-php-
31-
32- - name : Install dependencies
33- if : steps.composer-cache.outputs.cache-hit != 'true'
34- run : composer install --prefer-source --no-interaction
40+ dependency-versions : " ${{ matrix.dependencies }}"
41+ composer-options : " ${{ matrix.composer-options }}"
3542
3643 - name : Run unit tests suite
37- run : php vendor/bin/phpunit --configuration tests/Unit/phpunit.xml.dist
44+ run : vendor/bin/phpunit --configuration tests/Unit/phpunit.xml.dist
3845
3946 - name : Run code style suite
40- run : php vendor/bin/phpcs --standard=psr12 src/ --ignore=*.min.css
47+ run : vendor/bin/phpcs --standard=psr12 src/ --ignore=*.min.css
4148
4249 - name : Run tests code style
43- run : php vendor/bin/phpcs --standard=psr12 tests/ --ignore=/_files/ -n
50+ run : vendor/bin/phpcs --standard=psr12 tests/ --ignore=/_files/ -n
0 commit comments