Skip to content

Commit c7a2195

Browse files
authored
Merge pull request #4 from Sweetchuck/circleci
Upgrade dependencies
2 parents 4ed5531 + 6720f23 commit c7a2195

18 files changed

+1383
-859
lines changed

.circleci/config.yml

Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
2+
version: 2.1
3+
4+
.env_composer: &env_composer
5+
COMPOSER_NO_INTERACTION: '1'
6+
COMPOSER_MEMORY_LIMIT: '-1'
7+
COMPOSER_DISABLE_XDEBUG_WARN: '1'
8+
9+
orbs:
10+
codecov: codecov/codecov@1.0.5
11+
12+
executors:
13+
php704:
14+
environment:
15+
<<: *env_composer
16+
17+
docker:
18+
-
19+
name: 'main'
20+
image: 'circleci/php:7.4'
21+
22+
php703:
23+
environment:
24+
<<: *env_composer
25+
26+
docker:
27+
-
28+
name: 'main'
29+
image: 'circleci/php:7.3'
30+
31+
php702:
32+
environment:
33+
<<: *env_composer
34+
35+
docker:
36+
-
37+
name: 'main'
38+
image: 'circleci/php:7.2'
39+
40+
commands:
41+
composer_install:
42+
description: 'Install Composer dependencies with cache restore and save'
43+
steps:
44+
-
45+
restore_cache:
46+
name: 'Composer - cache restore'
47+
keys:
48+
- 'composer-{{ checksum "./composer.lock" }}-1'
49+
50+
-
51+
run:
52+
name: 'Composer - install'
53+
command: >
54+
[[ -d "$(composer config vendor-dir)" ]] || composer install --no-progress
55+
56+
-
57+
save_cache:
58+
name: 'Composer - cache save'
59+
key: 'composer-{{ checksum "./composer.lock" }}-1'
60+
paths:
61+
- './bin/'
62+
- './vendor/'
63+
- '~/.composer/cache/'
64+
65+
lint:
66+
description: 'Run linters'
67+
steps:
68+
-
69+
run:
70+
name: 'Run linters'
71+
command: 'bin/robo lint'
72+
73+
test:
74+
description: 'Run tests'
75+
steps:
76+
-
77+
run:
78+
name: 'Codeception - unit'
79+
command: 'bin/robo test unit'
80+
-
81+
codecov/upload:
82+
flags: 'unit'
83+
file: './tests/_output/machine/coverage/unit/coverage.xml'
84+
-
85+
run:
86+
name: 'Codeception - acceptance'
87+
command: 'bin/robo test acceptance'
88+
-
89+
codecov/upload:
90+
flags: 'acceptance'
91+
file: './tests/_output/machine/coverage/acceptance/coverage.xml'
92+
-
93+
store_test_results:
94+
name: 'Store unit test results'
95+
path: './tests/_output/machine/junit'
96+
97+
jobs:
98+
build:
99+
executor: 'php702'
100+
working_directory: '~/repo'
101+
steps:
102+
- 'checkout'
103+
- 'composer_install'
104+
lint:
105+
executor: 'php702'
106+
working_directory: '~/repo'
107+
steps:
108+
- 'checkout'
109+
- 'composer_install'
110+
- 'lint'
111+
test_php704:
112+
executor: 'php704'
113+
working_directory: '~/repo'
114+
steps:
115+
- 'checkout'
116+
- 'composer_install'
117+
- 'test'
118+
test_php703:
119+
executor: 'php703'
120+
working_directory: '~/repo'
121+
steps:
122+
- 'checkout'
123+
- 'composer_install'
124+
- 'test'
125+
test_php702:
126+
executor: 'php702'
127+
working_directory: '~/repo'
128+
steps:
129+
- 'checkout'
130+
- 'composer_install'
131+
- 'test'
132+
133+
workflows:
134+
lint_and_test:
135+
jobs:
136+
-
137+
build: {}
138+
-
139+
lint:
140+
requires:
141+
- build
142+
-
143+
test_php704:
144+
requires:
145+
- build
146+
-
147+
test_php703:
148+
requires:
149+
- build
150+
-
151+
test_php702:
152+
requires:
153+
- build

.travis.yml

Lines changed: 0 additions & 37 deletions
This file was deleted.

RoboFile.php

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ class RoboFile extends Tasks
6060
protected $envVarNamePrefix = '';
6161

6262
/**
63-
* Allowed values: dev, ci, prod.
63+
* Allowed values: local, dev, ci, prod.
6464
*
6565
* @var string
6666
*/
@@ -342,7 +342,7 @@ protected function getTaskCodeceptRunSuite(string $suite, array $options = []):
342342
}
343343

