From 2f542c9c65272e19a4ce0f1fae2d5f85edd25c98 Mon Sep 17 00:00:00 2001 From: Titouan Mathis Date: Mon, 23 Nov 2020 15:58:09 +0100 Subject: [PATCH] Upload code coverage to Codecov.io --- .github/workflows/tests.yml | 12 +++++++++++- .gitignore | 1 + README.md | 1 + 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f2beada..d60beea 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -79,4 +79,14 @@ jobs: composer_version: 1 - name: Pest - run: ./vendor/bin/pest + run: ./vendor/bin/pest --coverage --coverage-clover='coverage.xml' + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v1 + with: + token: ${{ secrets.CODECOV_TOKEN }} + file: ./coverage.xml + flags: unittests + fail_ci_if_error: true + path_to_write_report: ./codecov_report.txt + verbose: true diff --git a/.gitignore b/.gitignore index 961265b..3a1e387 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ # Ignore directories generated by Composer /composer.phar /vendor/ +coverage.xml diff --git a/README.md b/README.md index cdfdda3..320c86f 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ [![Packagist Version](https://img.shields.io/github/v/release/studiometa/wp-toolkit?include_prereleases&label=packagist&style=flat-square)](https://packagist.org/packages/studiometa/wp) [![License MIT](https://img.shields.io/packagist/l/studiometa/wp-toolkit?style=flat-square)](https://packagist.org/packages/studiometa/wp) +[![Codecov](https://img.shields.io/codecov/c/github/studiometa/wp-toolkit?style=flat-square)](https://codecov.io/gh/studiometa/wp-toolkit/) > A PHP toolkit to boost your WordPress development! 🚀