Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP8 support? #54

Closed
tarlepp opened this issue Feb 4, 2021 · 4 comments
Closed

PHP8 support? #54

tarlepp opened this issue Feb 4, 2021 · 4 comments

Comments

@tarlepp
Copy link

tarlepp commented Feb 4, 2021

I'm using this in GitHub Actions like;

- name: Report results to Scrutinizer (https://scrutinizer-ci.com/g/tarlepp/symfony-flex-backend/)
  run: |
    wget https://scrutinizer-ci.com/ocular.phar
    php ocular.phar code-coverage:upload --access-token ${{ secrets.SCRUTINIZER_ACCESS_TOKEN }} --format=php-clover ./build/logs/clover.xml

And I'm getting this;

Run wget https://scrutinizer-ci.com/ocular.phar
--2021-02-04 18:34:47--  https://scrutinizer-ci.com/ocular.phar
Resolving scrutinizer-ci.com (scrutinizer-ci.com)... 172.67.75.7, 104.26.1.85, 104.26.0.85
Connecting to scrutinizer-ci.com (scrutinizer-ci.com)|172.67.75.7|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://s3-eu-west-1.amazonaws.com/scrutinizer-static/ocular.phar [following]
--2021-02-04 18:34:48--  https://s3-eu-west-1.amazonaws.com/scrutinizer-static/ocular.phar
Resolving s3-eu-west-1.amazonaws.com (s3-eu-west-1.amazonaws.com)... 52.218.108.147
Connecting to s3-eu-west-1.amazonaws.com (s3-eu-west-1.amazonaws.com)|52.218.108.147|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3929473 (3.7M) [application/octet-stream]
Saving to: ‘ocular.phar’

     0K .......... .......... .......... .......... ..........  1%  757K 5s
    50K .......... .......... .......... .......... ..........  2%  377K 7s
   100K .......... .......... .......... .......... ..........  3% 90.1M 5s
   150K .......... .......... .......... .......... ..........  5%  754K 5s
   200K .......... .......... .......... .......... ..........  6% 98.9M 4s
   250K .......... .......... .......... .......... ..........  7% 68.4M 3s
   300K .......... .......... .......... .......... ..........  9%  768K 3s
   350K .......... .......... .......... .......... .......... 10% 86.0M 3s
   400K .......... .......... .......... .......... .......... 11% 50.4M 3s
   450K .......... .......... .......... .......... .......... 13%  104M 2s
   500K .......... .......... .......... .......... .......... 14% 68.6M 2s
   550K .......... .......... .......... .......... .......... 15%  123M 2s
   600K .......... .......... .......... .......... .......... 16%  795K 2s
   650K .......... .......... .......... .......... .......... 18% 62.7M 2s
   700K .......... .......... .......... .......... .......... 19%  116M 2s
   750K .......... .......... .......... .......... .......... 20%  121M 2s
   800K .......... .......... .......... .......... .......... 22%  119M 1s
   850K .......... .......... .......... .......... .......... 23% 99.0M 1s
   900K .......... .......... .......... .......... .......... 24% 62.4M 1s
   950K .......... .......... .......... .......... .......... 26%  208M 1s
  1000K .......... .......... .......... .......... .......... 27%  310M 1s
  1050K .......... .......... .......... .......... .......... 28%  316M 1s
  1100K .......... .......... .......... .......... .......... 29%  111M 1s
  1150K .......... .......... .......... .......... .......... 31%  108M 1s
  1200K .......... .......... .......... .......... .......... 32%  111M 1s
  1250K .......... .......... .......... .......... .......... 33%  814K 1s
  1300K .......... .......... .......... .......... .......... 35% 59.2M 1s
  1350K .......... .......... .......... .......... .......... 36% 68.1M 1s
  1400K .......... .......... .......... .......... .......... 37% 65.2M 1s
  1450K .......... .......... .......... .......... .......... 39% 69.7M 1s
  1500K .......... .......... .......... .......... .......... 40% 74.4M 1s
  1550K .......... .......... .......... .......... .......... 41% 73.8M 1s
  1600K .......... .......... .......... .......... .......... 42% 65.7M 1s
  1650K .......... .......... .......... .......... .......... 44% 68.3M 1s
  1700K .......... .......... .......... .......... .......... 45% 77.8M 1s
  1750K .......... .......... .......... .......... .......... 46% 74.6M 1s
  1800K .......... .......... .......... .......... .......... 48% 79.0M 1s
  1850K .......... .......... .......... .......... .......... 49% 88.6M 0s
  1900K .......... .......... .......... .......... .......... 50%  173M 0s
  1950K .......... .......... .......... .......... .......... 52%  170M 0s
  2000K .......... .......... .......... .......... .......... 53%  149M 0s
  2050K .......... .......... .......... .......... .......... 54%  160M 0s
  2100K .......... .......... .......... .......... .......... 56%  161M 0s
  2150K .......... .......... .......... .......... .......... 57%  159M 0s
  2200K .......... .......... .......... .......... .......... 58%  135M 0s
  2250K .......... .......... .......... .......... .......... 59%  163M 0s
  2300K .......... .......... .......... .......... .......... 61%  154M 0s
  2350K .......... .......... .......... .......... .......... 62%  167M 0s
  2400K .......... .......... .......... .......... .......... 63%  150M 0s
  2450K .......... .......... .......... .......... .......... 65%  163M 0s
  2500K .......... .......... .......... .......... .......... 66%  918K 0s
  2550K .......... .......... .......... .......... .......... 67% 61.1M 0s
  2600K .......... .......... .......... .......... .......... 69% 66.1M 0s
  2650K .......... .......... .......... .......... .......... 70% 88.8M 0s
  2700K .......... .......... .......... .......... .......... 71%  156M 0s
  2750K .......... .......... .......... .......... .......... 72%  144M 0s
  2800K .......... .......... .......... .......... .......... 74%  144M 0s
  2850K .......... .......... .......... .......... .......... 75%  146M 0s
  2900K .......... .......... .......... .......... .......... 76%  149M 0s
  2950K .......... .......... .......... .......... .......... 78%  138M 0s
  3000K .......... .......... .......... .......... .......... 79%  147M 0s
  3050K .......... .......... .......... .......... .......... 80%  157M 0s
  3100K .......... .......... .......... .......... .......... 82%  164M 0s
  3150K .......... .......... .......... .......... .......... 83%  158M 0s
  3200K .......... .......... .......... .......... .......... 84%  136M 0s
  3250K .......... .......... .......... .......... .......... 85%  175M 0s
  3300K .......... .......... .......... .......... .......... 87%  190M 0s
  3350K .......... .......... .......... .......... .......... 88%  183M 0s
  3400K .......... .......... .......... .......... .......... 89%  165M 0s
  3450K .......... .......... .......... .......... .......... 91%  188M 0s
  3500K .......... .......... .......... .......... .......... 92%  188M 0s
  3550K .......... .......... .......... .......... .......... 93%  185M 0s
  3600K .......... .......... .......... .......... .......... 95%  172M 0s
  3650K .......... .......... .......... .......... .......... 96%  162M 0s
  3700K .......... .......... .......... .......... .......... 97%  159M 0s
  3750K .......... .......... .......... .......... .......... 99%  167M 0s
  3800K .......... .......... .......... .......              100%  125M=0.5s

2021-02-04 18:34:49 (6.94 MB/s) - ‘ocular.phar’ saved [3929473/3929473]

Uploading code coverage for repository "g/tarlepp/symfony-flex-backend" and revision "f7a3d30252008f6edaf1d38e4c9e96dca70e6a97"... 
                                                      
  [Guzzle\Common\Exception\InvalidArgumentException]  
  Invalid handle provided                             
                                                      
code-coverage:upload [--api-url="..."] [--repository="..."] [--revision="..."] [--format="..."] [--parent="..."] coverage-file

Error: Process completed with exit code 1.

And this same worked with PHP 7.4.x and now I'm getting this after I upgraded to PHP 8.0.x - any ideas how to fix this?

@arcanedev-maroc
Copy link

Same here, example: ARCANEDEV/Localization#159

@schmittjoh
Copy link
Member

PHP 8 is generally supported. However, not via the phar file as it would break older versions unfortunately if we updated that. However, there are two options available. You can either install ocular globally or add it as a dev dependency to your project, it would look something like this:

composer global require scrutinizer/ocular
~/.composer/vendor/bin/ocular ...

cristianoc72 added a commit to cristianoc72/docblock that referenced this issue Feb 26, 2021
Set php version to 7.4 in coverage report workflow for an issue
in Scrutinizer `ocular.phar`.
See scrutinizer-ci/ocular#54
cristianoc72 added a commit to phpowermove/docblock that referenced this issue Feb 26, 2021
Set php version to 7.4 in coverage report workflow for an issue
in Scrutinizer `ocular.phar`.
See scrutinizer-ci/ocular#54
@tarlepp
Copy link
Author

tarlepp commented Feb 28, 2021

PHP 8 is generally supported. However, not via the phar file as it would break older versions unfortunately if we updated that. However, there are two options available. You can either install ocular globally or add it as a dev dependency to your project, it would look something like this:

composer global require scrutinizer/ocular
~/.composer/vendor/bin/ocular ...

Thanks for the reply, I'll change my GitHub workflow to install that globally and try that out. I'll report the results here after that. I think that there should be some guide how to use this with GitHub workflows (if there isn't one yet) - WDYT?

@tarlepp
Copy link
Author

tarlepp commented Mar 4, 2021

@schmittjoh Installing that globally on GitHub workflow did the trick - once again big thanks for sharing that solution!

@tarlepp tarlepp closed this as completed Mar 4, 2021
gbirke added a commit to wmde/fundraising-donations that referenced this issue Jul 20, 2021
This change to the Travis and Scrutinizer configuration makes
Scrutinizer generate the coverage information itself.

This change became necessary, because the PHAR version of the coverage
uploader tool "ocular" provided by Scrutinizer is not compatible with
PHP 8. Instead of [installing it globally][1] we drop the external
coverage generation, simplifying the scrutinizer and Travis
configuration at the cost of a slightly longer scrutinizer run.

[1]: scrutinizer-ci/ocular#54 (comment)
Abban pushed a commit to wmde/fundraising-donations that referenced this issue Jul 21, 2021
This change to the Travis and Scrutinizer configuration makes
Scrutinizer generate the coverage information itself.

This change became necessary, because the PHAR version of the coverage
uploader tool "ocular" provided by Scrutinizer is not compatible with
PHP 8. Instead of [installing it globally][1] we drop the external
coverage generation, simplifying the scrutinizer and Travis
configuration at the cost of a slightly longer scrutinizer run.

[1]: scrutinizer-ci/ocular#54 (comment)
oleibman added a commit to oleibman/PhpSpreadsheet that referenced this issue Mar 12, 2023
oleibman added a commit to PHPOffice/PhpSpreadsheet that referenced this issue Mar 14, 2023
* WIP Run phpcs, php-cs-fixer, phpstan, coverage, versions as Php8.1

They all run under Php7.4 in Github. 7.4 is EOL. We still have to run unit tests in 7.4, but I think it's time to move the tools. Note that we cannot currently run Phpstan in 8.2 because of phpstan/phpstan#8629.

* Update main.yml

Try running coverage as 8.0 rather than 8.1.

* Update main.yml

Revert Coverage to Php 7.4.

* Composer Cache Directory

Command set-output is deprecated. Upgrading to using Environment files as suggested by Github messages.

* Coverage and Php8

Try to follow advice in scrutinizer-ci/ocular#54

* Keep Trying

See https://github.com/phpowermove/docblock/pull/12/files
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants