From da015d7762725c156bde4be74f9ee208bfd8ef50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gytis=20=C5=A0k=C4=97ma?= Date: Wed, 25 Oct 2023 14:13:05 +0300 Subject: [PATCH] build: use GH actions for coverage badge --- .github/workflows/ci.yml | 18 +++++++++++++++--- README.md | 8 ++------ composer.json | 4 +--- 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ca129e6..2a5a6e7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -39,6 +39,18 @@ jobs: composer test-coverage composer style - - name: Upload Coverage - if: github.repository_owner == 'gskema' - run: composer upload-coverage + - name: Make code coverage badge + uses: timkrase/phpunit-coverage-badge@v1.2.1 + with: + report: build/clover.xml + coverage_badge_path: output/coverage.svg + push_badge: false + + - name: Git push to image-data branch + uses: peaceiris/actions-gh-pages@v3 + with: + publish_dir: ./output + publish_branch: image-data + github_token: ${{ secrets.GITHUB_TOKEN }} + user_name: 'github-actions[bot]' + user_email: 'github-actions[bot]@users.noreply.github.com' diff --git a/README.md b/README.md index 9349f0e..448785d 100644 --- a/README.md +++ b/README.md @@ -3,8 +3,7 @@ [![Latest Version on Packagist][ico-version]][link-packagist] [![Software License][ico-license]](LICENSE.md) [![Build Status][ico-build]][link-build] -[![Coverage Status][ico-scrutinizer]][link-scrutinizer] -[![Quality Score][ico-code-quality]][link-code-quality] +[![Coverage Status][ico-coverage]][link-build] [![Total Downloads][ico-downloads]][link-downloads] Feature complete, object oriented, composable, extendable ElasticSearch query DSL builder for PHP. @@ -89,12 +88,9 @@ The MIT License (MIT). Please see [License File](LICENSE.md) for more informatio [ico-version]: https://img.shields.io/packagist/v/gskema/elasticsearch-query-dsl-php.svg?style=flat-square [ico-license]: https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square [ico-build]: https://img.shields.io/github/actions/workflow/status/gskema/elasticsearch-query-dsl-php/ci.yml?branch=6.x -[ico-scrutinizer]: https://img.shields.io/scrutinizer/coverage/g/gskema/elasticsearch-query-dsl-php.svg?style=flat-square -[ico-code-quality]: https://img.shields.io/scrutinizer/g/gskema/elasticsearch-query-dsl-php.svg?style=flat-square +[ico-coverage]: https://raw.githubusercontent.com/gskema/elasticsearch-query-dsl-php/image-data/badge.svg [ico-downloads]: https://img.shields.io/packagist/dt/gskema/elasticsearch-query-dsl-php.svg?style=flat-square [link-packagist]: https://packagist.org/packages/gskema/elasticsearch-query-dsl-php [link-build]: https://github.com/gskema/elasticsearch-query-dsl-php/actions -[link-scrutinizer]: https://scrutinizer-ci.com/g/gskema/elasticsearch-query-dsl-php/code-structure -[link-code-quality]: https://scrutinizer-ci.com/g/gskema/elasticsearch-query-dsl-php [link-downloads]: https://packagist.org/packages/gskema/elasticsearch-query-dsl-php diff --git a/composer.json b/composer.json index 707ff9e..c6abcd2 100644 --- a/composer.json +++ b/composer.json @@ -22,8 +22,7 @@ }, "require-dev": { "phpunit/phpunit" : "^10.4", - "squizlabs/php_codesniffer": "^3.7", - "scrutinizer/ocular": "^1.9" + "squizlabs/php_codesniffer": "^3.7" }, "autoload": { "psr-4": { @@ -39,7 +38,6 @@ "test": "vendor/bin/phpunit", "test-coverage": "vendor/bin/phpunit --coverage-clover=clover.xml", "test-coverage-local": "php -d xdebug.mode=coverage ./vendor/bin/phpunit --coverage-html=build/coverage", - "upload-coverage": "vendor/bin/ocular code-coverage:upload --format=php-clover coverage.xml;", "style": "@composer prep && ./vendor/bin/phpcs --standard=phpcs.xml -p" }, "config": {