Skip to content

Commit

Permalink
Merge pull request #9 from clementtalleu/feat/code_cov
Browse files Browse the repository at this point in the history
add codecov
  • Loading branch information
clementtalleu authored Jun 9, 2024
2 parents d001588 + 922d1dc commit d486c75
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 14 deletions.
27 changes: 15 additions & 12 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ test.php
/.php-cs-fixer.php
/.php-cs-fixer.cache
/.phpunit.cache/
Makefile
Makefile
coverage.xml
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ RUN install-php-extensions \
@composer \
intl \
json \
xdebug \
redis

WORKDIR /app
Expand Down
1 change: 1 addition & 0 deletions compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ services:
tty: true
environment:
REDIS_HOST: redis
XDEBUG_MODE: 'coverage'

volumes:
redis_data:
6 changes: 6 additions & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@
</testsuite>
</testsuites>

<coverage>
<report>
<clover outputFile="coverage/clover.xml"/>
</report>
</coverage>

<source ignoreIndirectDeprecations="true" restrictNotices="true" restrictWarnings="true">
<include>
<directory>src</directory>
Expand Down
1 change: 0 additions & 1 deletion tests/Functionnal/DataConsistency/ArrayConsistencyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit d486c75

Please sign in to comment.