Skip to content

Commit

Permalink
Try adding code coverage (#56)
Browse files Browse the repository at this point in the history
* Try adding some code coverage

* This

* Let's look

* hmm

* try this

* Better

* Try

* Love fiddlin

* meh

* maybe

* stop wastin time there

* bruh

* do this
  • Loading branch information
mhsdef authored Sep 15, 2024
1 parent 8ceabda commit 237ab86
Show file tree
Hide file tree
Showing 6 changed files with 626 additions and 331 deletions.
22 changes: 21 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,21 @@ jobs:
run: composer install --prefer-dist

- name: Run tests
if: ${{ matrix.php-version != '8.3' }}
run: composer test

- name: Run tests and generate coverage
if: ${{ matrix.php-version == '8.3' }}
run: composer test-coverage

- name: Upload coverage to Codecov
if: ${{ matrix.php-version == '8.3' }}
uses: codecov/codecov-action@v4
with:
files: ./coverage/phpunit/clover.xml
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

vitest:
runs-on: ubuntu-latest
steps:
Expand All @@ -47,4 +60,11 @@ jobs:
node-version-file: .nvmrc

- name: Run tests
run: npm run test:js
run: npm run test:js:coverage

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
files: ./coverage/vitest/clover.xml
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
"scripts": {
"phpcs": "phpcs",
"phpcs-fix": "phpcbf",
"test": "./vendor/bin/phpunit"
"test": "./vendor/bin/phpunit",
"test-coverage": "./vendor/bin/phpunit --coverage-clover ./coverage/phpunit/clover.xml"
},
"require": {
"php": ">=8.1",
Expand Down
Loading

0 comments on commit 237ab86

Please sign in to comment.