@@ -39,11 +39,50 @@ jobs:
39
39
strategy :
40
40
fail-fast : false
41
41
matrix :
42
- php-version : [ '7.2', '7.3' ]
43
- coverage : [ 'none' ]
44
- include :
45
- - php-version : ' 7.4'
46
- coverage : xdebug
42
+ php-version : [ '7.2', '7.3', '7.4' ]
43
+
44
+ steps :
45
+ - name : Checkout
46
+ uses : actions/checkout@v4
47
+
48
+ - name : Install PHP
49
+ uses : shivammathur/setup-php@v2
50
+ with :
51
+ php-version : ${{ matrix.php-version }}
52
+ ini-values : error_reporting=E_ALL
53
+ tools : composer:v2
54
+ coverage : none
55
+
56
+ - name : Show the Composer configuration
57
+ run : composer config --global --list
58
+
59
+ - name : Cache dependencies installed with composer
60
+ uses : actions/cache@v4
61
+ with :
62
+ path : ~/.cache/composer
63
+ key : php${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.json') }}
64
+ restore-keys : |
65
+ php${{ matrix.php-version }}-composer-
66
+
67
+ - name : Install Composer dependencies
68
+ run : |
69
+ composer update --with-dependencies --no-progress;
70
+ composer show;
71
+
72
+ - name : Run Tests
73
+ run : ./vendor/bin/phpunit --coverage-clover build/coverage/xml
74
+
75
+ coverage :
76
+ name : Unit tests
77
+
78
+ runs-on : ubuntu-22.04
79
+
80
+ needs : [ php-lint ]
81
+
82
+ strategy :
83
+ fail-fast : false
84
+ matrix :
85
+ php-version : [ '7.4' ]
47
86
48
87
steps :
49
88
- name : Checkout
55
94
php-version : ${{ matrix.php-version }}
56
95
ini-values : error_reporting=E_ALL
57
96
tools : composer:v2
58
- coverage : " ${{ matrix.coverage }} "
97
+ coverage : xdebug
59
98
60
99
- name : Show the Composer configuration
61
100
run : composer config --global --list
79
118
- name : Upload coverage results to Codacy
80
119
env :
81
120
CODACY_PROJECT_TOKEN : ${{ secrets.CODACY_PROJECT_TOKEN }}
82
- if : " ${{ matrix.coverage != 'none' && env.CODACY_PROJECT_TOKEN != '' }}"
121
+ if : " ${{ env.CODACY_PROJECT_TOKEN != '' }}"
83
122
run : |
84
123
./vendor/bin/codacycoverage clover build/coverage/xml
85
124
0 commit comments