This repository has been archived by the owner on Aug 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
RoboFile.php
64 lines (51 loc) · 1.66 KB
/
RoboFile.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<?php
use \Robo\Tasks;
use coverallskit\BuilderConfiguration;
use coverallskit\CoverallsReportBuilder;
use holyshared\peridot\robo\loadTasks as PeridotTasks;
/**
* Class RoboFile
*/
class RoboFile extends Tasks
{
use PeridotTasks;
public function specAll()
{
$result = $this->taskPeridot()
->directoryPath('spec')
->reporter('dot')
->run();
return $result;
}
public function specCoveralls()
{
$configuration = BuilderConfiguration::loadFromFile('.coveralls.toml');
$builder = CoverallsReportBuilder::fromConfiguration($configuration);
$builder->build()->save()->upload();
}
public function specCoverallsSaveOnly()
{
$configuration = BuilderConfiguration::loadFromFile('.coveralls.toml');
$builder = CoverallsReportBuilder::fromConfiguration($configuration);
$builder->build()->save();
}
public function exampleBasic()
{
$runtime = 'php';
$enviromentValue = 'TRAVIS_JOB_ID=10';
$exampleScript = __DIR__ . '/example/basic_example.php';
$command = sprintf('%s %s %s', $enviromentValue, $runtime, $exampleScript);
return $this->taskExec($command)->run();
}
public function exampleHhvm()
{
if (defined('HHVM_VERSION') === false) {
throw new RuntimeException('Please install the hhvm');
}
$runtime = 'php';
$enviromentValue = 'TRAVIS_JOB_ID=10';
$exampleScript = __DIR__ . '/example/hhvm_example.php';
$command = sprintf('%s %s %s', $enviromentValue, $runtime, $exampleScript);
return $this->taskExec($command)->run();
}
}