Skip to content

Commit

Permalink
+ upload coverage for python
Browse files Browse the repository at this point in the history
  • Loading branch information
hiqsol committed Oct 17, 2016
1 parent 633e5a9 commit 9cc31f7
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 43 deletions.
9 changes: 6 additions & 3 deletions src/config/hidev.php
Expand Up @@ -15,9 +15,6 @@
'scrutinizer' => [
'class' => 'hidev\scrutinizer\controllers\ScrutinizerController',
],
'scrutinizer-python' => [
'class' => 'hidev\scrutinizer\controllers\ScrutinizerPythonController',
],
'.scrutinizer.yml' => [
'class' => 'hidev\scrutinizer\controllers\ScrutinizerYamlController',
],
Expand All @@ -28,6 +25,12 @@
'scrutinizer.build' => '[![Scrutinizer Build Status](https://img.shields.io/scrutinizer/build/g/{{ config.github.full_name }}.svg)](https://scrutinizer-ci.com/g/{{ config.github.full_name }}/build-status/master)',
],
],
'binaries' => [
'ocular' => [
'class' => \hidev\base\BinaryPython::class,
'package' => 'scrutinizer-ocular',
],
],
],
],
];
22 changes: 19 additions & 3 deletions src/controllers/ScrutinizerController.php
Expand Up @@ -16,12 +16,18 @@
*/
class ScrutinizerController extends \hidev\controllers\CommonController
{
public function getLanguage()
{
return $this->takeGoal('.travis.yml')->getItem('language');
}

public function actionUploadCoverage()
{
return $this->runActions(['wget-ocular', 'run-ocular']);
$lang = $this->getLanguage();
return $this->runActions(["get-ocular-$lang", "run-ocular-$lang"]);
}

public function actionWgetOcular()
public function actionGetOcularPhp()
{
if (file_exists('ocular.phar')) {
return 0;
Expand All @@ -30,8 +36,18 @@ public function actionWgetOcular()
return $this->passthru('wget', 'https://scrutinizer-ci.com/ocular.phar');
}

public function actionRunOcular()
public function actionRunOcularPhp()
{
return $this->passthru('ocular', ['code-coverage:upload', '--format=php-clover', 'coverage.clover']);
}

public function actionGetOcularPython()
{
return null;
}

public function actionRunOcularPython()
{
return $this->passthru('ocular', ['--data-file', '.coverage']);
}
}
37 changes: 0 additions & 37 deletions src/controllers/ScrutinizerPythonController.php

This file was deleted.

0 comments on commit 9cc31f7

Please sign in to comment.