Skip to content

Commit 9f44dfa

Browse files
committed
GH Actions: Added support for code coverage with Coveralls.io
1 parent 7adfefd commit 9f44dfa

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

.github/workflows/test.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,34 @@ jobs:
6363

6464
- name: Run unit tests
6565
run: composer phpunit
66+
67+
coverage:
68+
needs: test
69+
runs-on: ubuntu-latest
70+
71+
steps:
72+
- name: Checkout code
73+
uses: actions/checkout@v2
74+
75+
- name: Setup PHP
76+
uses: shivammathur/setup-php@v2
77+
with:
78+
php-version: '7.4'
79+
ini-values: zend.assertions=1, error_reporting=-1, display_errors=On
80+
coverage: xdebug
81+
82+
- name: Install Composer dependencies - normal
83+
uses: "ramsey/composer-install@v2"
84+
85+
- name: Run the unit tests with code coverage
86+
run: composer coverage
87+
88+
- name: Install Coveralls
89+
if: ${{ success() }}
90+
run: composer require php-coveralls/php-coveralls:"^2.5.2" --no-interaction
91+
92+
- name: Upload coverage results to Coveralls
93+
if: ${{ success() }}
94+
env:
95+
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
96+
run: vendor/bin/php-coveralls -v -x build/logs/clover.xml

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ PHP Console Color
55
[![CS](https://github.com/php-parallel-lint/PHP-Console-Color/actions/workflows/cs.yml/badge.svg)](https://github.com/php-parallel-lint/PHP-Console-Color/actions/workflows/cs.yml)
66
[![Test](https://github.com/php-parallel-lint/PHP-Console-Color/actions/workflows/test.yml/badge.svg)](https://github.com/php-parallel-lint/PHP-Console-Color/actions/workflows/test.yml)
77
[![License](https://poser.pugx.org/php-parallel-lint/php-console-color/license.svg)](https://packagist.org/packages/php-parallel-lint/php-console-color)
8+
[![Coverage Status](https://coveralls.io/repos/github/php-parallel-lint/PHP-Console-Color/badge.svg?branch=coveralls)](https://coveralls.io/github/php-parallel-lint/PHP-Console-Color?branch=coveralls)
89

910
Simple library for creating colored console ouput.
1011

0 commit comments

Comments
 (0)