Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add coverage report #10

Merged
merged 8 commits into from
Oct 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ jobs:
- uses: shivammathur/setup-php@v2
with:
php-version: "8.2"
coverage: xdebug

- name: Cache Composer dependencies
uses: actions/cache@v3
Expand All @@ -49,5 +50,14 @@ jobs:
- name: Directory Permissions
run: sudo chown -R $(whoami) skeleton vendor/pestphp/pest/.temp

- name: Execute tests
run: ./vendor/bin/testbench package:test --bail --retry
# Create coverage report directory
- run: mkdir -p build/logs

- name: Execute tests - coverage threshold 90%
run: ./vendor/bin/pest --bail --retry --coverage --min=90 --coverage-clover build/logs/clover.xml

- name: Create coverage badge
uses: coverallsapp/github-action@v2
with:
format: clover
file: build/logs/clover.xml
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Extendible workspace configurator for Laravel to effortlessly keep linters, fixe

[![codestyle](https://github.com/media-code/workspace/actions/workflows/codestyle.yml/badge.svg)](https://github.com/media-code/workspace/actions/workflows/codestyle.yml)
[![tests](https://github.com/media-code/workspace/actions/workflows/tests.yml/badge.svg)](https://github.com/media-code/workspace/actions/workflows/tests.yml)
[![coverage](https://coveralls.io/repos/github/media-code/workspace/badge.svg)](https://coveralls.io/github/media-code/workspace)

## Install Workspace in your project

Expand All @@ -21,12 +22,12 @@ php artisan workspace:install

Workspace will add a couple of `artisan` commands to your project to help keep Integrations in sync with upstream changes:

``` bash
```bash
# Install configured Integrations
php artisan workspace:install
php artisan workspace:install

# Updates workspace & Integration dependencies + rebuilds configs
php artisan workspace:update
php artisan workspace:update

# Integrates configured Integrations with your editor
php artisan workspace:integrate
Expand Down Expand Up @@ -83,7 +84,7 @@ Workspace checks if your working directory is clean (has no uncommitted files) b

## Overriding default Integrations

Workspace's ships with the following default Integrations:
Workspace ships with the following default Integrations:

```php
return [
Expand Down
7 changes: 7 additions & 0 deletions phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,16 @@
<directory suffix="Test.php">./tests/Unit</directory>
</testsuite>
</testsuites>

<source>
<include>
<directory suffix=".php">./src</directory>
</include>
</source>

<coverage>
<include>
<directory suffix=".php">./src</directory>
</include>
</coverage>
</phpunit>