From 742dafdedc738f7770a9f95474f550572f2a450f Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 9 Jul 2024 15:01:06 +0300 Subject: [PATCH 1/2] Support PHP 8.x versions --- .github/workflows/main.yml | 26 +++++++++++++++++++++++--- phpunit10.xml.dist | 25 +++++++++++++++++++++++++ phpunit9.xml.dist | 25 +++++++++++++++++++++++++ 3 files changed, 73 insertions(+), 3 deletions(-) create mode 100644 phpunit10.xml.dist create mode 100644 phpunit9.xml.dist diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0b230d7..4a19a44 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,7 +14,27 @@ jobs: strategy: fail-fast: false matrix: - php: [ '5.6', '7.0', '7.1', '7.2', '7.3', '7.4'] + include: + - php: '5.6' + phpunit_config: 'phpunit.xml.dist' # PHPUnit 5.7 + - php: '7.0' + phpunit_config: 'phpunit.xml.dist' # PHPUnit 6.5 + - php: '7.1' + phpunit_config: 'phpunit.xml.dist' # PHPUnit 7.5 + - php: '7.2' + phpunit_config: 'phpunit.xml.dist' # PHPUnit 8.5 + - php: '7.3' + phpunit_config: 'phpunit9.xml.dist' # PHPUnit 9.6 + - php: '7.4' + phpunit_config: 'phpunit9.xml.dist' # PHPUnit 9.6 +# - php: '8.0' +# phpunit_config: 'phpunit9.xml.dist' # PHPUnit 9.6 +# - php: '8.1' +# phpunit_config: 'phpunit10.xml.dist' # PHPUnit 10.5 + - php: '8.2' + phpunit_config: 'phpunit10.xml.dist' # PHPUnit 10.5 + - php: '8.3' + phpunit_config: 'phpunit10.xml.dist' # PHPUnit 10.5 name: Tests (PHP ${{ matrix.php }}) steps: @@ -31,12 +51,12 @@ jobs: - name: Install Dependencies uses: ramsey/composer-install@v3 with: - dependency-versions: "highest" + dependency-versions: "highest" - name: Run Tests run: | mkdir -p build/logs - vendor/bin/phpunit --coverage-clover build/logs/clover.xml + vendor/bin/phpunit --configuration ${{ matrix.phpunit_config }} --coverage-clover build/logs/clover.xml - name: Downloading Scrutinizer CI binary run: wget https://scrutinizer-ci.com/ocular.phar diff --git a/phpunit10.xml.dist b/phpunit10.xml.dist new file mode 100644 index 0000000..7b4c34b --- /dev/null +++ b/phpunit10.xml.dist @@ -0,0 +1,25 @@ + + + + + tests + + + + + + + + + + src + + + diff --git a/phpunit9.xml.dist b/phpunit9.xml.dist new file mode 100644 index 0000000..9db7391 --- /dev/null +++ b/phpunit9.xml.dist @@ -0,0 +1,25 @@ + + + + + tests + + + + + + + + + + src + + + From d9f23e33fd9110b24f4ab1b7916d564b3829d004 Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 9 Jul 2024 15:07:52 +0300 Subject: [PATCH 2/2] Use PHP 8-aware Scrutinizer CI setup --- .github/workflows/main.yml | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4a19a44..bb62818 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -40,6 +40,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 + with: + fetch-depth: 2 - name: Setup PHP uses: shivammathur/setup-php@v2 @@ -58,12 +60,17 @@ jobs: mkdir -p build/logs vendor/bin/phpunit --configuration ${{ matrix.phpunit_config }} --coverage-clover build/logs/clover.xml - - name: Downloading Scrutinizer CI binary - run: wget https://scrutinizer-ci.com/ocular.phar - - name: Upload coverage to Codecov uses: codecov/codecov-action@v3 - - name: Uploading code coverage to Scrutinizer CI - run: php ocular.phar code-coverage:upload --format=php-clover build/logs/clover.xml + - name: Upload Coverage to Scrutinizer CI (PHP < 8.0) + if: "${{ matrix.php < '8.0' }}" + run: | + wget https://scrutinizer-ci.com/ocular.phar + php ocular.phar code-coverage:upload --repository=g/console-helpers/code-insight --format=php-clover coverage.clover + - name: Upload Coverage to Scrutinizer CI (PHP >= 8.0) + if: "${{ matrix.php >= '8.0' }}" + run: | + composer require scrutinizer/ocular + vendor/bin/ocular code-coverage:upload --repository=g/console-helpers/code-insight --format=php-clover coverage.clover