Skip to content

Commit

Permalink
(feat) code KPI (#388)
Browse files Browse the repository at this point in the history
* (feat) code KPI

* (feat) update README
  • Loading branch information
kevincobain2000 authored Sep 5, 2024
1 parent 28283b9 commit 0bdb2fd
Show file tree
Hide file tree
Showing 3 changed files with 87 additions and 8 deletions.
76 changes: 76 additions & 0 deletions .github/workflows/coveritup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
on:
- push

name: "CoveritUp"

jobs:
test:
runs-on: ubuntu-latest

strategy:
matrix:
php: [8.3]
name: PHP ${{ matrix.php }}

steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}

- name: Checkout
uses: actions/checkout@v2

- name: Install tools
run: |
curl -sLk https://raw.githubusercontent.com/kevincobain2000/cover-totalizer/master/install.sh | sh
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-versions }}

- name: Install PHP with extensions
uses: shivammathur/setup-php@v2
with:
coverage: pcov
extensions: intl, gd, zip, pdo, sqlite, pdo_sqlite, dom, curl, libxml, mbstring, fileinfo, exif, iconv
ini-values: memory_limit=-1,disable_functions="",pcov.exclude="~(vendor|tests|node_modules)~",pcov.directory="./"
php-version: ${{ matrix.php }}
tools: composer:v2

- name: NPM Install Time
uses: kevincobain2000/action-coveritup@v2
with:
type: npm-install-time
metric: sec
command: cd ui/; npm install
record: runtime

- name: Composer Install Time
uses: kevincobain2000/action-coveritup@v2
with:
type: composer-install-time
metric: sec
command: composer install
record: runtime

- name: PHPUNIT Tests
uses: kevincobain2000/action-coveritup@v2
with:
type: phpunit-run-time
metric: sec
command: ./vendor/bin/phpunit --coverage-clover=coverage.xml
record: runtime

- name: Code Coverage
uses: kevincobain2000/action-coveritup@v2
with:
type: phpunit-coverage
metric: '%'
command: ./cover-totalizer coverage.xml

- name: "Comment on PR"
uses: kevincobain2000/action-coveritup@v2
with:
pr_comment: true
diff_types: phpunit-coverage
8 changes: 1 addition & 7 deletions .github/workflows/phptest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,4 @@ jobs:
- name: PHPUNIT Tests
run: |
./vendor/bin/phpunit --coverage-clover=coverage.xml
- name: Upload to codecov
uses: codecov/codecov-action@v3
with:
name: PHP ${{ matrix.php }}
files: coverage.xml
./vendor/bin/phpunit
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,18 @@
<p align="center">
<img src="https://github.com/rakutentech/laravel-request-docs/actions/workflows/node.yml/badge.svg?branch=master" alt="CI Node">
<img src="https://github.com/rakutentech/laravel-request-docs/actions/workflows/phptest.yml/badge.svg?branch=master" alt="CI PHP">
<a href="https://codecov.io/gh/rakutentech/laravel-request-docs"><img src="https://codecov.io/gh/rakutentech/laravel-request-docs/branch/master/graph/badge.svg?token=U6ZRDPY6QZ" alt="codecov"></a>
</p>

![npm-install-time](https://coveritup.app/badge?org=rakutentech&repo=laravel-request-docs&branch=master&type=npm-install-time)
![composer-install-time](https://coveritup.app/badge?org=rakutentech&repo=laravel-request-docs&branch=master&type=composer-install-time)
![phpunit-run-time](https://coveritup.app/badge?org=rakutentech&repo=laravel-request-docs&branch=master&type=phpunit-run-time)
![phpunit-coverage](https://coveritup.app/badge?org=rakutentech&repo=laravel-request-docs&branch=master&type=phpunit-coverage)

![npm-install-time](https://coveritup.app/chart?org=rakutentech&repo=laravel-request-docs&branch=master&type=npm-install-time&theme=light&line=fill&width=150&height=150&output=svg&line=fill)
![composer-install-time](https://coveritup.app/chart?org=rakutentech&repo=laravel-request-docs&branch=master&type=composer-install-time&theme=light&line=fill&width=150&height=150&output=svg&line=fill)
![phpunit-run-time](https://coveritup.app/chart?org=rakutentech&repo=laravel-request-docs&branch=master&type=phpunit-run-time&theme=light&line=fill&width=150&height=150&output=svg&line=fill)
![phpunit-coverage](https://coveritup.app/chart?org=rakutentech&repo=laravel-request-docs&branch=master&type=phpunit-coverage&theme=light&line=fill&width=150&height=150&output=svg&line=fill)

**Fast** Install on any Laravel Project

**Hassle Free** Auto Generate API Documentation for request rules and parameters
Expand Down

0 comments on commit 0bdb2fd

Please sign in to comment.