@@ -2,42 +2,49 @@ 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.3"
18
+ - " 7.4"
19
+ dependencies :
20
+ - " lowest"
21
+ - " highest"
22
+ name : Tests with PHP ${{ matrix.php-version }} and ${{ matrix.dependencies }} dependencies
13
23
14
24
steps :
15
25
- uses : actions/checkout@v2
16
26
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 }}
19
33
20
34
- name : Validate composer
21
35
run : composer validate
22
36
23
- - name : Cache Composer packages
24
- id : composer-cache
25
- uses : actions/cache@v2
37
+ - name : Composer install
38
+ uses : " ramsey/composer-install@v1"
26
39
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 }}"
35
42
36
43
- 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
38
45
39
46
- 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
41
48
42
49
- 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