From d5b0a58b687cbbd1d85a5af356467d1f10e230e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ste=CC=81phane=20HULARD?= Date: Tue, 4 Oct 2022 11:54:37 +0200 Subject: [PATCH] chore(analysis): Enable Scrutinizer. --- .github/workflows/test-coverage.yml | 33 +++++++++++++++++++++++++++++ README.md | 3 +++ 2 files changed, 36 insertions(+) create mode 100644 .github/workflows/test-coverage.yml diff --git a/.github/workflows/test-coverage.yml b/.github/workflows/test-coverage.yml new file mode 100644 index 0000000..dd14d8b --- /dev/null +++ b/.github/workflows/test-coverage.yml @@ -0,0 +1,33 @@ +on: ["push", "pull_request"] + +name: Test coverage + +jobs: + build: + name: Build + runs-on: ubuntu-latest + steps: + - name: "Checkout" + uses: "actions/checkout@v3" + with: + # Fetch 10 commits or Scrutinizer will throw ("Failed to retrieve commit parents. If you use a shallow git checkout, please checkout at least a depth of one."), see: RepositoryIntrospector at scrutinizer-ci/ocular GitHub repository + # 10 commits is an arbitrary value that is more than 1 commit + fetch-depth: 10 + + - name: "Install PHP" + uses: "shivammathur/setup-php@v2" + with: + coverage: "pcov" + php-version: "8.1" + ini-values: memory_limit=-1 + + - name: "Install dependencies" + uses: "ramsey/composer-install@v2" + + - name: "Tests" + run: "vendor/bin/phpunit --coverage-clover=coverage.clover" + + - name: Upload Scrutinizer coverage + uses: sudo-bot/action-scrutinizer@latest + with: + cli-args: "--format=php-clover coverage.clover" diff --git a/README.md b/README.md index d5eb18f..faa7de7 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,8 @@ # Raven - How to test your API documentation and behavior. +[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/CHStudio/Raven/badges/quality-score.png?b=main)](https://scrutinizer-ci.com/g/CHStudio/Raven/?branch=main) +[![Code Coverage](https://scrutinizer-ci.com/g/CHStudio/Raven/badges/coverage.png?b=main)](https://scrutinizer-ci.com/g/CHStudio/Raven/?branch=main) + [![Latest Stable Version](https://poser.pugx.org/chstudio/raven/v/stable)](https://packagist.org/packages/chstudio/raven) [![License](https://poser.pugx.org/chstudio/raven/license)](https://packagist.org/packages/chstudio/raven)