Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,14 @@ jobs:
- run: vendor/bin/rector process --dry-run
if: ${{ failure() || success() }}

- run: XDEBUG_MODE=coverage vendor/bin/phpunit --coverage-clover ./clover.xml --log-junit ./phpunit.report.xml
if: ${{ failure() || success() }}

# https://community.sonarsource.com/t/code-coverage-doesnt-work-with-github-action/16747
# $GITHUB_WORKSPACE contains a slash so @ is used as delimiter
- run: sed -i 's@'$GITHUB_WORKSPACE'@/github/workspace/@g' clover.xml
- run: sed -i 's@'$GITHUB_WORKSPACE'@/github/workspace/@g' phpunit.report.xml

- uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
Expand All @@ -48,3 +56,6 @@ jobs:
-Dsonar.projectKey=assoconnect_linxo-client
-Dsonar.organization=assoconnect
-Dsonar.sources=src
-Dsonar.tests=tests
-Dsonar.php.coverage.reportPaths=clover.xml
-Dsonar.php.tests.reportPath=phpunit.report.xml
13 changes: 13 additions & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="./vendor/autoload.php" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd">
<testsuites>
<testsuite name="main">
<directory>./tests/</directory>
</testsuite>
</testsuites>
<source>
<include>
<directory suffix=".php">./src</directory>
</include>
</source>
</phpunit>
Loading