2525 strategy :
2626 matrix :
2727 include :
28- - php : ' 7.1 '
28+ - php : ' 7.2 '
2929 db : " none"
3030 NOTESTS : 1
3131
@@ -113,6 +113,8 @@ jobs:
113113 db : " mysql:5.7"
114114 - php : ' 7.2'
115115 db : " mysql:5.7"
116+ COVERAGE : 1
117+ db_alias : " mysql:5.7 with Coverage"
116118 - php : ' 7.3'
117119 db : " mysql:5.7"
118120 - php : ' 7.4'
@@ -123,6 +125,8 @@ jobs:
123125 db : " mysql:5.7"
124126 - php : ' 8.1'
125127 db : " mysql:5.7"
128+ - php : ' 8.2'
129+ db : " mysql:5.7"
126130
127131 name : PHP ${{ matrix.php }} - ${{ matrix.db_alias != '' && matrix.db_alias || matrix.db }}
128132
@@ -171,12 +175,21 @@ jobs:
171175 echo "::set-output name=db::$db"
172176
173177 - name : Setup PHP
178+ if : ${{ matrix.COVERAGE != 1 }}
174179 uses : shivammathur/setup-php@v2
175180 with :
176181 php-version : ${{ matrix.php }}
177182 extensions : dom, curl, libxml, mbstring, zip, pcntl, pdo, mysqli, sqlite, pdo_sqlite, intl, gd, exif, iconv, sqlsrv, pdo_sqlsrv, ldap
178183 coverage : none
179184
185+ - name : Setup PHP with Coverage
186+ if : ${{ matrix.COVERAGE == 1 }}
187+ uses : shivammathur/setup-php@v2
188+ with :
189+ php-version : ${{ matrix.php }}
190+ extensions : dom, curl, libxml, mbstring, zip, pcntl, pdo, mysqli, sqlite, pdo_sqlite, intl, gd, exif, iconv, sqlsrv, pdo_sqlsrv, ldap
191+ coverage : xdebug
192+
180193 - name : Setup environment for phpBB
181194 env :
182195 DB : ${{steps.database-type.outputs.db}}
@@ -193,14 +206,36 @@ jobs:
193206 working-directory : ./phpBB3
194207
195208 - name : Setup PHPUnit files
196- run : mkdir -p phpBB/ext/$EXTNAME/.github && cp .github/phpunit* $_
209+ env :
210+ DB : ${{steps.database-type.outputs.db}}
211+ COVERAGE : ${{ matrix.COVERAGE != 1 && '0' || '1' }}
212+ run : |
213+ if [ $COVERAGE == '1' ]
214+ then
215+ sed -n '1h;1!H;${;g;s/<\/php>/<\/php>\n\t<filter>\n\t\t<whitelist>\n\t\t\t<directory>..\/<\/directory>\n\t\t\t<exclude>\n\t\t\t\t<directory>..\/tests\/<\/directory>\n\t\t\t\t<directory>..\/language\/<\/directory>\n\t\t\t\t<directory>..\/migrations\/<\/directory>\n\t\t\t<\/exclude>\n\t\t<\/whitelist>\n\t<\/filter>/g;p;}' .github/phpunit-$DB-github.xml &> phpBB/ext/$EXTNAME/.github/phpunit-$DB-github.xml
216+ else
217+ mkdir -p phpBB/ext/$EXTNAME/.github && cp .github/phpunit* $_
218+ fi
197219 working-directory : ./phpBB3
198220
199221 - name : Run unit tests
200222 env :
201223 DB : ${{steps.database-type.outputs.db}}
202- run : phpBB/vendor/bin/phpunit --configuration phpBB/ext/$EXTNAME/.github/phpunit-$DB-github.xml --bootstrap ./tests/bootstrap.php
224+ COVERAGE : ${{ matrix.COVERAGE != 1 && '0' || '1' }}
225+ run : |
226+ if [ $COVERAGE == '1' ]
227+ then
228+ phpBB/vendor/bin/phpunit --configuration phpBB/ext/$EXTNAME/.github/phpunit-$DB-github.xml --bootstrap ./tests/bootstrap.php --coverage-clover build/logs/clover.xml
229+ else
230+ phpBB/vendor/bin/phpunit --configuration phpBB/ext/$EXTNAME/.github/phpunit-$DB-github.xml --bootstrap ./tests/bootstrap.php
231+ fi
203232 working-directory : ./phpBB3
233+
234+ - name : Send code coverage
235+ if : ${{ matrix.COVERAGE == 1 }}
236+ uses : codecov/codecov-action@v1
237+ with :
238+ file : ./phpBB3/build/logs/clover.xml
204239 # END MySQL and MariaDB Job
205240
206241 # START PostgreSQL Job
@@ -221,6 +256,20 @@ jobs:
221256 db : " postgres:12"
222257 - php : ' 7.1'
223258 db : " postgres:13"
259+ - php : ' 7.2'
260+ db : " postgres:13"
261+ - php : ' 7.3'
262+ db : " postgres:13"
263+ - php : ' 7.4'
264+ db : " postgres:13"
265+ - php : ' 8.0'
266+ db : " postgres:12"
267+ - php : ' 8.0'
268+ db : " postgres:13"
269+ - php : ' 8.1'
270+ db : " postgres:14"
271+ - php : ' 8.2'
272+ db : " postgres:14"
224273
225274 name : PHP ${{ matrix.php }} - ${{ matrix.db }}
226275
0 commit comments