scrutinizer-ci / ocular

CLI for uploading external code coverage data
https://scrutinizer-ci.com
41 stars 24 forks source link

PHP8 support? #54

Closed tarlepp closed 3 years ago

tarlepp commented 3 years ago

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 commented 3 years ago

Same here, example: https://github.com/ARCANEDEV/Localization/pull/159

schmittjoh commented 3 years ago

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 ...
tarlepp commented 3 years ago

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 commented 3 years ago

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