Skip to content

Commit

Permalink
[TASK] Add tests to CI (#18)
Browse files Browse the repository at this point in the history
* [TASK] Add tests to CI

* Add coveralls

* Add codeCoverageIgnore annotations
  • Loading branch information
buchmarv authored Oct 7, 2024
1 parent 9d6fd68 commit 5f39ad7
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 1 deletion.
16 changes: 15 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
with:
php-version: ${{ matrix.php }}
extensions: mbstring, xml, ctype, iconv
coverage: none
coverage: pcov

- name: Cache composer dependencies
uses: actions/cache@v3
Expand All @@ -58,3 +58,17 @@ jobs:
run: |
git status
git status | grep -q "nothing to commit, working tree clean"
- name: Tests
run: |
php -dpcov.enabled=1 -dpcov.directory="." -dxdebug.mode="coverage" ./vendor/bin/phpunit -c build/phpunit.xml.dist --log-junit var/log/junit/phpunit.junit.xml --coverage-clover var/log/junit/coverage.xml --coverage-xml var/log/junit/coverage-xml/
env:
COMPOSER_PROCESS_TIMEOUT: 1200

- name: Upload coverage results to Coveralls
continue-on-error: true
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
composer global require php-coveralls/php-coveralls --no-progress --no-suggest --no-interaction
/home/runner/.composer/vendor/bin/php-coveralls -c build/.coveralls.yml -vvv --json_path=var/log/coveralls-upload.json
1 change: 1 addition & 0 deletions build/.coveralls.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
coverage_clover: var/log/junit/coverage.xml
3 changes: 3 additions & 0 deletions src/Exception/NoTokenException.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@

namespace T3G\Bundle\Keycloak\Exception;

/**
* @codeCoverageIgnore
*/
class NoTokenException extends \Exception
{
}
3 changes: 3 additions & 0 deletions src/Security/KeyCloakUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@

use Symfony\Component\Security\Core\User\UserInterface;

/**
* @codeCoverageIgnore
*/
class KeyCloakUser implements UserInterface
{
private string $identifier;
Expand Down
3 changes: 3 additions & 0 deletions src/T3GKeycloakBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
use Symfony\Component\HttpKernel\Bundle\Bundle;
use T3G\Bundle\Keycloak\DependencyInjection\T3GKeycloakExtension;

/**
* @codeCoverageIgnore
*/
final class T3GKeycloakBundle extends Bundle
{
/**
Expand Down
3 changes: 3 additions & 0 deletions src/Validator/Name.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@

use Symfony\Component\Validator\Constraint;

/**
* @codeCoverageIgnore
*/
#[\Attribute]
class Name extends Constraint
{
Expand Down

0 comments on commit 5f39ad7

Please sign in to comment.