Skip to content

Commit dcb1bcf

Browse files
author
Patrick
committed
add coveralls.io workflow
1 parent 2845f94 commit dcb1bcf

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

.github/workflows/coveralls.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Generate Coveralls Report
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
10+
build:
11+
name: Build
12+
runs-on: ubuntu-latest
13+
steps:
14+
15+
- name: Checkout code
16+
uses: actions/checkout@v2
17+
18+
- name: Setup PHP
19+
uses: shivammathur/setup-php@v2
20+
with:
21+
php-version: 7.4
22+
extensions: mbstring
23+
coverage: pcov
24+
tools: composer:v2
25+
26+
- name: Cache dependencies
27+
uses: actions/cache@v2
28+
with:
29+
path: ~/.composer/cache/files
30+
key: dependencies-php-7.4-composer-${{ hashFiles('composer.json') }}
31+
32+
- name: Install dependencies
33+
run: composer install --prefer-dist --no-interaction --optimize-autoloader
34+
35+
- name: Generate Coverage
36+
run: vendor/bin/phpunit --coverage-clover build/logs/clover.xml
37+
38+
- name: Upload coverage results to Coveralls
39+
env:
40+
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41+
run: |
42+
composer global require php-coveralls/php-coveralls
43+
php-coveralls --coverage_clover=build/logs/clover.xml -v
44+

0 commit comments

Comments
 (0)