diff --git a/.github/workflows/codecoverage.yml b/.github/workflows/codecoverage.yml index 185aa04..e010dbf 100644 --- a/.github/workflows/codecoverage.yml +++ b/.github/workflows/codecoverage.yml @@ -1,10 +1,11 @@ --- -# This GitHub Actions workflow is calculating code coverage of extension and creates a badge for it. +# This GitHub Actions workflow calculates the code coverage of the extension and uploads it to coveralls.io. name: Code coverage on: push: branches: - main + pull_request: jobs: code-coverage: name: "Calculate code coverage" @@ -56,18 +57,10 @@ jobs: composer ci:coverage:functional - name: "Merge coverage results" run: composer ci:coverage:merge - - name: "Generate coverage badge" - uses: timkrase/phpunit-coverage-badge@v1.2.0 - with: - report: './build/logs/clover.xml' - coverage_badge_path: './coverage/badge.svg' - - name: "Commit PHPUnit coverage results" - uses: s0/git-publish-subdir-action@develop + - name: "Upload coverage results to Coveralls" env: - REPO: self - BRANCH: code-coverage-badge - FOLDER: coverage - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: ./.Build/vendor/bin/php-coveralls --coverage_clover=build/logs/clover.xml -v strategy: fail-fast: false matrix: diff --git a/.gitignore b/.gitignore index 2ac8f60..53ad3a3 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ /Resources/Private/package-lock.json /Resources/Private/yarn-error.log /Resources/Private/yarn.lock +/build /clover.xml /composer.lock /nbproject diff --git a/CHANGELOG.md b/CHANGELOG.md index 5f3a9ea..f90128d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ This project adheres to [Semantic Versioning](https://semver.org/). ## x.y.z ### Added +- Use Coveralls for the code coverage (#425) ### Changed - Use the TYPO3 Code of Conduct (#430) diff --git a/README.md b/README.md index 11a1a27..9fa84d5 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ [![TYPO3 V11](https://img.shields.io/badge/TYPO3-11-orange.svg)](https://get.typo3.org/version/11) [![GitHub CI status](https://github.com/TYPO3-Documentation/tea/workflows/CI/badge.svg?branch=main)](https://github.com/TYPO3-Documentation/tea/actions) [![GitLab CI status](https://gitlab.typo3.org/qa/example-extension/badges/main/pipeline.svg)](https://gitlab.typo3.org/qa/example-extension/-/pipelines) -[![Code Coverage Badge](https://github.com/TYPO3-Documentation/tea/blob/code-coverage-badge/badge.svg)](https://github.com/TYPO3-Documentation/tea/blob/code-coverage-badge/clover.xml) +[![Coverage Status](https://coveralls.io/repos/github/TYPO3-Documentation/tea/badge.svg?branch=main)](https://coveralls.io/github/TYPO3-Documentation/tea?branch=main) [![Total downloads](https://poser.pugx.org/ttn/tea/downloads.svg)](https://packagist.org/packages/ttn/tea) [![License](https://poser.pugx.org/ttn/tea/license.svg)](https://packagist.org/packages/ttn/tea) [![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.0-4baaaa.svg)](CODE_OF_CONDUCT.md) diff --git a/composer.json b/composer.json index d4760b3..a93ec69 100644 --- a/composer.json +++ b/composer.json @@ -40,6 +40,7 @@ "friendsofphp/php-cs-fixer": "^3.4.0", "helmich/typo3-typoscript-lint": "^2.5.2", "jangregor/phpstan-prophecy": "^1.0.0", + "php-coveralls/php-coveralls": "^2.5.2", "phpstan/extension-installer": "^1.1.0", "phpstan/phpstan": "^1.4.9", "phpstan/phpstan-phpunit": "^1.0.0",