Skip to content

Commit

Permalink
Add coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
deff-dev committed Aug 21, 2023
1 parent 814a312 commit 76002dd
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@
/phpunit.xml export-ignore
/psalm-baseline.xml export-ignore
/psalm.xml export-ignore
/clover.xml export-ignore
14 changes: 12 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches:
- 'release'
- 'hotfix'
- 'feature/coverage-badge'

permissions:
contents: read
Expand Down Expand Up @@ -314,6 +315,8 @@ jobs:

unit-tests:
runs-on: ubuntu-latest
permissions:
contents: write

strategy:
fail-fast: true
Expand Down Expand Up @@ -344,13 +347,20 @@ jobs:
with:
php-version: ${{ matrix.php }}
extensions: dom, libxml, mbstring
coverage: none
coverage: xdebug

- name: Install dependencies
run: composer install --no-interaction --no-progress --no-suggest --prefer-dist

- name: Execute unit tests
run: composer u-tests
run: XDEBUG_MODE_COVERAGE=coverage composer u-tests

- name: Generate test coverage badge
uses: timkrase/[email protected]
with:
coverage_badge_path: '.github/badge.svg'
push_badge: true
repo_token: ${{ secrets.GITHUB_TOKEN }}

php-salm:
runs-on: ubuntu-latest
Expand Down
3 changes: 3 additions & 0 deletions phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
<include>
<directory suffix=".php">./src</directory>
</include>
<report>
<clover outputFile="clover.xml" />
</report>
</coverage>

<testsuites>
Expand Down

0 comments on commit 76002dd

Please sign in to comment.