Skip to content

Commit

Permalink
Set up SonarCloud
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromegamez committed Mar 15, 2019
1 parent a175d28 commit f230e94
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 12 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@
/phive.xml export-ignore
/phpstan.neon.dist export-ignore
/phpunit.xml.dist export-ignore
/sonar-project.properties export-ignore
18 changes: 11 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,21 @@ php:
- 7.1
- 7.2
- 7.3
- nightly

matrix:
fast_finish: true
allow_failures:
- php: nightly

cache:
directories:
- $HOME/.composer/cache

addons:
sonarcloud:
organization: "jeromegamez-github"

git:
depth: false

install: composer update --no-interaction --no-suggest --no-progress

script: composer test-ci
script:
- vendor/bin/phpstan analyze -c phpstan.neon.dist --no-interaction --no-progress
- vendor/bin/phpunit -c phpunit.xml.dist --coverage-clover=coverage-report.clover --log-junit=test-report.xml
- sonar-scanner
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ Working with durations made easy.

[![Current version](https://img.shields.io/packagist/v/gamez/duration.svg)](https://packagist.org/packages/gamez/duration)
[![Supported PHP version](https://img.shields.io/packagist/php-v/gamez/duration.svg)]()

[![Build Status](https://travis-ci.com/jeromegamez/duration-php.svg?branch=master)](https://travis-ci.com/jeromegamez/duration-php)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=jeromegamez_duration-php&metric=alert_status)](https://sonarcloud.io/dashboard?id=jeromegamez_duration-php)
[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=jeromegamez_duration-php&metric=sqale_rating)](https://sonarcloud.io/dashboard?id=jeromegamez_duration-php)
[![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=jeromegamez_duration-php&metric=reliability_rating)](https://sonarcloud.io/dashboard?id=jeromegamez_duration-php)
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=jeromegamez_duration-php&metric=coverage)](https://sonarcloud.io/dashboard?id=jeromegamez_duration-php)

Do you like to use `DateInterval` to compute and work with durations? Me neither, so let's fix that!

Expand Down
5 changes: 0 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,8 @@
},
"scripts": {
"test": ["@phpunit", "@phpstan"],
"test-ci": ["@phpunit-ci", "@phpstan-ci"],

"coverage": "vendor/bin/phpunit --coverage-html=build/coverage",

"phpunit": "vendor/bin/phpunit --testdox",
"phpunit-ci": "vendor/bin/phpunit -c phpunit.xml.dist --testdox",

"phpstan": "vendor/bin/phpstan analyze",
"phpstan-ci": "vendor/bin/phpstan analyze -c phpstan.neon.dist --no-interaction --no-progress"
},
Expand Down
9 changes: 9 additions & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
sonar.projectKey=jeromegamez_duration-php
sonar.projectName=Durations for PHP

sonar.sources=src
sonar.tests=tests
sonar.language=php
sonar.sourceEncoding=UTF-8
sonar.php.coverage.reportPaths=coverage-report.clover
sonar.php.tests.reportPath=test-report.xml

0 comments on commit f230e94

Please sign in to comment.