From 1b92029b18e1104e0411e956cf0494d3e6eb7b1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois-Xavier=20de=20Guillebon?= Date: Thu, 29 Sep 2022 18:06:27 +0200 Subject: [PATCH] Add tests for symfony 6 (#1281) * Test symfony 6 * Use command constant if available --- .github/workflows/continuous-integration.yaml | 27 +++++++------------ Command/BaseBootstrapSymlinkCommand.php | 4 +-- Command/InstallFontCommand.php | 2 +- README.md | 24 ++++++++--------- 4 files changed, 25 insertions(+), 32 deletions(-) diff --git a/.github/workflows/continuous-integration.yaml b/.github/workflows/continuous-integration.yaml index 7469cdb6..7492cb57 100644 --- a/.github/workflows/continuous-integration.yaml +++ b/.github/workflows/continuous-integration.yaml @@ -30,27 +30,19 @@ jobs: phpunit: runs-on: 'ubuntu-20.04' - name: 'PHPUnit (PHP ${{ matrix.php }}, Symfony ${{ matrix.symfony }}, Twig ${{ matrix.twig }})' + name: 'PHPUnit (PHP ${{ matrix.php }}, Symfony ${{ matrix.symfony }})' timeout-minutes: 10 strategy: matrix: - php: - - '7.2' - - '7.3' - - '7.4' - - '8.0' - - '8.1' - symfony: - - '5.*' - twig: - - '3.*' - composer_flags: - - '--no-scripts --prefer-dist --prefer-stable' + php: ['8.1', '8.0'] + symfony: ['6.*', '5.*', '4.*'] include: - php: '7.2' - symfony: '4.4.*' + symfony: '5.*' + twig: '2.*' + - php: '7.2' + symfony: '4.*' twig: '2.*' - composer_flags: '--no-scripts --prefer-dist --prefer-lowest' fail-fast: false steps: - name: 'Checkout' @@ -82,8 +74,9 @@ jobs: env: SYMFONY_REQUIRE: '${{ matrix.symfony }}' run: | - composer require --no-progress --no-scripts --no-plugins symfony/flex - composer update --no-interaction --no-progress --ansi ${{ matrix.composer_flags }} + composer require --no-progress --no-scripts --no-plugins --no-update symfony/flex + [[ -n "${{ matrix.twig }}" ]] && composer require --no-progress --no-scripts --no-plugins --no-update twig/twig:${{ matrix.twig }} || true + composer update --no-interaction --no-progress --no-scripts --ansi ${{ matrix.composer_flags }} - name: 'Run unit tests' run: | diff --git a/Command/BaseBootstrapSymlinkCommand.php b/Command/BaseBootstrapSymlinkCommand.php index 8194c38f..22c6dcb1 100644 --- a/Command/BaseBootstrapSymlinkCommand.php +++ b/Command/BaseBootstrapSymlinkCommand.php @@ -179,7 +179,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int } else { $this->output->writeln('Could not find composer and manual option not specified!'); - return 0; + return \defined(Command::class.'::SUCCESS') ? Command::SUCCESS : 0; } // Automatically detect if on Win XP where symlink will allways fail @@ -206,7 +206,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $this->output->writeln(' ... OK'); - return 0; + return \defined(Command::class.'::SUCCESS') ? Command::SUCCESS : 0; } protected function getBootstrapPathsFromUser() diff --git a/Command/InstallFontCommand.php b/Command/InstallFontCommand.php index a488db48..72fa21fd 100644 --- a/Command/InstallFontCommand.php +++ b/Command/InstallFontCommand.php @@ -101,7 +101,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $output->writeln('Font: '.$this->iconSet.' Installed... OK'); - return 0; + return \defined(Command::class.'::SUCCESS') ? Command::SUCCESS : 0; } public static function installFonts() diff --git a/README.md b/README.md index d051537d..3d62ba8b 100644 --- a/README.md +++ b/README.md @@ -14,18 +14,18 @@ To use MopaBootstrapBundle and Twitter's Bootstrap 3 in your project add it via Versions and dependencies ------------------------- -| MopaBootstrapBundle | Bootstrap | Symfony | PHP | -| -------------------------- | --------- | ------------------------ | -------------- | -| [**3.4**] (**master**) | ^3.0 | ^4.4 \|\| ^5.1 \|\| ^6.1 | ^7.2 \|\| ^8.0 | -| [**3.3**] (**3.3**) | ^3.0 | ^2.3 \|\| ^3.0 \|\| ^4.0 | | -| [**3.2**] (*unmaintained*) | ^3.0 | ^2.3 \|\| ^3.0 | | -| [**3.1**] (*unmaintained*) | ^3.0 | ^2.3 \|\| ^3.0 | | -| [**3.0**] (*unmaintained*) | ^3.0 | ^2.3 \|\| ^3.0 | | -| [**2.3**] (*unmaintained*) | ^2.0 | ^2.3 | | -| [**2.2**] (*unmaintained*) | ^2.0 | >=2.1,<2.4 | | -| [**2.1**] (*unmaintained*) | ^2.0 | ~2.1.0 | | -| [**2.0**] (*unmaintained*) | ^2.0 | ~2.0.0 | | -| [**1.x**] (*unmaintained*) | ^1.0 | ^2.0 | | +| MopaBootstrapBundle | Bootstrap | Symfony | PHP | +|----------------------------|-----------|------------------------------------------|------------------------| +| [**3.4**] (**master**) | ^3.0 | ^4.4 || ^5.1 || ^6.0 | ^7.2 || ^8.0 | +| [**3.3**] (**3.3**) | ^3.0 | ^2.3 || ^3.0 || ^4.0 | | +| [**3.2**] (*unmaintained*) | ^3.0 | ^2.3 || ^3.0 | | +| [**3.1**] (*unmaintained*) | ^3.0 | ^2.3 || ^3.0 | | +| [**3.0**] (*unmaintained*) | ^3.0 | ^2.3 || ^3.0 | | +| [**2.3**] (*unmaintained*) | ^2.0 | ^2.3 | | +| [**2.2**] (*unmaintained*) | ^2.0 | >=2.1,<2.4 | | +| [**2.1**] (*unmaintained*) | ^2.0 | ~2.1.0 | | +| [**2.0**] (*unmaintained*) | ^2.0 | ~2.0.0 | | +| [**1.x**] (*unmaintained*) | ^1.0 | ^2.0 | | Updates -------