Skip to content

ci: improve coverage report #6085

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 10, 2024
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
34 changes: 33 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,13 @@ jobs:
- GraphQl
- Serializer
- Symfony
include:
- php: '8.1'
coverage: true
- php: '8.2'
coverage: true
- php: '8.3'
coverage: true
fail-fast: false
steps:
- name: Checkout
Expand All @@ -219,7 +226,32 @@ jobs:
working-directory: src/${{ matrix.component }}
run: |
composer update
vendor/bin/simple-phpunit
vendor/bin/simple-phpunit --log-junit "build/logs/phpunit/junit.xml" ${{ matrix.coverage && '--coverage-clover build/logs/phpunit/clover.xml' || '' }}
- name: Upload test artifacts
if: always()
uses: actions/upload-artifact@v3
with:
name: "phpunit-logs-php${{ matrix.php }}-${{ matrix.component }}"
path: build/logs/phpunit
continue-on-error: true
- name: Upload coverage results to Codecov
if: matrix.coverage
uses: codecov/codecov-action@v3
with:
directory: build/logs/phpunit
name: "phpunit-php${{ matrix.php }}-${{ matrix.component }}"
flags: phpunit
fail_ci_if_error: true
continue-on-error: true
- name: Upload coverage results to Coveralls
if: matrix.coverage
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
composer global require --prefer-dist --no-interaction --no-progress --ansi php-coveralls/php-coveralls
export PATH="$PATH:$HOME/.composer/vendor/bin"
php-coveralls --coverage_clover "build/logs/phpunit/clover.xml"
continue-on-error: true

behat:
name: Behat (PHP ${{ matrix.php }})
Expand Down
1 change: 1 addition & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
<directory>features</directory>
<directory>tests</directory>
<directory>vendor</directory>
<directory>src/**/Tests/</directory>
<file>.php-cs-fixer.dist.php</file>
</exclude>
</coverage>
Expand Down
2 changes: 1 addition & 1 deletion tests/State/RespondProcessorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public function testRedirectToOperation(): void
$iriConverter = $this->prophesize(IriConverterInterface::class);
$iriConverter
->getIriFromResource(Argument::cetera())
->will(static function (array $args): ?string {
->will(static function (array $args): string {
return ($args[2] ?? null)?->getUriTemplate() ?? '/default';
});

Expand Down