From a64b24dd740dc18930c56ab20898277cf467482d Mon Sep 17 00:00:00 2001 From: Stefano Arlandini Date: Sat, 10 Apr 2021 21:22:27 +0200 Subject: [PATCH 1/9] feat(Symfony Version) add symfony version. --- .github/workflows/tests.yaml | 48 ++++++++++++++++++++++++++---------- 1 file changed, 35 insertions(+), 13 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 86d1fe72..65b77f90 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -28,15 +28,20 @@ jobs: symfony_constraint: [''] experimental: [false] include: -# - description: 'sentry/sentry dev-develop' -# php: '7.4' -# sentry_constraint: 'dev-develop' -# experimental: true - description: 'DBAL 2' php: '7.4' dbal_constraint: '^2.13' + - description: 'Symfony 5.0' + php: '8.0' + symfony_constraint: 5.0.* + - description: 'Symfony 5.0' + php: '7.4' + symfony_constraint: 5.0.* - description: 'Symfony 4.4' - php: '7.3' + php: '8.0' + symfony_constraint: 4.4.* + - description: 'Symfony 4.4' + php: '7.4' symfony_constraint: 4.4.* - description: 'Symfony 3.4' php: '7.2' @@ -52,28 +57,45 @@ jobs: name: PHP ${{ matrix.php }} tests (${{ matrix.description }}) steps: - - uses: actions/checkout@v2 + - name: Checkout + uses: actions/checkout@v2 with: fetch-depth: 2 - - uses: actions/cache@v2 + + - name: Cache + uses: actions/cache@v2 with: path: ~/.composer/cache/files key: ${{ matrix.php }}-${{ matrix.symfony_constraint }}-${{ matrix.composer_option }} - - uses: shivammathur/setup-php@v2 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} coverage: xdebug + - name: Install Symfony Flex run: composer global require --no-progress --no-scripts --no-plugins symfony/flex - - run: composer remove --dev symfony/messenger --no-update + + - name: Remove Symfony Messenger + run: composer remove --dev symfony/messenger --no-update if: matrix.symfony_constraint == '3.4.*' || matrix.composer_option == '--prefer-lowest' + - run: composer require --dev doctrine/dbal ${{ matrix.dbal_constraint }} --no-update if: matrix.dbal_constraint - - run: composer update --no-progress --ansi ${{ matrix.composer_option }} - - run: composer require sentry/sentry dev-develop + + - name: Install dependencies + run: composer update --no-progress --ansi ${{ matrix.composer_option }} + + - name: Install Sentry + run: composer require sentry/sentry dev-develop if: matrix.sentry_constraint == 'dev-develop' - - run: vendor/bin/phpunit --coverage-clover=coverage.xml - - uses: codecov/codecov-action@v1 + + - name: Run PHPUnit tests + run: vendor/bin/phpunit --coverage-clover=coverage.xml + + - name: Run codecov + uses: codecov/codecov-action@v1 with: file: './coverage.xml' fail_ci_if_error: true From 836561165d0444910f01f5995572ede089e0e614 Mon Sep 17 00:00:00 2001 From: Stefano Arlandini Date: Sat, 10 Apr 2021 22:39:01 +0200 Subject: [PATCH 2/9] Improve the GitHub Actions workflow for the tests --- .github/workflows/tests.yaml | 104 ++++++++++++++--------------------- 1 file changed, 42 insertions(+), 62 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 65b77f90..444f83a9 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -1,4 +1,4 @@ -name: CI +name: Continuous Integration on: pull_request: null @@ -9,96 +9,76 @@ on: - 3.5.x jobs: - Tests: + tests: + name: Tests runs-on: ubuntu-latest - continue-on-error: ${{ matrix.experimental == true }} env: - SYMFONY_REQUIRE: ${{matrix.symfony_constraint}} + SYMFONY_REQUIRE: ${{ matrix.symfony-version }} strategy: fail-fast: false matrix: php: - - '8.1' - - '8.0' - - '7.4' - - '7.3' - '7.2' - sentry_constraint: [false] - dbal_constraint: [false] - symfony_constraint: [''] - experimental: [false] - include: - - description: 'DBAL 2' - php: '7.4' - dbal_constraint: '^2.13' - - description: 'Symfony 5.0' - php: '8.0' - symfony_constraint: 5.0.* - - description: 'Symfony 5.0' - php: '7.4' - symfony_constraint: 5.0.* - - description: 'Symfony 4.4' - php: '8.0' - symfony_constraint: 4.4.* - - description: 'Symfony 4.4' - php: '7.4' - symfony_constraint: 4.4.* - - description: 'Symfony 3.4' - php: '7.2' - symfony_constraint: 3.4.* - env: - SYMFONY_DEPRECATIONS_HELPER: disabled - - description: 'prefer lowest' - php: '7.2' - composer_option: '--prefer-lowest' - symfony_constraint: ^3.4.44 - env: - SYMFONY_DEPRECATIONS_HELPER: disabled - - name: PHP ${{ matrix.php }} tests (${{ matrix.description }}) + - '7.3' + - '7.4' + - '8.0' + - '8.1' + symfony-version: + - 3.4.* + - 4.4.* + - 5.2.* + dependencies: + - lowest + - highest + steps: - name: Checkout uses: actions/checkout@v2 with: fetch-depth: 2 - - name: Cache - uses: actions/cache@v2 - with: - path: ~/.composer/cache/files - key: ${{ matrix.php }}-${{ matrix.symfony_constraint }}-${{ matrix.composer_option }} - - name: Setup PHP uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} coverage: xdebug - - name: Install Symfony Flex - run: composer global require --no-progress --no-scripts --no-plugins symfony/flex + - name: Setup Problem Matchers for PHPUnit + run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" + + - name: Determine Composer cache directory + id: composer-cache + run: echo "::set-output name=directory::$(composer config cache-dir)" + + - name: Cache Composer dependencies + uses: actions/cache@v2 + with: + path: ${{ steps.composer-cache.outputs.directory }} + key: ${{ runner.os }}-${{ matrix.php }}-composer-${{ matrix.dependencies }}-${{ hashFiles('**/composer.lock') }} + restore-keys: ${{ runner.os }}-${{ matrix.php }}-${{ matrix.dependencies }}-composer- - name: Remove Symfony Messenger run: composer remove --dev symfony/messenger --no-update - if: matrix.symfony_constraint == '3.4.*' || matrix.composer_option == '--prefer-lowest' + if: matrix.symfony-version == '3.4.*' || matrix.composer_option == '--prefer-lowest' - - run: composer require --dev doctrine/dbal ${{ matrix.dbal_constraint }} --no-update - if: matrix.dbal_constraint + - name: Install Symfony Flex + run: composer global require --no-progress --no-scripts --no-plugins symfony/flex - - name: Install dependencies - run: composer update --no-progress --ansi ${{ matrix.composer_option }} + - name: Install highest dependencies + run: composer update --no-progress --no-interaction --prefer-dist + if: ${{ matrix.dependencies == 'highest' }} - - name: Install Sentry - run: composer require sentry/sentry dev-develop - if: matrix.sentry_constraint == 'dev-develop' + - name: Install lowest dependencies + run: composer update --no-progress --no-interaction --prefer-dist --prefer-lowest + if: ${{ matrix.dependencies == 'lowest' }} - - name: Run PHPUnit tests - run: vendor/bin/phpunit --coverage-clover=coverage.xml + - name: Run tests + run: vendor/bin/phpunit --coverage-clover=build/coverage-report.xml - - name: Run codecov + - name: Upload code coverage uses: codecov/codecov-action@v1 with: - file: './coverage.xml' - fail_ci_if_error: true + file: build/coverage-report.xml missing-optional-packages-tests: name: Tests without optional packages From b447f95efa7d30b0eea59eba7d8432e9a90d4019 Mon Sep 17 00:00:00 2001 From: Stefano Arlandini Date: Tue, 13 Apr 2021 21:21:22 +0200 Subject: [PATCH 3/9] Fix CR issues --- .github/workflows/tests.yaml | 50 +++++++++--------------------------- 1 file changed, 12 insertions(+), 38 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 444f83a9..3b043dbe 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -26,7 +26,7 @@ jobs: symfony-version: - 3.4.* - 4.4.* - - 5.2.* + - 5.* dependencies: - lowest - highest @@ -46,31 +46,18 @@ jobs: - name: Setup Problem Matchers for PHPUnit run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" - - name: Determine Composer cache directory - id: composer-cache - run: echo "::set-output name=directory::$(composer config cache-dir)" - - - name: Cache Composer dependencies - uses: actions/cache@v2 - with: - path: ${{ steps.composer-cache.outputs.directory }} - key: ${{ runner.os }}-${{ matrix.php }}-composer-${{ matrix.dependencies }}-${{ hashFiles('**/composer.lock') }} - restore-keys: ${{ runner.os }}-${{ matrix.php }}-${{ matrix.dependencies }}-composer- - - name: Remove Symfony Messenger run: composer remove --dev symfony/messenger --no-update - if: matrix.symfony-version == '3.4.*' || matrix.composer_option == '--prefer-lowest' + if: matrix.symfony-version == '3.4.*' - name: Install Symfony Flex run: composer global require --no-progress --no-scripts --no-plugins symfony/flex - - name: Install highest dependencies - run: composer update --no-progress --no-interaction --prefer-dist - if: ${{ matrix.dependencies == 'highest' }} - - - name: Install lowest dependencies - run: composer update --no-progress --no-interaction --prefer-dist --prefer-lowest - if: ${{ matrix.dependencies == 'lowest' }} + - name: Install dependencies + uses: ramsey/composer-install@v1 + with: + dependency-versions: ${{ matrix.dependencies }} + composer-options: --prefer-dist - name: Run tests run: vendor/bin/phpunit --coverage-clover=build/coverage-report.xml @@ -106,27 +93,14 @@ jobs: - name: Setup Problem Matchers for PHPUnit run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" - - name: Determine Composer cache directory - id: composer-cache - run: echo "::set-output name=directory::$(composer config cache-dir)" - - - name: Cache Composer dependencies - uses: actions/cache@v2 - with: - path: ${{ steps.composer-cache.outputs.directory }} - key: ${{ runner.os }}-${{ matrix.php }}-composer-${{ matrix.dependencies }}-${{ hashFiles('**/composer.lock') }} - restore-keys: ${{ runner.os }}-${{ matrix.php }}-composer-${{ matrix.dependencies }}- - - name: Remove optional packages run: composer remove doctrine/dbal doctrine/doctrine-bundle symfony/messenger symfony/twig-bundle symfony/cache --dev --no-update - - name: Install highest dependencies - run: composer update --no-progress --no-interaction --prefer-dist - if: ${{ matrix.dependencies == 'highest' }} - - - name: Install lowest dependencies - run: composer update --no-progress --no-interaction --prefer-dist --prefer-lowest - if: ${{ matrix.dependencies == 'lowest' }} + - name: Install dependencies + uses: ramsey/composer-install@v1 + with: + dependency-versions: ${{ matrix.dependencies }} + composer-options: --prefer-dist - name: Run tests run: vendor/bin/phpunit --coverage-clover=build/coverage-report.xml From 9e9e8d8161c0674d551425bbbb040fa69a0062dd Mon Sep 17 00:00:00 2001 From: Stefano Arlandini Date: Sun, 29 Aug 2021 17:19:14 +0200 Subject: [PATCH 4/9] Only test lowest deps on PHP `7.2` --- .github/workflows/tests.yaml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 3b043dbe..3b076028 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -28,8 +28,20 @@ jobs: - 4.4.* - 5.* dependencies: - - lowest - highest + exclude: + - php: '8.0' + symfony-version: 3.4.* + include: + - php: '7.2' + symfony-version: 3.4.* + dependencies: lowest + - php: '7.2' + symfony-version: 4.4.* + dependencies: lowest + - php: '7.2' + symfony-version: 5.* + dependencies: lowest steps: - name: Checkout From c339f02f1e52e96ece787a146000bd7340f42ec8 Mon Sep 17 00:00:00 2001 From: Stefano Arlandini Date: Sun, 29 Aug 2021 17:50:30 +0200 Subject: [PATCH 5/9] Install Symfony Flex via `shivammathur/setup-php` action --- .github/workflows/tests.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 3b076028..f85f9e42 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -54,6 +54,7 @@ jobs: with: php-version: ${{ matrix.php }} coverage: xdebug + tools: flex - name: Setup Problem Matchers for PHPUnit run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" @@ -62,9 +63,6 @@ jobs: run: composer remove --dev symfony/messenger --no-update if: matrix.symfony-version == '3.4.*' - - name: Install Symfony Flex - run: composer global require --no-progress --no-scripts --no-plugins symfony/flex - - name: Install dependencies uses: ramsey/composer-install@v1 with: From 377443f6ed22df4290e82afa06963417ff7b262b Mon Sep 17 00:00:00 2001 From: Stefano Arlandini Date: Mon, 30 Aug 2021 00:12:42 +0200 Subject: [PATCH 6/9] Switch code-coverage to Pcov --- .github/workflows/tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index f85f9e42..424de9ed 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -53,7 +53,7 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} - coverage: xdebug + coverage: pcov tools: flex - name: Setup Problem Matchers for PHPUnit From ecf3b4aca652a8b1d6c7a59ea71188b09ec34a14 Mon Sep 17 00:00:00 2001 From: Stefano Arlandini Date: Mon, 18 Oct 2021 23:39:37 +0200 Subject: [PATCH 7/9] Test PHP `8.1` also for the builds without optional packages installed --- .github/workflows/tests.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 424de9ed..43e1e790 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -86,6 +86,7 @@ jobs: php: - '7.2' - '8.0' + - '8.1' dependencies: - lowest - highest From 192463d89c9b80819c3fd60b21091ed3805a81fc Mon Sep 17 00:00:00 2001 From: Stefano Arlandini Date: Sat, 23 Oct 2021 19:17:09 +0200 Subject: [PATCH 8/9] Raise the minimum required version of PHPUnit to solve the compatibility issues with PHP `8.1` --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index da60537d..c6570f89 100644 --- a/composer.json +++ b/composer.json @@ -44,7 +44,7 @@ "phpstan/extension-installer": "^1.0", "phpstan/phpstan": "^0.12", "phpstan/phpstan-phpunit": "^0.12", - "phpunit/phpunit": "^8.5||^9.0", + "phpunit/phpunit": "^8.5.14||^9.0", "symfony/browser-kit": "^3.4.44||^4.4.20||^5.0.11", "symfony/cache": "^3.4.44||^4.4.20||^5.0.11", "symfony/dom-crawler": "^3.4.44||^4.4.20||^5.0.11", From 7463e64e7e2f25a11c75c0477ecd036d31dc4e2d Mon Sep 17 00:00:00 2001 From: Stefano Arlandini Date: Mon, 25 Oct 2021 19:54:37 +0200 Subject: [PATCH 9/9] Adjust the pipeline for the tests without the optional packages installed --- .github/workflows/tests.yaml | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 43e1e790..5859ede8 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -32,6 +32,8 @@ jobs: exclude: - php: '8.0' symfony-version: 3.4.* + - php: '8.1' + symfony-version: 3.4.* include: - php: '7.2' symfony-version: 3.4.* @@ -83,13 +85,15 @@ jobs: strategy: fail-fast: false matrix: - php: - - '7.2' - - '8.0' - - '8.1' - dependencies: - - lowest - - highest + include: + - php: '7.2' + dependencies: lowest + - php: '7.4' + dependencies: highest + - php: '8.0' + dependencies: lowest + - php: '8.1' + dependencies: highest steps: - name: Checkout