From 4b361a0c0031167e7a9543c720f40b046bb8d32e Mon Sep 17 00:00:00 2001 From: Nicole Cordes Date: Fri, 2 Aug 2024 22:06:36 +0200 Subject: [PATCH 01/22] [BUGFIX] Fix StyleCI configuration --- .styleci.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.styleci.yml b/.styleci.yml index 4954816..4ba6e76 100644 --- a/.styleci.yml +++ b/.styleci.yml @@ -2,9 +2,12 @@ risky: true preset: psr12 +disabled: + - binary_operator_at_least_one_space + enabled: - alpha_ordered_imports - - binary_operator_spaces + - binary_operator_exactly_one_space - blank_line_before_return - hash_to_slash_comment - linebreak_after_opening_tag From a715056d5774f7894c4caa0b289ace0bac6efd3a Mon Sep 17 00:00:00 2001 From: Nicole Cordes Date: Fri, 2 Aug 2024 23:20:51 +0200 Subject: [PATCH 02/22] [FEATURE] Introduce GitHub Actions PHP linting --- .github/workflows/test.yml | 66 ++++++++++++++++++++++++++++++++++++++ composer.json | 3 +- 2 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..6934bc8 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,66 @@ +name: 🏃 tests + +on: [ push, pull_request, workflow_call ] + +jobs: + test: + name: 'COVERAGE: ${{ matrix.coverage }} - PHP: ${{ matrix.php }}' + + strategy: + fail-fast: false + matrix: + os: [ 'ubuntu-latest' ] + coverage: [ '~9.0.0', '~9.1.0', '~9.2.0', '~10.0.0', '~10.1.0' ] + php: [ '8.0', '8.1', '8.2', '8.3' ] + exclude: + - coverage: '~10.0.0' + php: '8.0' + - coverage: '~10.1.0' + php: '8.0' + + runs-on: ${{ matrix.os }} + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Store Composer cache directory + id: composer-cache + run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT + + - uses: actions/cache/restore@v4 + id: restore-composer-cache + with: + path: ${{ steps.composer-cache.outputs.dir }} + key: ${{ runner.os }}-composer-${{ matrix.coverage }}-${{ matrix.php }} + restore-keys: | + ${{ runner.os }}-composer-${{ matrix.coverage }}- + ${{ runner.os }}-composer- + + - name: Set up PHP Version ${{ matrix.php }} + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + coverage: xdebug + tools: composer:v2 + + - name: Environment Check + run: | + php --version + composer --version + mkdir -p .Log/coverage/ .Log/log/ + + - name: Validate composer.json + run: composer validate + + - name: Composer install + run: composer update --with "phpunit/php-code-coverage:${{ matrix.coverage }}" --no-interaction + + - name: Save composer cache + uses: actions/cache/save@v4 + with: + path: ${{ steps.composer-cache.outputs.dir }} + key: ${{ steps.restore-composer-cache.outputs.cache-primary-key }} + + - name: Lint PHP + run: php .Build/bin/parallel-lint --exclude .Build . diff --git a/composer.json b/composer.json index 942c390..3412e24 100644 --- a/composer.json +++ b/composer.json @@ -37,7 +37,8 @@ "require-dev": { "phpunit/phpunit": "^9.3 || ^10.0", "symfony/filesystem": ">=2.7 <7.0", - "phpspec/prophecy": "^1.0" + "phpspec/prophecy": "^1.0", + "php-parallel-lint/php-parallel-lint": "^1.4" }, "suggest": { "friendsofphp/php-cs-fixer": "Tool to automatically fix PHP coding standards issues" From 1522a5156ef6795726a8f5e22e3c00e2f19f4f72 Mon Sep 17 00:00:00 2001 From: Nicole Cordes Date: Fri, 2 Aug 2024 23:55:44 +0200 Subject: [PATCH 03/22] [FEATURE] Compute matrix values --- .github/workflows/compute.yml | 36 +++++++++++++++++++++++++++++++++++ .github/workflows/test.yml | 27 +++++++++++++------------- 2 files changed, 50 insertions(+), 13 deletions(-) create mode 100644 .github/workflows/compute.yml diff --git a/.github/workflows/compute.yml b/.github/workflows/compute.yml new file mode 100644 index 0000000..566f366 --- /dev/null +++ b/.github/workflows/compute.yml @@ -0,0 +1,36 @@ +name: ✏️ matrix + +on: + workflow_call: + outputs: + os: + value: ${{ jobs.compute.outputs.os }} + coverage: + value: ${{ jobs.compute.outputs.coverage }} + php: + value: ${{ jobs.compute.outputs.php }} + exclude: + value: ${{ jobs.compute.outputs.exclude }} + +env: + OS: '[ "ubuntu-latest" ]' + COVERAGE: '[ "~9.0.0", "~9.1.0", "~9.2.0", "~10.0.0", "~10.1.0" ]' + PHP: '[ "8.0", "8.1", "8.2", "8.3" ]' + EXCLUDE: '[ { "coverage": "~10.0.0", "php": "8.0" }, { "coverage": "~10.1.0", "php": "8.0" } ]' + +jobs: + compute: + name: Compute outputs + + runs-on: ubuntu-latest + + outputs: + os: ${{ env.OS }} + coverage: ${{ env.COVERAGE }} + php: ${{ env.PHP }} + exclude: ${{ env.EXCLUDE }} + + steps: + - name: Pseudo step + if: false + run: echo diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6934bc8..64d7fb3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -3,20 +3,21 @@ name: 🏃 tests on: [ push, pull_request, workflow_call ] jobs: - test: - name: 'COVERAGE: ${{ matrix.coverage }} - PHP: ${{ matrix.php }}' + compute: + uses: ./.github/workflows/compute.yml + + build: + name: 'Build COVERAGE: ${{ matrix.coverage }} - PHP: ${{ matrix.php }}' + + needs: [ compute ] strategy: fail-fast: false matrix: - os: [ 'ubuntu-latest' ] - coverage: [ '~9.0.0', '~9.1.0', '~9.2.0', '~10.0.0', '~10.1.0' ] - php: [ '8.0', '8.1', '8.2', '8.3' ] - exclude: - - coverage: '~10.0.0' - php: '8.0' - - coverage: '~10.1.0' - php: '8.0' + os: ${{ fromJson(needs.compute.outputs.os) }} + coverage: ${{ fromJson(needs.compute.outputs.coverage) }} + php: ${{ fromJson(needs.compute.outputs.php) }} + exclude: ${{ fromJson(needs.compute.outputs.exclude) }} runs-on: ${{ matrix.os }} @@ -32,10 +33,10 @@ jobs: id: restore-composer-cache with: path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-composer-${{ matrix.coverage }}-${{ matrix.php }} + key: ${{ runner.os }}-${{ matrix.php }}-${{ matrix.coverage }} restore-keys: | - ${{ runner.os }}-composer-${{ matrix.coverage }}- - ${{ runner.os }}-composer- + ${{ runner.os }}-${{ matrix.php }}- + ${{ runner.os }}- - name: Set up PHP Version ${{ matrix.php }} uses: shivammathur/setup-php@v2 From f096c24229e2211b572f8ed673887955d06420c6 Mon Sep 17 00:00:00 2001 From: Nicole Cordes Date: Sat, 3 Aug 2024 22:46:58 +0200 Subject: [PATCH 04/22] [FEATURE] Run PHPUnit tests and create artifacts --- .github/workflows/test.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 64d7fb3..ce094c2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -29,6 +29,12 @@ jobs: id: composer-cache run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT + - name: Store PHP code coverage version + id: version-cache + env: + COVERAGE: ${{ matrix.coverage }} + run: echo "version=$(echo $COVERAGE | tr -d -c 0-9)" >> $GITHUB_OUTPUT + - uses: actions/cache/restore@v4 id: restore-composer-cache with: @@ -65,3 +71,14 @@ jobs: - name: Lint PHP run: php .Build/bin/parallel-lint --exclude .Build . + + - name: Run PHPUnit + if: ${{ success() || failure() }} + run: .Build/bin/phpunit --log-junit .Log/log/junit_${{ steps.version-cache.outputs.version }}.xml --coverage-php .Log/coverage/coverage_${{ steps.version-cache.outputs.version }}.cov --coverage-filter src/ tests/ + + - name: Archive PHPUnit logs + uses: actions/upload-artifact@v4 + with: + name: phpunit-logs-${{ runner.os }}-${{ matrix.php }}-${{ matrix.coverage }} + path: .Log/* + retention-days: 1 From d193bd523c4227c6b29201810ead78fc0e1e1455 Mon Sep 17 00:00:00 2001 From: Nicole Cordes Date: Sat, 3 Aug 2024 23:00:16 +0200 Subject: [PATCH 05/22] [BUGFIX] Re-add compatibility to phpunit/php-code-coverage ^9.0 --- src/PhpunitMerger/Command/CoverageCommand.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/PhpunitMerger/Command/CoverageCommand.php b/src/PhpunitMerger/Command/CoverageCommand.php index a010cf6..144d6d6 100644 --- a/src/PhpunitMerger/Command/CoverageCommand.php +++ b/src/PhpunitMerger/Command/CoverageCommand.php @@ -5,6 +5,7 @@ namespace Nimut\PhpunitMerger\Command; use SebastianBergmann\CodeCoverage\CodeCoverage; +use SebastianBergmann\CodeCoverage\Driver\Driver; use SebastianBergmann\CodeCoverage\Driver\Selector; use SebastianBergmann\CodeCoverage\Filter; use SebastianBergmann\CodeCoverage\Report\Clover; @@ -85,6 +86,12 @@ private function getCodeCoverage() { $filter = new Filter(); + if (method_exists(Driver::class, 'forLineCoverage')) { + $driver = Driver::forLineCoverage($filter); + + return new CodeCoverage($driver, $filter); + } + return new CodeCoverage((new Selector())->forLineCoverage($filter), $filter); } From 6ee2a5e1d62ceeeda8e42beb662544bdb163099b Mon Sep 17 00:00:00 2001 From: Nicole Cordes Date: Sun, 4 Aug 2024 10:40:25 +0200 Subject: [PATCH 06/22] [BUGFIX] Streamline PHPUnit configuration --- phpunit.xml.dist | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 066b3e7..3a2bd2b 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -2,12 +2,7 @@ + executionOrder="depends,defects"> tests/PhpunitMerger/Command/Coverage From 261efdfc24b90794ccc2ce43f9666e968da9b0cc Mon Sep 17 00:00:00 2001 From: Nicole Cordes Date: Sun, 4 Aug 2024 22:58:55 +0200 Subject: [PATCH 07/22] [FEATURE] Add major version processing --- .github/workflows/compute.yml | 24 +++++++++++++++++++++--- .github/workflows/test.yml | 9 ++++++--- 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/.github/workflows/compute.yml b/.github/workflows/compute.yml index 566f366..3c03532 100644 --- a/.github/workflows/compute.yml +++ b/.github/workflows/compute.yml @@ -7,6 +7,8 @@ on: value: ${{ jobs.compute.outputs.os }} coverage: value: ${{ jobs.compute.outputs.coverage }} + major: + value: ${{ jobs.compute.outputs.major }} php: value: ${{ jobs.compute.outputs.php }} exclude: @@ -27,10 +29,26 @@ jobs: outputs: os: ${{ env.OS }} coverage: ${{ env.COVERAGE }} + major: ${{ steps.major-version.outputs.major }} php: ${{ env.PHP }} exclude: ${{ env.EXCLUDE }} steps: - - name: Pseudo step - if: false - run: echo + - name: Compute major versions + id: major-version + run: | + echo -e "COVERAGE\n" + echo $COVERAGE + echo -e "\n\nSplit by comma\n" + echo $COVERAGE | tr "," "\n" + echo -e "\n\nParse numbers\n" + echo $COVERAGE | tr "," "\n" | tr -cd "\n0-9" + echo -e "\n\nCut last 2 characters\n" + echo $COVERAGE | tr "," "\n" | tr -cd "\n0-9" | sed "s/.\{2\}$//" + echo -e "\n\nSort by version\n" + echo $COVERAGE | tr "," "\n" | tr -cd "\n0-9" | sed "s/.\{2\}$//" | sort -V + echo -e "\n\nUnique values only\n" + echo $COVERAGE | tr "," "\n" | tr -cd "\n0-9" | sed "s/.\{2\}$//" | sort -V | uniq + echo -e "\n\nCovert to JSON\n" + echo $COVERAGE | tr "," "\n" | tr -cd "\n0-9" | sed "s/.\{2\}$//" | sort -V | uniq | jq --compact-output --raw-input --slurp 'split("\n") | map(select(. != ""))' + echo "major=$(echo $COVERAGE | tr "," "\n" | tr -cd "\n0-9" | sed "s/.\{2\}$//" | sort -V | uniq | jq --compact-output --raw-input --slurp 'split("\n") | map(select(. != ""))')" >> $GITHUB_OUTPUT diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ce094c2..959dfb8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -33,14 +33,17 @@ jobs: id: version-cache env: COVERAGE: ${{ matrix.coverage }} - run: echo "version=$(echo $COVERAGE | tr -d -c 0-9)" >> $GITHUB_OUTPUT + run: | + echo "version=$(echo $COVERAGE | tr -d -c 0-9)" >> $GITHUB_OUTPUT + echo "major=$(echo $COVERAGE | tr -d -c 0-9 | sed 's/.\{2\}$//')" >> $GITHUB_OUTPUT - uses: actions/cache/restore@v4 id: restore-composer-cache with: path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-${{ matrix.php }}-${{ matrix.coverage }} + key: ${{ runner.os }}-${{ matrix.php }}-${{ steps.version-cache.outputs.major }}-${{ matrix.coverage }} restore-keys: | + ${{ runner.os }}-${{ matrix.php }}-${{ steps.version-cache.outputs.major }}- ${{ runner.os }}-${{ matrix.php }}- ${{ runner.os }}- @@ -79,6 +82,6 @@ jobs: - name: Archive PHPUnit logs uses: actions/upload-artifact@v4 with: - name: phpunit-logs-${{ runner.os }}-${{ matrix.php }}-${{ matrix.coverage }} + name: phpunit-logs-${{ runner.os }}-${{ matrix.php }}-${{ steps.version-cache.outputs.major }}-${{ matrix.coverage }} path: .Log/* retention-days: 1 From 722e1eb3d83a0431482c64b0d5954e9e46cc6406 Mon Sep 17 00:00:00 2001 From: Nicole Cordes Date: Mon, 5 Aug 2024 00:59:25 +0200 Subject: [PATCH 08/22] [FEATURE] Add merge testing job --- .github/workflows/compute.yml | 2 +- .github/workflows/test.yml | 76 +++++++++++++++++++++++++++++++++++ 2 files changed, 77 insertions(+), 1 deletion(-) diff --git a/.github/workflows/compute.yml b/.github/workflows/compute.yml index 3c03532..91131a4 100644 --- a/.github/workflows/compute.yml +++ b/.github/workflows/compute.yml @@ -18,7 +18,7 @@ env: OS: '[ "ubuntu-latest" ]' COVERAGE: '[ "~9.0.0", "~9.1.0", "~9.2.0", "~10.0.0", "~10.1.0" ]' PHP: '[ "8.0", "8.1", "8.2", "8.3" ]' - EXCLUDE: '[ { "coverage": "~10.0.0", "php": "8.0" }, { "coverage": "~10.1.0", "php": "8.0" } ]' + EXCLUDE: '[ { "coverage": "10", "php": "8.0" }, { "coverage": "~10.0.0", "php": "8.0" }, { "coverage": "~10.1.0", "php": "8.0" } ]' jobs: compute: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 959dfb8..152bea7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -85,3 +85,79 @@ jobs: name: phpunit-logs-${{ runner.os }}-${{ matrix.php }}-${{ steps.version-cache.outputs.major }}-${{ matrix.coverage }} path: .Log/* retention-days: 1 + + merge: + name: 'Merge COVERAGE: ${{ matrix.coverage }} - PHP: ${{ matrix.php }}' + + needs: [ compute, build ] + + strategy: + fail-fast: false + matrix: + os: ${{ fromJson(needs.compute.outputs.os) }} + coverage: ${{ fromJson(needs.compute.outputs.major) }} + php: ${{ fromJson(needs.compute.outputs.php) }} + exclude: ${{ fromJson(needs.compute.outputs.exclude) }} + + runs-on: ${{ matrix.os }} + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Download PHPUnit logs + uses: actions/download-artifact@v4 + with: + path: .Log + pattern: phpunit-logs-${{ runner.os }}-${{ matrix.php }}-${{ matrix.coverage }}-* + merge-multiple: true + + - name: Store Composer cache directory + id: composer-cache + run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT + + - uses: actions/cache/restore@v4 + id: restore-composer-cache + with: + path: ${{ steps.composer-cache.outputs.dir }} + key: ${{ runner.os }}-${{ matrix.php }}-${{ matrix.coverage }} + restore-keys: | + ${{ runner.os }}-${{ matrix.php }}- + ${{ runner.os }}- + + - name: Set up PHP Version ${{ matrix.php }} + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + coverage: xdebug + tools: composer:v2 + + - name: Environment Check + run: | + php --version + composer --version + + - name: Validate composer.json + run: composer validate + + - name: Composer install + run: composer update --with "phpunit/php-code-coverage:^${{ matrix.coverage }}.0" --no-interaction + + - name: Save composer cache + uses: actions/cache/save@v4 + with: + path: ${{ steps.composer-cache.outputs.dir }} + key: ${{ steps.restore-composer-cache.outputs.cache-primary-key }} + + - name: Merge log files + run: bin/phpunit-merger log .Log/log/ .Log/junit.xml + + - name: Merge coverage files + run: bin/phpunit-merger coverage .Log/coverage/ .Log/coverage.xml + + - name: Archive PHPUnit logs + uses: actions/upload-artifact@v4 + with: + name: phpunit-logs-merged-${{ runner.os }}-${{ matrix.php }}-${{ matrix.coverage }} + path: .Log/* + retention-days: 1 From 9d32123cff765ed0b13103b87c6869b39bee0d43 Mon Sep 17 00:00:00 2001 From: Nicole Cordes Date: Mon, 5 Aug 2024 02:00:03 +0200 Subject: [PATCH 09/22] [TASK] Increase log files --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 152bea7..caf2671 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -77,7 +77,7 @@ jobs: - name: Run PHPUnit if: ${{ success() || failure() }} - run: .Build/bin/phpunit --log-junit .Log/log/junit_${{ steps.version-cache.outputs.version }}.xml --coverage-php .Log/coverage/coverage_${{ steps.version-cache.outputs.version }}.cov --coverage-filter src/ tests/ + run: find 'tests' -wholename '*Test.php' | parallel --gnu 'echo -e "\n\nRunning test {}"; HASH=${{ steps.version-cache.outputs.version }}_$( echo {} | md5sum | cut -d " " -f 1); .Build/bin/phpunit --log-junit .Log/log/junit_$HASH.xml --coverage-php .Log/coverage/coverage_$HASH.cov --coverage-filter src/ {}' - name: Archive PHPUnit logs uses: actions/upload-artifact@v4 From 15ca05c012aa501fd156283f13d3792892318ee8 Mon Sep 17 00:00:00 2001 From: Nicole Cordes Date: Mon, 5 Aug 2024 02:53:22 +0200 Subject: [PATCH 10/22] [TASK] Remove Travis CI configuration --- .travis.yml | 98 ----------------------------------------------------- 1 file changed, 98 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index d911a22..0000000 --- a/.travis.yml +++ /dev/null @@ -1,98 +0,0 @@ -language: php - -dist: bionic - -addons: - apt: - packages: - - parallel - sonarcloud: - organization: "ichhabrecht-github" - branches: - - master - - pre-merge - -cache: - directories: - - $HOME/.composer/cache - - $HOME/.sonar/cache - -jdk: - - oraclejdk8 - -sudo: required - -before_install: - - echo 'xdebug.mode=coverage' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini - -install: - - > - for COVERAGE in $COVERAGE_VERSIONS; do - echo; - echo "Installing phpunit/php-code-coverage version $COVERAGE"; - echo; - echo; - git clean -Xdf; - composer require phpunit/php-code-coverage="$COVERAGE"; - git checkout composer.json; - mkdir -p .Log/coverage/ .Log/log/; - VERSION=${COVERAGE//[!0-9]/}; - - echo; - echo "Running phpunit"; - echo; - echo; - .Build/bin/phpunit --log-junit .Log/log/junit_$VERSION.xml --coverage-php .Log/coverage/coverage_$VERSION.cov --coverage-filter src/ tests/; - done - -script: - - > - echo; - echo "Merging log and coverage files"; - echo; - echo; - bin/phpunit-merger coverage .Log/coverage/ .Log/coverage.xml; - bin/phpunit-merger log .Log/log/ .Log/junit.xml; - - - > - echo; - echo "Running php lint"; - echo; - echo; - find . -name \*.php ! -path "./.Build/*" | parallel --gnu php -d display_errors=stderr -l {} > /dev/null \;; - -jobs: - fast_finish: true - include: - - stage: test - php: 8.1.0 - env: COVERAGE_VERSIONS="~10.0.0 ~10.1.0" - - stage: test - php: 8.1.0 - env: COVERAGE_VERSIONS="~9.0.0 ~9.1.0 ~9.2.0" - - stage: test - php: 8.0 - env: COVERAGE_VERSIONS="~9.0.0 ~9.1.0 ~9.2.0" - - - stage: ✔ with sonarqube scanner - if: type = push AND branch IN (master, pre-merge) AND env(SONAR_TOKEN) IS present AND fork = false - php: 8.1 - env: COVERAGE_VERSIONS="~10.0.0 ~10.1.0" - before_script: - script: - - > - echo; - echo "Merging log and coverage files"; - echo; - echo; - bin/phpunit-merger coverage .Log/coverage/ .Log/coverage.xml; - bin/phpunit-merger log .Log/log/ .Log/junit.xml; - - - git fetch --unshallow || true - - - > - echo; - echo "Running SonarQube Scanner"; - echo; - echo; - sonar-scanner; From 790ea368a128725d76372b1c62ba76f3b8509c19 Mon Sep 17 00:00:00 2001 From: Kennard Vermeiren Date: Fri, 26 Jan 2024 10:16:48 +0100 Subject: [PATCH 11/22] Allow Symfony ^7.0 as dependency --- .gitignore | 1 + composer.json | 6 +++--- src/PhpunitMerger/Command/CoverageCommand.php | 2 +- src/PhpunitMerger/Command/LogCommand.php | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 30cd882..a89a0ce 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ /.idea /.Log composer.lock +.phpunit.result.cache diff --git a/composer.json b/composer.json index 3412e24..1456b50 100644 --- a/composer.json +++ b/composer.json @@ -31,12 +31,12 @@ "ext-json": "*", "ext-simplexml": "*", "phpunit/php-code-coverage": "^9.0 || ^10.0", - "symfony/console": ">=2.7 <7.0", - "symfony/finder": ">=2.7 <7.0" + "symfony/console": ">=2.7 <8.0", + "symfony/finder": ">=2.7 <8.0" }, "require-dev": { "phpunit/phpunit": "^9.3 || ^10.0", - "symfony/filesystem": ">=2.7 <7.0", + "symfony/filesystem": ">=2.7 <8.0", "phpspec/prophecy": "^1.0", "php-parallel-lint/php-parallel-lint": "^1.4" }, diff --git a/src/PhpunitMerger/Command/CoverageCommand.php b/src/PhpunitMerger/Command/CoverageCommand.php index 144d6d6..ffc90e9 100644 --- a/src/PhpunitMerger/Command/CoverageCommand.php +++ b/src/PhpunitMerger/Command/CoverageCommand.php @@ -54,7 +54,7 @@ protected function configure() ); } - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): int { $finder = new Finder(); $finder->files() diff --git a/src/PhpunitMerger/Command/LogCommand.php b/src/PhpunitMerger/Command/LogCommand.php index d30e6ef..8f5b2ff 100644 --- a/src/PhpunitMerger/Command/LogCommand.php +++ b/src/PhpunitMerger/Command/LogCommand.php @@ -38,7 +38,7 @@ protected function configure() ); } - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): int { $finder = new Finder(); $finder->files() From ae4e968e677bfd3fda68000a9a304ae6965353e6 Mon Sep 17 00:00:00 2001 From: Nicole Cordes Date: Mon, 5 Aug 2024 10:33:05 +0200 Subject: [PATCH 12/22] [RELEASE] Release of phpunit-merger 2.0.1 --- ChangeLog | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/ChangeLog b/ChangeLog index 432746c..30af43c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2024-08-05 [RELEASE] Release of phpunit-merger 2.0.1 (Nicole Cordes) +2024-01-26 790ea36 Allow Symfony ^7.0 as dependency (Kennard Vermeiren) +2024-08-05 15ca05c [TASK] Remove Travis CI configuration (Nicole Cordes) +2024-08-05 9d32123 [TASK] Increase log files (Nicole Cordes) +2024-08-05 722e1eb [FEATURE] Add merge testing job (Nicole Cordes) +2024-08-04 261efdf [FEATURE] Add major version processing (Nicole Cordes) +2024-08-04 6ee2a5e [BUGFIX] Streamline PHPUnit configuration (Nicole Cordes) +2024-08-03 d193bd5 [BUGFIX] Re-add compatibility to phpunit/php-code-coverage ^9.0 (Nicole Cordes) +2024-08-03 f096c24 [FEATURE] Run PHPUnit tests and create artifacts (Nicole Cordes) +2024-08-02 1522a51 [FEATURE] Compute matrix values (Nicole Cordes) +2024-08-02 a715056 [FEATURE] Introduce GitHub Actions PHP linting (Nicole Cordes) +2024-08-02 4b361a0 [BUGFIX] Fix StyleCI configuration (Nicole Cordes) + 2023-10-02 [RELEASE] Release of phpunit-merger 2.0.0 (Nicole Cordes) 2023-10-02 ff24d85 [FEATURE] Add support for phpunit/php-code-coverage ^10.0 (Nicole Cordes) From d0ba7c66da786c730c62eb9bb827238c6bd08705 Mon Sep 17 00:00:00 2001 From: Nicole Cordes Date: Mon, 5 Aug 2024 10:38:16 +0200 Subject: [PATCH 13/22] [TASK] Update status badges --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3e3041d..1f79d9e 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,8 @@ # Merge multiple PHPUnit reports into one file [![Latest Stable Version](https://img.shields.io/packagist/v/nimut/phpunit-merger.svg)](https://packagist.org/packages/nimut/phpunit-merger) -[![StyleCI](https://styleci.io/repos/114540931/shield?branch=master)](https://styleci.io/repos/114540931) +[![StyleCI](https://styleci.io/repos/114540931/shield?branch=main)](https://styleci.io/repos/114540931) +![GitHub Actions](https://github.com/Nimut/phpunit-merger/actions/workflows/test.yml/badge.svg?event=push) Sometimes it is necessary to run multiple PHPUnit instances to execute all tests of a project. Unfortunately each run writes its own coverage and log reports. There is no support in PHPUnit to merge the reports of multiple runs. From 81ea07d5cf5ecb5e06baae81f86ae1547a79060e Mon Sep 17 00:00:00 2001 From: ElSenorGrims Date: Fri, 11 Jul 2025 16:09:01 +0200 Subject: [PATCH 14/22] Retours PR --- .github/workflows/compute.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/compute.yml b/.github/workflows/compute.yml index 91131a4..a3d0134 100644 --- a/.github/workflows/compute.yml +++ b/.github/workflows/compute.yml @@ -16,8 +16,8 @@ on: env: OS: '[ "ubuntu-latest" ]' - COVERAGE: '[ "~9.0.0", "~9.1.0", "~9.2.0", "~10.0.0", "~10.1.0" ]' - PHP: '[ "8.0", "8.1", "8.2", "8.3" ]' + COVERAGE: '[ "~9.0.0", "~9.1.0", "~9.2.0", "~10.0.0", "~10.1.0", "~11.5.27", "~12.2.7" ]' + PHP: '[ "8.0", "8.1", "8.2", "8.3", "8.4" ]' EXCLUDE: '[ { "coverage": "10", "php": "8.0" }, { "coverage": "~10.0.0", "php": "8.0" }, { "coverage": "~10.1.0", "php": "8.0" } ]' jobs: From 7d1fd2d22db7f9630a764482d69477ff4417c865 Mon Sep 17 00:00:00 2001 From: ElSenorGrims Date: Fri, 11 Jul 2025 16:21:47 +0200 Subject: [PATCH 15/22] Fix composer --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 0374820..561dcaa 100644 --- a/composer.json +++ b/composer.json @@ -34,7 +34,7 @@ "ext-dom": "*", "ext-json": "*", "ext-simplexml": "*", - "phpunit/php-code-coverage": "^9.0 || ^10.0|| ^11.0 || ^12.0", + "phpunit/php-code-coverage": "^9.0 || ^10.0 || ^11.0 || ^12.0", "symfony/console": ">=2.7 <8.0", "symfony/finder": ">=2.7 <8.0" }, From 2e791682bd167d07ee6250afcdcdf5b5b1c63588 Mon Sep 17 00:00:00 2001 From: ElSenorGrims Date: Fri, 11 Jul 2025 16:23:19 +0200 Subject: [PATCH 16/22] Fix TU --- .github/workflows/compute.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/compute.yml b/.github/workflows/compute.yml index a3d0134..3dd9e85 100644 --- a/.github/workflows/compute.yml +++ b/.github/workflows/compute.yml @@ -18,7 +18,7 @@ env: OS: '[ "ubuntu-latest" ]' COVERAGE: '[ "~9.0.0", "~9.1.0", "~9.2.0", "~10.0.0", "~10.1.0", "~11.5.27", "~12.2.7" ]' PHP: '[ "8.0", "8.1", "8.2", "8.3", "8.4" ]' - EXCLUDE: '[ { "coverage": "10", "php": "8.0" }, { "coverage": "~10.0.0", "php": "8.0" }, { "coverage": "~10.1.0", "php": "8.0" } ]' + EXCLUDE: '[ { "coverage": "10", "php": "8.0" }, { "coverage": "~10.0.0", "php": "8.0" }, { "coverage": "~10.1.0", "php": "8.0" }, { "coverage": "~11.5.27", "php": "8.0"} ]' jobs: compute: From 8031951bcafc303703ae6aedb092bc25a43b398a Mon Sep 17 00:00:00 2001 From: ElSenorGrims Date: Fri, 11 Jul 2025 16:25:03 +0200 Subject: [PATCH 17/22] Fix TU --- .github/workflows/compute.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/compute.yml b/.github/workflows/compute.yml index 3dd9e85..bce077c 100644 --- a/.github/workflows/compute.yml +++ b/.github/workflows/compute.yml @@ -18,7 +18,7 @@ env: OS: '[ "ubuntu-latest" ]' COVERAGE: '[ "~9.0.0", "~9.1.0", "~9.2.0", "~10.0.0", "~10.1.0", "~11.5.27", "~12.2.7" ]' PHP: '[ "8.0", "8.1", "8.2", "8.3", "8.4" ]' - EXCLUDE: '[ { "coverage": "10", "php": "8.0" }, { "coverage": "~10.0.0", "php": "8.0" }, { "coverage": "~10.1.0", "php": "8.0" }, { "coverage": "~11.5.27", "php": "8.0"} ]' + EXCLUDE: '[ { "coverage": "10", "php": "8.0" }, { "coverage": "~10.0.0", "php": "8.0" }, { "coverage": "~10.1.0", "php": "8.0" }, { "coverage": "~11.5.27", "php": "8.0" }, , { "coverage": "~11.5.27", "php": "8.1" } ]' jobs: compute: From f7424ea860e3ca79d0c6c9d40d62f4545d9682f7 Mon Sep 17 00:00:00 2001 From: ElSenorGrims Date: Fri, 11 Jul 2025 16:25:42 +0200 Subject: [PATCH 18/22] Fix TU --- .github/workflows/compute.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/compute.yml b/.github/workflows/compute.yml index bce077c..90a4d90 100644 --- a/.github/workflows/compute.yml +++ b/.github/workflows/compute.yml @@ -18,7 +18,7 @@ env: OS: '[ "ubuntu-latest" ]' COVERAGE: '[ "~9.0.0", "~9.1.0", "~9.2.0", "~10.0.0", "~10.1.0", "~11.5.27", "~12.2.7" ]' PHP: '[ "8.0", "8.1", "8.2", "8.3", "8.4" ]' - EXCLUDE: '[ { "coverage": "10", "php": "8.0" }, { "coverage": "~10.0.0", "php": "8.0" }, { "coverage": "~10.1.0", "php": "8.0" }, { "coverage": "~11.5.27", "php": "8.0" }, , { "coverage": "~11.5.27", "php": "8.1" } ]' + EXCLUDE: '[ { "coverage": "10", "php": "8.0" }, { "coverage": "~10.0.0", "php": "8.0" }, { "coverage": "~10.1.0", "php": "8.0" }, { "coverage": "~11.5.27", "php": "8.0" }, { "coverage": "~11.5.27", "php": "8.1" } ]' jobs: compute: From 8cf5198baa9db62cccbf397e758eb7388245bff9 Mon Sep 17 00:00:00 2001 From: ElSenorGrims Date: Tue, 15 Jul 2025 09:00:27 +0200 Subject: [PATCH 19/22] Fix TU --- .github/workflows/compute.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/compute.yml b/.github/workflows/compute.yml index 90a4d90..7e56141 100644 --- a/.github/workflows/compute.yml +++ b/.github/workflows/compute.yml @@ -18,7 +18,7 @@ env: OS: '[ "ubuntu-latest" ]' COVERAGE: '[ "~9.0.0", "~9.1.0", "~9.2.0", "~10.0.0", "~10.1.0", "~11.5.27", "~12.2.7" ]' PHP: '[ "8.0", "8.1", "8.2", "8.3", "8.4" ]' - EXCLUDE: '[ { "coverage": "10", "php": "8.0" }, { "coverage": "~10.0.0", "php": "8.0" }, { "coverage": "~10.1.0", "php": "8.0" }, { "coverage": "~11.5.27", "php": "8.0" }, { "coverage": "~11.5.27", "php": "8.1" } ]' + EXCLUDE: '[ { "coverage": "10", "php": "8.0" }, { "coverage": "~10.0.0", "php": "8.0" }, { "coverage": "~10.1.0", "php": "8.0" }, { "coverage": "~11.5.27", "php": "8.0" }, { "coverage": "~11.5.27", "php": "8.1" }, { "coverage": "~11.5.27", "php": "8.2" }, { "coverage": "~11.5.27", "php": "8.3" }, { "coverage": "~11.5.27", "php": "8.4" }, { "coverage": "~12.12.7", "php": "8.0" }, { "coverage": "~12.12.7", "php": "8.1" }, { "coverage": "~12.12.7", "php": "8.2" }, { "coverage": "~12.12.7", "php": "8.3" }, { "coverage": "~12.12.7", "php": "8.4" } ]' jobs: compute: From a4a08ad3ef3ea46d2e6d60d4516824031ca7ffa6 Mon Sep 17 00:00:00 2001 From: ElSenorGrims Date: Tue, 15 Jul 2025 09:01:33 +0200 Subject: [PATCH 20/22] Fix TU --- .github/workflows/compute.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/compute.yml b/.github/workflows/compute.yml index 7e56141..3e5328e 100644 --- a/.github/workflows/compute.yml +++ b/.github/workflows/compute.yml @@ -18,7 +18,7 @@ env: OS: '[ "ubuntu-latest" ]' COVERAGE: '[ "~9.0.0", "~9.1.0", "~9.2.0", "~10.0.0", "~10.1.0", "~11.5.27", "~12.2.7" ]' PHP: '[ "8.0", "8.1", "8.2", "8.3", "8.4" ]' - EXCLUDE: '[ { "coverage": "10", "php": "8.0" }, { "coverage": "~10.0.0", "php": "8.0" }, { "coverage": "~10.1.0", "php": "8.0" }, { "coverage": "~11.5.27", "php": "8.0" }, { "coverage": "~11.5.27", "php": "8.1" }, { "coverage": "~11.5.27", "php": "8.2" }, { "coverage": "~11.5.27", "php": "8.3" }, { "coverage": "~11.5.27", "php": "8.4" }, { "coverage": "~12.12.7", "php": "8.0" }, { "coverage": "~12.12.7", "php": "8.1" }, { "coverage": "~12.12.7", "php": "8.2" }, { "coverage": "~12.12.7", "php": "8.3" }, { "coverage": "~12.12.7", "php": "8.4" } ]' + EXCLUDE: '[ { "coverage": "10", "php": "8.0" }, { "coverage": "~10.0.0", "php": "8.0" }, { "coverage": "~10.1.0", "php": "8.0" }, { "coverage": "~11.5.27", "php": "8.0" }, { "coverage": "~11.5.27", "php": "8.1" }, { "coverage": "~11.5.27", "php": "8.2" }, { "coverage": "~11.5.27", "php": "8.3" }, { "coverage": "~11.5.27", "php": "8.4" }, { "coverage": "~12.2.7", "php": "8.0" }, { "coverage": "~12.2.7", "php": "8.1" }, { "coverage": "~12.2.7", "php": "8.2" }, { "coverage": "~12.2.7", "php": "8.3" }, { "coverage": "~12.2.7", "php": "8.4" } ]' jobs: compute: From 8509500f93e8dbbc29de37cc8902356e7727abd4 Mon Sep 17 00:00:00 2001 From: Steven Van Poeck Date: Tue, 15 Jul 2025 09:56:22 +0200 Subject: [PATCH 21/22] Remove tests from matrix for PHPUnit < 11, PHP < 8.3 --- .github/workflows/compute.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/compute.yml b/.github/workflows/compute.yml index 3e5328e..c6d1c99 100644 --- a/.github/workflows/compute.yml +++ b/.github/workflows/compute.yml @@ -16,9 +16,9 @@ on: env: OS: '[ "ubuntu-latest" ]' - COVERAGE: '[ "~9.0.0", "~9.1.0", "~9.2.0", "~10.0.0", "~10.1.0", "~11.5.27", "~12.2.7" ]' - PHP: '[ "8.0", "8.1", "8.2", "8.3", "8.4" ]' - EXCLUDE: '[ { "coverage": "10", "php": "8.0" }, { "coverage": "~10.0.0", "php": "8.0" }, { "coverage": "~10.1.0", "php": "8.0" }, { "coverage": "~11.5.27", "php": "8.0" }, { "coverage": "~11.5.27", "php": "8.1" }, { "coverage": "~11.5.27", "php": "8.2" }, { "coverage": "~11.5.27", "php": "8.3" }, { "coverage": "~11.5.27", "php": "8.4" }, { "coverage": "~12.2.7", "php": "8.0" }, { "coverage": "~12.2.7", "php": "8.1" }, { "coverage": "~12.2.7", "php": "8.2" }, { "coverage": "~12.2.7", "php": "8.3" }, { "coverage": "~12.2.7", "php": "8.4" } ]' + COVERAGE: '[ "~11.5.27", "~12.2.7" ]' + PHP: '[ "8.3", "8.4" ]' + EXCLUDE: '[ { "coverage": "~11.5.27", "php": "8.3" }, { "coverage": "~11.5.27", "php": "8.4" }, { "coverage": "~12.2.7", "php": "8.3" }, { "coverage": "~12.2.7", "php": "8.4" } ]' jobs: compute: From f68d565525ce9b77010eeeb43b652ac700368437 Mon Sep 17 00:00:00 2001 From: Steven Van Poeck Date: Tue, 15 Jul 2025 09:59:16 +0200 Subject: [PATCH 22/22] Remove obsolete dependencies PHPUnit < 11, PHP Code Coverage < 11 --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 561dcaa..d07b978 100644 --- a/composer.json +++ b/composer.json @@ -34,12 +34,12 @@ "ext-dom": "*", "ext-json": "*", "ext-simplexml": "*", - "phpunit/php-code-coverage": "^9.0 || ^10.0 || ^11.0 || ^12.0", + "phpunit/php-code-coverage": "^11.0 || ^12.0", "symfony/console": ">=2.7 <8.0", "symfony/finder": ">=2.7 <8.0" }, "require-dev": { - "phpunit/phpunit": "^9.3 || ^10.0 || ^11.0 || ^12.0", + "phpunit/phpunit": "^11.0 || ^12.0", "symfony/filesystem": ">=2.7 <8.0", "phpspec/prophecy": "^1.0", "php-parallel-lint/php-parallel-lint": "^1.4"