Skip to content

Commit

Permalink
[TASK] Add coveralls for code coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
brotkrueml committed Dec 3, 2019
1 parent 984e5f1 commit 5d0cd5c
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .coveralls.yml
@@ -0,0 +1,3 @@
service_name: github-actions
coverage_clover: .Build/logs/clover.xml
json_path: .Build/logs/coveralls-upload.json
1 change: 1 addition & 0 deletions .gitattributes
@@ -1,3 +1,4 @@
/.coveralls.yml export-ignore
/.crowdin.yml export-ignore
/.editorconfig export-ignore
/.gitattributes export-ignore
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/ci.yml
Expand Up @@ -51,6 +51,30 @@ jobs:
- name: Run PHP linter
run: |
find . -name \*.php ! -path "./.Build/*" -exec php -l {} \;
- name: Run unit tests
run: |
.Build/bin/phpunit -c Tests/phpunit.xml.dist
code-coverage:
name: Code Coverage
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v1
with:
fetch-depth: 1
- name: Setup PHP version
uses: shivammathur/setup-php@v1
with:
php-version: 7.2
- name: Install composer dependencies
run: |
composer --version
composer install
- name: Run unit tests
run: |
.Build/bin/phpunit -c Tests/phpunit.xml.dist --log-junit .Build/logs/phpunit.xml --coverage-text --coverage-clover .Build/logs/clover.xml
- name: Send code coverage report to coveralls.io
run: .Build/bin/php-coveralls -v
env:
COVERALLS_RUN_LOCALLY: 1
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
1 change: 1 addition & 0 deletions README.md
@@ -1,6 +1,7 @@
# TYPO3 content element: Code snippet with syntax highlighting

[![CI Status](https://github.com/brotkrueml/codehighlight/workflows/CI/badge.svg?branch=master)](https://github.com/brotkrueml/codehighlight/actions?query=workflow%3ACI)
[![Coverage Status](https://coveralls.io/repos/github/brotkrueml/codehighlight/badge.svg?branch=master)](https://coveralls.io/github/brotkrueml/codehighlight?branch=master)
[![Crowdin](https://badges.crowdin.net/typo3-extension-codehighlight/localized.svg)](https://crowdin.com/project/typo3-extension-codehighlight)
[![Latest Stable Version](https://poser.pugx.org/brotkrueml/codehighlight/v/stable)](https://packagist.org/packages/brotkrueml/schema)

Expand Down
1 change: 1 addition & 0 deletions composer.json
Expand Up @@ -23,6 +23,7 @@
"typo3/cms-frontend": "^9.5.5 || ^10.0"
},
"require-dev": {
"php-coveralls/php-coveralls": "^2.2",
"phpunit/phpunit": "^8.4"
},
"suggest": {
Expand Down

0 comments on commit 5d0cd5c

Please sign in to comment.