Skip to content

Commit 723da75

Browse files
authored
Merge pull request #34 from dotkernel/issue33
implemented codecov
2 parents 9382289 + 96dfb44 commit 723da75

File tree

5 files changed

+57
-4
lines changed

5 files changed

+57
-4
lines changed

.github/workflows/codecov.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
on:
2+
- push
3+
4+
name: Run Codecov checks
5+
6+
jobs:
7+
code-coverage:
8+
name: Code Coverage
9+
10+
runs-on: ${{ matrix.os }}
11+
12+
strategy:
13+
matrix:
14+
os:
15+
- ubuntu-latest
16+
17+
php:
18+
- "8.1"
19+
- "8.2"
20+
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v3
24+
25+
- name: Install PHP
26+
uses: shivammathur/setup-php@v2
27+
with:
28+
php-version: "${{ matrix.php }}"
29+
coverage: pcov
30+
ini-values: assert.exception=1, zend.assertions=1, error_reporting=-1, log_errors_max_len=0, display_errors=On
31+
tools: composer:v2, cs2pr
32+
33+
- name: Determine composer cache directory
34+
run: echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_ENV
35+
36+
- name: Cache dependencies installed with composer
37+
uses: actions/cache@v3
38+
with:
39+
path: ${{ env.COMPOSER_CACHE_DIR }}
40+
key: php${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
41+
restore-keys: |
42+
php${{ matrix.php }}-composer-
43+
- name: Install dependencies with composer
44+
run: composer install --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
45+
46+
- name: Collect code coverage with PHPUnit
47+
run: vendor/bin/phpunit --colors=always --coverage-clover clover.xml
48+
49+
- name: Send code coverage report to Codecov.io
50+
uses: codecov/codecov-action@v3
51+
with:
52+
token: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/cs-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
restore-keys: |
4141
php${{ matrix.php }}-composer-
4242
- name: Install dependencies with composer
43-
run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
43+
run: composer install --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
4444

4545
- name: Run phpcs checks
4646
run: vendor/bin/phpcs

.github/workflows/static-analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
restore-keys: |
4141
php${{ matrix.php }}-composer-
4242
- name: Install dependencies with composer
43-
run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
43+
run: composer install --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
4444

4545
- name: Run static analysis
4646
run: vendor/bin/psalm --no-cache --output-format=github --show-info=false --threads=4

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,15 @@
33
This package contains controller like middleware to be used inside a DotKernel or Mezzio application. It provides base classes for action based controllers similar to Laminas controller component. It is more lightweight though, but supports controller plugins.
44

55
![OSS Lifecycle](https://img.shields.io/osslifecycle/dotkernel/dot-controller)
6-
![PHP from Packagist (specify version)](https://img.shields.io/packagist/php-v/dotkernel/dot-controller/3.4.0)
6+
![PHP from Packagist (specify version)](https://img.shields.io/packagist/php-v/dotkernel/dot-controller/3.4.2)
77

88
[![GitHub issues](https://img.shields.io/github/issues/dotkernel/dot-controller)](https://github.com/dotkernel/dot-controller/issues)
99
[![GitHub forks](https://img.shields.io/github/forks/dotkernel/dot-controller)](https://github.com/dotkernel/dot-controller/network)
1010
[![GitHub stars](https://img.shields.io/github/stars/dotkernel/dot-controller)](https://github.com/dotkernel/dot-controller/stargazers)
1111
[![GitHub license](https://img.shields.io/github/license/dotkernel/dot-controller)](https://github.com/dotkernel/dot-controller/blob/3.0/LICENSE.md)
1212

1313
[![Build Static](https://github.com/dotkernel/dot-controller/actions/workflows/static-analysis.yml/badge.svg?branch=3.0)](https://github.com/dotkernel/dot-controller/actions/workflows/static-analysis.yml)
14+
[![codecov](https://codecov.io/gh/dotkernel/dot-controller/graph/badge.svg?token=VUBG5LM4CK)](https://codecov.io/gh/dotkernel/dot-controller)
1415

1516
[![SymfonyInsight](https://insight.symfony.com/projects/c4aac671-40d7-4590-b1fa-b3e46a1e3f43/big.svg)](https://insight.symfony.com/projects/c4aac671-40d7-4590-b1fa-b3e46a1e3f43)
1617

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
],
2020
"require": {
2121
"php": "~8.1.0 || ~8.2.0",
22-
"psr/http-message": "^1.0.1",
22+
"psr/http-message": "^1.0 || ^2.0",
2323
"laminas/laminas-servicemanager": "^3.11.2",
2424
"dotkernel/dot-event": "^3.2.0",
2525
"mezzio/mezzio-template": "^2.4.0",

0 commit comments

Comments
 (0)