@@ -2,42 +2,50 @@ name: CI
2
2
3
3
on :
4
4
push :
5
- branches : [ master, develop ]
5
+ branches : [ develop ]
6
6
pull_request :
7
- branches : [ master, develop ]
7
+ branches : [ develop ]
8
8
9
9
jobs :
10
10
build :
11
11
12
12
runs-on : ubuntu-latest
13
+ strategy :
14
+ fail-fast : false
15
+ matrix :
16
+ php-version :
17
+ - " 7.2"
18
+ - " 7.3"
19
+ - " 7.4"
20
+ dependencies :
21
+ - " lowest"
22
+ - " highest"
23
+ name : Tests with PHP ${{ matrix.php-version }} and ${{ matrix.dependencies }} dependencies
13
24
14
25
steps :
15
26
- uses : actions/checkout@v2
16
27
17
- - name : Update PHP
18
- run : sudo update-alternatives --set php /usr/bin/php7.4
28
+ - name : Setup PHP
29
+ uses : shivammathur/setup-php@v2
30
+ with :
31
+ php-version : ${{ matrix.php-version }}
32
+ env :
33
+ COMPOSER_TOKEN : ${{ secrets.GITHUB_TOKEN }}
19
34
20
35
- name : Validate composer
21
36
run : composer validate
22
37
23
- - name : Cache Composer packages
24
- id : composer-cache
25
- uses : actions/cache@v2
38
+ - name : Composer install
39
+ uses : " ramsey/composer-install@v1"
26
40
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
41
+ dependency-versions : " ${{ matrix.dependencies }}"
42
+ composer-options : " ${{ matrix.composer-options }}"
35
43
36
44
- name : Run unit tests suite
37
- run : php vendor/bin/phpunit --configuration tests/Unit/phpunit.xml.dist
45
+ run : vendor/bin/phpunit --configuration tests/Unit/phpunit.xml.dist
38
46
39
47
- name : Run code style suite
40
- run : php vendor/bin/phpcs --standard=psr12 src/ --ignore=*.min.css
48
+ run : vendor/bin/phpcs --standard=psr12 src/ --ignore=*.min.css
41
49
42
50
- name : Run tests code style
43
- run : php vendor/bin/phpcs --standard=psr12 tests/ --ignore=/_files/ -n
51
+ run : vendor/bin/phpcs --standard=psr12 tests/ --ignore=/_files/ -n
0 commit comments