Skip to content

Commit 918f366

Browse files
committed
Add codecov reports
1 parent 30d4c0b commit 918f366

File tree

1 file changed

+28
-1
lines changed

1 file changed

+28
-1
lines changed

.github/workflows/main.yml

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,31 @@ jobs:
5151
- name: Run PHP Coding Standards Fixer
5252
run: php-cs-fixer fix -v --dry-run --allow-risky=yes --using-cache=no
5353
- name: Run PHP_CodeSniffer
54-
run: phpcs -p --standard=PSR12 src tests
54+
run: phpcs -p --standard=PSR12 src tests --exclude=PSR12.Properties.ConstantVisibility
55+
coverage:
56+
runs-on: ubuntu-latest
57+
steps:
58+
- name: Checkout
59+
uses: actions/checkout@v2
60+
- name: Setup PHP
61+
uses: shivammathur/setup-php@v2
62+
with:
63+
php-version: '8.0'
64+
coverage: xdebug
65+
- name: Get composer cache directory
66+
id: composer-cache
67+
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
68+
- name: Cache composer dependencies
69+
uses: actions/cache@v2
70+
with:
71+
path: ${{ steps.composer-cache.outputs.dir }}
72+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
73+
restore-keys: ${{ runner.os }}-composer-
74+
- name: Install dependencies
75+
run: composer install --no-progress --prefer-dist --classmap-authoritative --no-interaction
76+
- name: Setup problem matchers for PHPUnit
77+
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
78+
- name: Test with phpunit
79+
run: vendor/bin/phpunit --coverage-clover coverage.xml
80+
- name: Upload coverage
81+
uses: codecov/codecov-action@v1

0 commit comments

Comments
 (0)