344344
if ($withUnitReportXml) {
345-
$jUnitFilePath = "machine/junit/$suite/junit.$suite.xml";
345+
$jUnitFilePath = "machine/junit/junit.$suite.xml";
346346
$dirToCreate = Path::getDirectory("$logDir/$jUnitFilePath");
347347

348348
$cmdPattern .= ' --xml=%s';
@@ -377,8 +377,9 @@ protected function getTaskCodeceptRunSuite(string $suite, array $options = []):
377377
'{command}' => $command,
378378
]
379379
));
380-
$process = new Process($command, null, null, null, null);
381-
$exitCode = $process->run(function ($type, $data) {
380+
$process = Process::fromShellCommandline($command, null, null, null, null);
381+
382+
return $process->run(function ($type, $data) {
382383
switch ($type) {
383384
case Process::OUT:
384385
$this->output()->write($data);
@@ -389,8 +390,6 @@ protected function getTaskCodeceptRunSuite(string $suite, array $options = []):
389390
break;
390391
}
391392
});
392-
393-
return $exitCode;
394393
});
395394
}
396395

@@ -430,22 +429,9 @@ protected function getTaskPhpcsLint(): CollectionBuilder
430429
return $this->taskPhpcsLintFiles($options);
431430
}
432431

433-
protected function isPhpExtensionAvailable(string $extension): bool
434-
{
435-
$command = sprintf('%s -m', escapeshellcmd($this->getPhpExecutable()));
436-
437-
$process = new Process($command);
438-
$exitCode = $process->run();
439-
if ($exitCode !== 0) {
440-
throw new \RuntimeException('@todo');
441-
}
442-
443-
return in_array($extension, explode("\n", $process->getOutput()));
444-
}
445-
446432
protected function isPhpDbgAvailable(): bool
447433
{
448-
$command = sprintf('%s -qrr', escapeshellcmd($this->getPhpdbgExecutable()));
434+
$command = [$this->getPhpdbgExecutable(), '-qrr'];
449435

450436
return (new Process($command))->run() === 0;
451437
}
@@ -486,7 +472,7 @@ protected function validateArgCodeceptionSuiteNames(array $suiteNames)
486472
{
487473
$invalidSuiteNames = array_diff($suiteNames, $this->getCodeceptionSuiteNames());
488474
if ($invalidSuiteNames) {
489-
throw new \InvalidArgumentException(
475+
throw new InvalidArgumentException(
490476
'The following Codeception suite names are invalid: ' . implode(', ', $invalidSuiteNames),
491477
1
492478
);

codeception.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ paths:
1111
envs: tests/_envs
1212

1313
settings:
14-
bootstrap: _bootstrap.php
1514
colors: true
1615
memory_limit: 1024M
1716

composer.json

Lines changed: 30 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,47 @@
11
{
2+
"type": "robo-tasks",
23
"name": "sweetchuck/robo-stringy",
3-
"description": "Template to create a new Robo task.",
4+
"description": "Exposes Stringy string manipulation methods",
5+
"keywords": [
6+
"robo-tasks",
7+
"stringy"
8+
],
9+
"authors": [
10+
{
11+
"name": "Dávid Andor",
12+
"role": "Maintainer",
13+
"homepage": "https://github.com/Sweetchuck"
14+
}
15+
],
16+
"support": {
17+
"source": "https://github.com/Sweetchuck/robo-stringy",
18+
"issues": "https://github.com/Sweetchuck/robo-stringy/issues"
19+
},
420
"license": "GPL-2.0-or-later",
21+
"minimum-stability": "dev",
22+
"prefer-stable": true,
523
"config": {
624
"optimize-autoloader": true,
725
"preferred-install": "dist",
826
"bin-dir": "bin",
927
"sort-packages": true
1028
},
11-
"minimum-stability": "dev",
12-
"prefer-stable": true,
1329
"require": {
14-
"php": ">=7.1",
15-
"consolidation/robo": "^1.2",
30+
"php": ">=7.2",
31+
"consolidation/robo": "^2.0",
1632
"danielstjules/stringy": "^3.1"
1733
},
1834
"require-dev": {
19-
"codeception/codeception": "^2.2",
20-
"sweetchuck/codeception-module-robo-task-runner": "^0.4.0",
35+
"codeception/codeception": "^4.0",
36+
"codeception/module-asserts": "^1.1",
37+
"squizlabs/php_codesniffer": "^3.5",
38+
"sweetchuck/codeception-module-robo-task-runner": "^0.7",
2139
"sweetchuck/git-hooks": "^0.0",
22-
"sweetchuck/robo-git": "^0.0",
23-
"sweetchuck/robo-phpcs": "^0.0",
24-
"symfony/finder": "^3.2 || ^4.0",
25-
"symfony/yaml": "^3.2 || ^4.0",
40+
"sweetchuck/robo-git": "^0.2",
41+
"sweetchuck/robo-phpcs": "^0.1",
42+
"symfony/error-handler": "^5.0",
43+
"symfony/finder": "^4.0",
44+
"symfony/yaml": "^4.0",
2645
"webmozart/path-util": "^2.3"
2746
},
2847
"autoload": {

0 commit comments

Comments
 (0)