diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 1776577..a65e53f 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -27,37 +27,40 @@ jobs: env: REDIS_HOST: localhost steps: - - - name: Checkout + - name: Checkout uses: actions/checkout@v4 - - - name: Setup PHP + - name: Setup PHP uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-versions }} - extensions: redis + extensions: redis, xdebug env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Get composer cache directory + - name: Configure Xdebug + run: echo "xdebug.mode=coverage" | sudo tee -a /etc/php/${{ matrix.php-versions }}/cli/conf.d/20-xdebug.ini + - name: Get composer cache directory id: composer-cache run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT - - - name: Cache dependencies + - name: Cache dependencies uses: actions/cache@v4 with: path: ${{ steps.composer-cache.outputs.dir }} key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} restore-keys: ${{ runner.os }}-composer- - - - name: Install dependencies + - name: Install dependencies run: composer install --prefer-dist - name: Test cs-fixer run: vendor/bin/php-cs-fixer fix src --dry-run --diff --no-ansi - name: Run phpstan run: vendor/bin/phpstan analyse src --level=5 - name: Run tests - run: vendor/bin/phpunit + run: XDEBUG_MODE=coverage vendor/bin/phpunit + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v4 + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: ./coverage.xml + verbose: true - name: composer audit run: composer audit - name: composer validate diff --git a/.gitignore b/.gitignore index 5f7b2aa..9fde038 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,5 @@ test.php /.php-cs-fixer.php /.php-cs-fixer.cache /.phpunit.cache/ -Makefile \ No newline at end of file +Makefile +coverage.xml \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index b55ce1b..ac10d68 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,6 +4,7 @@ RUN install-php-extensions \ @composer \ intl \ json \ + xdebug \ redis WORKDIR /app diff --git a/compose.yaml b/compose.yaml index def35b5..5aa180b 100644 --- a/compose.yaml +++ b/compose.yaml @@ -17,6 +17,7 @@ services: tty: true environment: REDIS_HOST: redis + XDEBUG_MODE: 'coverage' volumes: redis_data: \ No newline at end of file diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 8bdc537..b4c16b9 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -12,6 +12,12 @@ + + + + + + src diff --git a/tests/Functionnal/DataConsistency/ArrayConsistencyTest.php b/tests/Functionnal/DataConsistency/ArrayConsistencyTest.php index 8f504be..4534e5d 100644 --- a/tests/Functionnal/DataConsistency/ArrayConsistencyTest.php +++ b/tests/Functionnal/DataConsistency/ArrayConsistencyTest.php @@ -7,7 +7,6 @@ use Talleu\RedisOm\Om\RedisObjectManager; use Talleu\RedisOm\Tests\Fixtures\Bar; use Talleu\RedisOm\Tests\Fixtures\Hash\ArrayHash; -use Talleu\RedisOm\Tests\Fixtures\Hash\DateHash; use Talleu\RedisOm\Tests\Fixtures\Json\ArrayJson; use Talleu\RedisOm\Tests\RedisAbstractTestCase;