Skip to content

Commit

Permalink
Add coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
valentinbonneaud committed Nov 4, 2021
1 parent ea0bcee commit a1a3a76
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 7 deletions.
27 changes: 22 additions & 5 deletions .github/workflows/tests.yml → .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,29 @@ name: Tests
on: [push]

jobs:
build:
phpunit:
strategy:
matrix:
operating-system: [ubuntu-latest]
php-versions: ['7.4']

runs-on: ${{ matrix.operating-system }}

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, simplexml, dom
coverage: xdebug #optional
extensions: mbstring
coverage: pcov

- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache composer dependencies
uses: actions/cache@v2
with:
Expand All @@ -29,7 +34,19 @@ jobs:
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-

- name: Install dependencies
run: composer install --no-progress --prefer-dist --optimize-autoloader

- name: Test with phpunit
run: vendor/bin/phpunit --configuration ./tests/phpunit.xml
run: vendor/bin/phpunit --configuration ./tests/phpunit.xml --coverage-text --coverage-clover=coverage.xml

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
flags: tests
name: codecov-umbrella
yml: ./codecov.yml
fail_ci_if_error: true
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
sabre/vobject
=============
[![Build Status](https://img.shields.io/travis/ProtonMail/vobject?style=flat-square)](https://travis-ci.org/ProtonMail/vobject)
[![Coverage](https://img.shields.io/codecov/c/github/ProtonMail/vobject?style=flat-square)](https://codecov.io/gh/ProtonMail/vobject)
![Build Status](https://github.com/ProtonMail/vobject/actions/workflows/tests.yml/badge.svg)
[![codecov](https://codecov.io/gh/ProtonMail/vobject/branch/master/graph/badge.svg?token=ARcwkxCKZn)](https://codecov.io/gh/ProtonMail/vobject)


The VObject library allows you to easily parse and manipulate [iCalendar](https://tools.ietf.org/html/rfc5545)
Expand Down
19 changes: 19 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
comment:
layout: "reach, diff, flags, files"
behavior: default
require_changes: false

coverage:
range: "70..100"
round: down
precision: 2
status:
project:
default:
# basic
target: 95%
threshold: 0%
# advanced settings
if_ci_failed: error
informational: false
only_pulls: false

0 comments on commit a1a3a76

Please sign in to comment.