Skip to content

Commit

Permalink
minor #1012 Run tests on PHP 8.1 (derrabus, weaverryan)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
weaverryan committed Nov 22, 2021
2 parents 0938791 + 8e9dc74 commit b4bc959
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ jobs:

env:
SYMFONY_VERSION: ${{ matrix.symfony-version }}
MAKER_ALLOW_DEV_DEPS_IN_APP: ${{ matrix.allow-dev-deps-in-apps }}

strategy:
fail-fast: false
Expand All @@ -96,6 +97,7 @@ jobs:
- '5.4.x-dev'
- '6.0.x-dev'
dependency-versions: ['highest']
allow-dev-deps-in-apps: ['0']
include:
# testing lowest PHP version with LTS
- php-version: '7.1.3'
Expand All @@ -106,6 +108,12 @@ jobs:
- php-version: '7.2.5'
symfony-version: '5.3.*'
dependency-versions: 'lowest'
# testing bleeding edge PHP with highest 5.x stable
- php-version: '8.1'
symfony-version: '5.3.*'
dependency-versions: 'highest'
# temporarily needed until some packages support php 8.1
allow-dev-deps-in-apps: '1'

steps:
- name: "Checkout code"
Expand Down
12 changes: 10 additions & 2 deletions src/Test/MakerTestEnvironment.php
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,11 @@ public function runPhpCSFixer(string $file): MakerTestProcess
throw new \Exception('php-cs-fixer not found: run: "composer install --working-dir=tools/php-cs-fixer".');
}

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)
->run(true);
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,
['PHP_CS_FIXER_IGNORE_ENV' => '1']
)->run(true);
}

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

if ($_SERVER['MAKER_ALLOW_DEV_DEPS_IN_APP'] ?? false) {
MakerTestProcess::create('composer config minimum-stability dev', $this->flexPath)->run();
MakerTestProcess::create('composer config prefer-stable true', $this->flexPath)->run();
}

// fetch a few packages needed for testing
MakerTestProcess::create('composer require phpunit browser-kit symfony/css-selector --prefer-dist --no-progress --no-suggest', $this->flexPath)
->run();
Expand Down

0 comments on commit b4bc959

Please sign in to comment.