-
-
Notifications
You must be signed in to change notification settings - Fork 408
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
minor #1424 [ci] windows tests on GitHub actions
- Loading branch information
Showing
7 changed files
with
174 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
name: "CI Windows" | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- 'main' | ||
schedule: | ||
- cron: '0 0 * * *' | ||
|
||
env: | ||
PHPUNIT_FLAGS: "-v" | ||
SYMFONY_PHPUNIT_DIR: "$HOME/symfony-bridge/.phpunit" | ||
MAKER_SKIP_MERCURE_TEST: 1 | ||
MAKER_SKIP_PANTHER_TEST: 1 | ||
MAKER_DISABLE_FILE_LINKS: 1 | ||
MAKER_ALLOW_DEV_DEPS_IN_APP: 0 | ||
SYMFONY_VERSION: '7.0.x-dev' | ||
|
||
jobs: | ||
tests: | ||
name: Testing on Windows | ||
runs-on: [windows-latest] | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
php-versions: [8.2] | ||
dependency-versions: ['highest'] | ||
steps: | ||
# This is needed in Windows, otherwise assertions comparing fixtures and generated code will fail. | ||
- name: Use INPUT for autocrlf in Git Config | ||
run: git config --global core.autocrlf input | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup SQLite For Entity Regen Tests | ||
run: | | ||
choco install sqlite --params "/NoTools" | ||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php-versions }} | ||
extensions: pdo, pdo_sqlite | ||
|
||
- name: Composer Install | ||
uses: "ramsey/composer-install@v2" | ||
with: | ||
dependency-versions: "${{ matrix.dependency-versions }}" | ||
|
||
- name: Composer install php-cs-fixer | ||
uses: "ramsey/composer-install@v2" | ||
with: | ||
composer-options: "--no-scripts --working-dir=tools/php-cs-fixer" | ||
|
||
- name: Composer install twigcs | ||
uses: "ramsey/composer-install@v2" | ||
with: | ||
composer-options: "--no-scripts --working-dir=tools/twigcs" | ||
|
||
- name: Install PHPUnit | ||
run: | | ||
vendor/bin/simple-phpunit install | ||
- name: PHPUnit Version | ||
run: vendor/bin/simple-phpunit --version | ||
|
||
- name: Run Tests | ||
run: vendor/bin/simple-phpunit ${{ env.PHPUNIT_FLAGS }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Symfony MakerBundle package. | ||
* | ||
* (c) Fabien Potencier <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Symfony\Bundle\MakerBundle\Tests; | ||
|
||
use PHPUnit\Framework\TestCase; | ||
use Symfony\Bundle\MakerBundle\Test\MakerTestEnvironment; | ||
|
||
class RegexTest extends TestCase | ||
{ | ||
/** @dataProvider regexDataProvider */ | ||
public function testRegex(string $data, array $expectedResult): void | ||
{ | ||
$result = []; | ||
|
||
preg_match_all(MakerTestEnvironment::GENERATED_FILES_REGEX, $data, $result, \PREG_PATTERN_ORDER); | ||
|
||
self::assertSame($expectedResult, $result[1]); | ||
} | ||
|
||
public function regexDataProvider(): \Generator | ||
{ | ||
yield 'Created Prefix' => ['created: test/something.php', ['test/something.php']]; | ||
yield 'Updated Prefix' => ['updated: test/something.php', ['test/something.php']]; | ||
yield 'Twig file' => ['created: test/something.html.twig', ['test/something.html.twig']]; | ||
yield 'Config file (no dir)' => ['updated: service.yaml', ['service.yaml']]; | ||
yield 'Line Char + 2 dir' => ['\n success\ncreated: test/somewhere/else.php\n', ['test/somewhere/else.php']]; | ||
yield 'Multiline' => [<<< 'EOT' | ||
Congrats!\n | ||
Created: some/file.php\n | ||
Updated: another/config.yaml\n | ||
\n | ||
EOT, | ||
['some/file.php', 'another/config.yaml'], | ||
]; | ||
yield 'Linux CI Results' => [<<< 'EOT' | ||
Bundled PHP-CS-Fixer & Bundled PHP-CS-Fixer Configuration\n | ||
\n | ||
created: \e]8;;file:///home/runner/work/maker-bundle/maker-bundle/tests/tmp/cache/maker_app_40cd750bba9870f18aada2478b24840a_6.4.x-dev/tests/FooBarTest.php#L1\e\tests/FooBarTest.php\e]8;;\e\\n | ||
\n | ||
EOT, | ||
['tests/FooBarTest.php'], | ||
]; | ||
yield 'Windows CI Results' => [<<< 'EOT' | ||
Bundled PHP-CS-Fixer & Bundled PHP-CS-Fixer Configuration\r\n | ||
\r\n | ||
created: tests/FooBarTest.php\r\n | ||
\r\n | ||
EOT, | ||
['tests/FooBarTest.php'], | ||
]; | ||
} | ||
} |