Skip to content

Commit b4bc959

Browse files
committed
minor #1012 Run tests on PHP 8.1 (derrabus, weaverryan)
This PR was merged into the 1.0-dev branch. Discussion ---------- Run tests on PHP 8.1 Commits ------- 8e9dc74 allowing php-cs-fixer to use php 8.1 b96ef5c Attempting to allow dev deps for php 8.1 4d3af60 Run tests on PHP 8.1
2 parents 0938791 + 8e9dc74 commit b4bc959

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

.github/workflows/ci.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ jobs:
8484

8585
env:
8686
SYMFONY_VERSION: ${{ matrix.symfony-version }}
87+
MAKER_ALLOW_DEV_DEPS_IN_APP: ${{ matrix.allow-dev-deps-in-apps }}
8788

8889
strategy:
8990
fail-fast: false
@@ -96,6 +97,7 @@ jobs:
9697
- '5.4.x-dev'
9798
- '6.0.x-dev'
9899
dependency-versions: ['highest']
100+
allow-dev-deps-in-apps: ['0']
99101
include:
100102
# testing lowest PHP version with LTS
101103
- php-version: '7.1.3'
@@ -106,6 +108,12 @@ jobs:
106108
- php-version: '7.2.5'
107109
symfony-version: '5.3.*'
108110
dependency-versions: 'lowest'
111+
# testing bleeding edge PHP with highest 5.x stable
112+
- php-version: '8.1'
113+
symfony-version: '5.3.*'
114+
dependency-versions: 'highest'
115+
# temporarily needed until some packages support php 8.1
116+
allow-dev-deps-in-apps: '1'
109117

110118
steps:
111119
- name: "Checkout code"

src/Test/MakerTestEnvironment.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,8 +215,11 @@ public function runPhpCSFixer(string $file): MakerTestProcess
215215
throw new \Exception('php-cs-fixer not found: run: "composer install --working-dir=tools/php-cs-fixer".');
216216
}
217217

218-
return MakerTestProcess::create(sprintf('php tools/php-cs-fixer/vendor/bin/php-cs-fixer --config=%s fix --dry-run --diff %s', __DIR__.'/../Resources/test/.php_cs.test', $this->path.'/'.$file), $this->rootPath)
219-
->run(true);
218+
return MakerTestProcess::create(
219+
sprintf('php tools/php-cs-fixer/vendor/bin/php-cs-fixer --config=%s fix --dry-run --diff %s', __DIR__.'/../Resources/test/.php_cs.test', $this->path.'/'.$file),
220+
$this->rootPath,
221+
['PHP_CS_FIXER_IGNORE_ENV' => '1']
222+
)->run(true);
220223
}
221224

222225
public function runTwigCSLint(string $file): MakerTestProcess
@@ -262,6 +265,11 @@ private function buildFlexSkeleton(): void
262265
];
263266
$this->processReplacements($replacements, $this->flexPath);
264267

268+
if ($_SERVER['MAKER_ALLOW_DEV_DEPS_IN_APP'] ?? false) {
269+
MakerTestProcess::create('composer config minimum-stability dev', $this->flexPath)->run();
270+
MakerTestProcess::create('composer config prefer-stable true', $this->flexPath)->run();
271+
}
272+
265273
// fetch a few packages needed for testing
266274
MakerTestProcess::create('composer require phpunit browser-kit symfony/css-selector --prefer-dist --no-progress --no-suggest', $this->flexPath)
267275
->run();

0 commit comments

Comments
 (0)