Skip to content

Commit fd49170

Browse files
Progi1984Progi1984
authored andcommitted
Added coverage
1 parent d55f78c commit fd49170

File tree

3 files changed

+25
-1
lines changed

3 files changed

+25
-1
lines changed

.github/workflows/integration.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ jobs:
4040
timeout-minutes: 15
4141
env:
4242
VERSION: ${{ matrix.php }}-apache
43+
INSTALL_XDEBUG: ${{ (matrix.php == '8.4' && matrix.prestashop_version == 'develop') && true || false }}
4344
run: |
4445
cd prestashop
4546
USER_ID=$(id -u) GROUP_ID=$(id -g) PS_INSTALL_AUTO=0 docker compose build --no-cache && docker compose up -d --force-recreate
@@ -59,5 +60,17 @@ jobs:
5960
USER_ID=$(id -u) GROUP_ID=$(id -g) docker exec prestashop-prestashop-git-1 php bin/console prestashop:module install ps_apiresources
6061
USER_ID=$(id -u) GROUP_ID=$(id -g) docker exec prestashop-prestashop-git-1 composer create-test-db
6162
- name: Run integration tests
63+
env:
64+
XDEBUG_MODE: ${{ (matrix.php == '8.4' && matrix.prestashop_version == 'develop') && 'coverage' || 'none' }}
65+
CLI_OPTIONS: ${{ (matrix.php == '8.4' && matrix.prestashop_version == 'develop') && '' || ' --no-coverage' }}
6266
run : |
63-
USER_ID=$(id -u) GROUP_ID=$(id -g) docker exec prestashop-prestashop-git-1 vendor/bin/phpunit -c modules/ps_apiresources/tests/Integration/phpunit-ci.xml
67+
USER_ID=$(id -u) GROUP_ID=$(id -g) docker exec prestashop-prestashop-git-1 vendor/bin/phpunit -c modules/ps_apiresources/tests/Integration/phpunit-ci.xml ${{ env.CLI_OPTIONS }}
68+
69+
- name: Upload coverage results to Coveralls
70+
if: matrix.php == '8.4' && matrix.prestashop_version == 'develop'
71+
env:
72+
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
73+
run: |
74+
wget https://github.com/php-coveralls/php-coveralls/releases/download/v2.9.0/php-coveralls.phar
75+
chmod +x php-coveralls.phar
76+
php php-coveralls.phar --coverage_clover=prestashop/modules/ps_apiresources/tests/Integration/clover.xml -vvv

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33
.phpunit.result.cache
44
tests/local-parameters/parameters.php
55
tests/local-parameters/parameters.yml
6+
tests/Integration/clover.xml

tests/Integration/phpunit-ci.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,14 @@
1111
<directory>.</directory>
1212
</testsuite>
1313
</testsuites>
14+
<source>
15+
<include>
16+
<directory suffix=".php">../../src</directory>
17+
</include>
18+
</source>
19+
<coverage pathCoverage="true">
20+
<report>
21+
<clover outputFile="clover.xml"/>
22+
</report>
23+
</coverage>
1424
</phpunit>

0 commit comments

Comments
 (0)