Skip to content

Commit

Permalink
Merge upstream php-coveralls/php-coveralls:master (#4)
Browse files Browse the repository at this point in the history
* Update .travis.yml to include PHP 7.4 (php-coveralls#283)

* Fix incorrect version in README (php-coveralls#286)

* Add Guzzle 7 support (php-coveralls#288)

* Add Guzzle 7 support

* Update composer.json

Co-authored-by: Dariusz Rumiński <dariusz.ruminski@gmail.com>

* DX: Configurator - reduce cyclomatic complexity (php-coveralls#291)

* CI: reduce amount of jobs (php-coveralls#292)

* Allow to specify endpoint in arguments (php-coveralls#290)

* Allow to specify endpoint in arguments

* use new helper

Co-authored-by: Dariusz Ruminski <dariusz.ruminski@gmail.com>

* DX: Allow PHPUnit 7 (php-coveralls#294)

* Added COVERALLS_PARALLEL support and Configured CI_BUILD_NUMBER for Travis CI (php-coveralls#279)

* updated to detect COVERALLS_PARALLEL env var

* added CI_BUILD_NUMBER into Configuration

* updated README

* fixed tests

* Update RequirementsNotSatisfiedException.php

* fix CS

* fix checking of required fields + tests

* add missing class property

Co-authored-by: Dariusz Rumiński <dariusz.ruminski@gmail.com>

* Prepare v2.3.0

* Add support for PHP 8 + PHPUnit 9 (php-coveralls#295)

* Add support for PHP 8 + PHPUnit 9

* Add PHPUnit 4.8 workarounds

* Do --ignore-platform-reqs on PHP 8

* Skip failing test due to missing get_debug_type()

* Add insecure option (php-coveralls#289)

* Add Github Actions and COVERALLS_FLAG_NAME support (php-coveralls#296)

Co-authored-by: Smolevich <smolevich90@gmail.com>
Co-authored-by: Simon Podlipsky <simon@podlipsky.net>

* DX: .gitignore cache PHPUnit (php-coveralls#297)

* Prepare v2.4.0

* Fix support of branch name with hyphen and "(no branch)" (php-coveralls#298)

* Fix no-branch on CI error

* fix support of dash in branch names

* little tests cleanup

* Prepare v2.4.1

* Correct spelling error in Github (php-coveralls#299)

* Add COVERALLS_REPO_TOKEN to error message when run on Github Action (php-coveralls#302)

* Update README.md (php-coveralls#303)

Version 2.4.0 does not have a phar file, change to v2.4.2

* Add file missing for PHP 8 (php-coveralls#308)

fixes php-coveralls#307

* Prepare v2.4.3

* Update CiEnvVarsCollector.php

Re-arrange methods to avoid merge conflicts with upstream

* Update JsonFileTest.php

Remove duplicate method `shouldSetParallel()`

* Update JsonFile.php

Remove duplicate property `$parallel`

* Update JsonFile.php

Remove duplicate method `setParallel()`

* Update CiEnvVarsCollector.php

Fix code style

* Update JsonFileTest.php

Fix broken test

Co-authored-by: Alexey Kopytko <alexey@kopytko.com>
Co-authored-by: Viktor Szépe <viktor@szepe.net>
Co-authored-by: Dmitry Ivanov <dmitry.g.ivanov@gmail.com>
Co-authored-by: Dariusz Rumiński <dariusz.ruminski@gmail.com>
Co-authored-by: Dmitry Shemin <shemindmitry@gmail.com>
Co-authored-by: Yih Yang <yyngo788n88@hotmail.com>
Co-authored-by: Twin Huang <twinhuang@qq.com>
Co-authored-by: Smolevich <smolevich90@gmail.com>
Co-authored-by: Simon Podlipsky <simon@podlipsky.net>
Co-authored-by: Danny van der Sluijs <danny.vandersluijs@icloud.com>
Co-authored-by: Oanh Nguyen <oanhnn.bk@gmail.com>
Co-authored-by: Jimmy Cleuren <jimmy.cleuren@gmail.com>
Co-authored-by: Christian Raue <christian.raue@gmail.com>
  • Loading branch information
14 people committed Jan 15, 2021
1 parent 3dfc2fd commit e382fe1
Show file tree
Hide file tree
Showing 35 changed files with 949 additions and 303 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/blank.yml
@@ -0,0 +1,45 @@
name: CI

on:
push:
branches:
tags:
pull_request:

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
php: [7.1, 7.2, 7.3, 7.4]
steps:
- uses: actions/checkout@v1
- name: Debug if needed
run: |
export DEBUG=${DEBUG:-false}
if [[ "$DEBUG" == "true" ]]; then
env
fi
env:
DEBUG: ${{secrets.DEBUG}}
- name: Setup php
uses: shivammathur/setup-php@1.7.0
with:
php-version: ${{ matrix.php }}
extensions: dom, mbstring
coverage: xdebug
- name: Get Composer Cache Directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache dependencies
uses: actions/cache@v1
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install dependencies
run: composer install
- name: Run composer script
run: |
composer install-dev-tools;
composer sca
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -24,6 +24,7 @@ php-cs-fixer.phar
.coveralls.yml
.php_cs
.php_cs.cache
.phpunit.result.cache
phpunit.xml

box.phar
2 changes: 2 additions & 0 deletions .php_cs.dist
Expand Up @@ -31,6 +31,8 @@ return PhpCsFixer\Config::create()
'phpdoc_add_missing_param_annotation' => true,
'phpdoc_order' => true,
'phpdoc_types_order' => true,
'php_unit_expectation' => ['target' => '5.2'],
'php_unit_no_expectation_annotation' => true,
'semicolon_after_instruction' => true,
'single_line_throw' => false,
'strict_comparison' => true,
Expand Down
9 changes: 5 additions & 4 deletions .travis.yml
@@ -1,23 +1,24 @@
sudo: false
dist: trusty
language: php

matrix:
jobs:
include:
- php: 5.5
env: 'COMPOSER_FLAGS="--prefer-stable --prefer-lowest"'
- php: 5.5
- php: 5.6
- php: 7.0
env: 'BOX=yes'
- php: 7.1
env: CHECKS=yes
- php: 7.1
env: SYMFONY_VERSION="^3.0"
- php: 7.2
env: SYMFONY_VERSION="^4.0"
- php: 7.3
env: SYMFONY_VERSION="^5.0" MIN_STABILITY=dev
- php: 7.4
env: CHECKS=yes
- php: nightly
env: 'COMPOSER_FLAGS="--ignore-platform-reqs"'

cache:
directories:
Expand Down
51 changes: 51 additions & 0 deletions CHANGELOG.md
@@ -1,6 +1,57 @@
CHANGELOG
=========

## 2.4.3

### Bug fix

- [#308](https://github.com/php-coveralls/php-coveralls/pull/308) Add file missing for PHP 8

### Miscellaneous

- [#303](https://github.com/php-coveralls/php-coveralls/pull/303) Update README.md

## 2.4.2

### Bug fix

- [#302](https://github.com/php-coveralls/php-coveralls/pull/302) Add COVERALLS_REPO_TOKEN to error message when run on Github Action
- [#299](https://github.com/php-coveralls/php-coveralls/pull/299) Correct spelling error in Github

## 2.4.1

### Bug fix

- [#298](https://github.com/php-coveralls/php-coveralls/pull/298) Fix support of branch name with hyphen and "(no branch)"

## 2.4.0

### Enhancement

- [#296](https://github.com/php-coveralls/php-coveralls/pull/296) Add Github Actions and COVERALLS_FLAG_NAME support
- [#295](https://github.com/php-coveralls/php-coveralls/pull/295) Add support for PHP 8 + PHPUnit 9
- [#289](https://github.com/php-coveralls/php-coveralls/pull/289) Add insecure option

### Miscellaneous

- [#297](https://github.com/php-coveralls/php-coveralls/pull/297) DX: .gitignore cache PHPUnit

## 2.3.0

### Enhancement

- [#290](https://github.com/php-coveralls/php-coveralls/pull/290) Allow to specify endpoint in arguments
- [#288](https://github.com/php-coveralls/php-coveralls/pull/288) Add Guzzle 7 support
- [#279](https://github.com/php-coveralls/php-coveralls/pull/279) Added COVERALLS_PARALLEL support and Configured CI_BUILD_NUMBER for Travis CI

### Miscellaneous

- [#294](https://github.com/php-coveralls/php-coveralls/pull/294) DX: Allow PHPUnit 7
- [#292](https://github.com/php-coveralls/php-coveralls/pull/292) CI: reduce amount of jobs
- [#291](https://github.com/php-coveralls/php-coveralls/pull/291) DX: Configurator - reduce cyclomatic complexity
- [#286](https://github.com/php-coveralls/php-coveralls/pull/286) Fix incorrect version in README
- [#283](https://github.com/php-coveralls/php-coveralls/pull/283) Update .travis.yml to include PHP 7.4

## 2.2.0

### Enhancement
Expand Down
40 changes: 36 additions & 4 deletions README.md
Expand Up @@ -24,13 +24,13 @@ We started to create a phar file, starting from the version 0.7.0
release. It is available at the URLs like:

```
https://github.com/php-coveralls/php-coveralls/releases/download/v2.2.0/php-coveralls.phar
https://github.com/php-coveralls/php-coveralls/releases/download/v2.4.3/php-coveralls.phar
```

Download the file and add exec permissions:

```sh
$ wget https://github.com/php-coveralls/php-coveralls/releases/download/v2.2.0/php-coveralls.phar
$ wget https://github.com/php-coveralls/php-coveralls/releases/download/v2.4.3/php-coveralls.phar
$ chmod +x php-coveralls.phar
```

Expand All @@ -45,7 +45,7 @@ $ composer require --dev php-coveralls/php-coveralls
If you need support for PHP versions older than 5.5, you will need to use a 1.x version:

```sh
$ composer require --dev php-coveralls/php-coveralls '^2.2'
$ composer require --dev 'php-coveralls/php-coveralls:^1.1'
```

You can see this library on [Packagist](https://packagist.org/packages/php-coveralls/php-coveralls).
Expand Down Expand Up @@ -104,7 +104,7 @@ Above settings are good for most projects if your test suite is executed once a

```json
"require-dev": {
"php-coveralls/php-coveralls": "^2.2",
"php-coveralls/php-coveralls": "^2.4",
"phpunit/phpcov": "^2.0"
},
```
Expand Down Expand Up @@ -237,6 +237,19 @@ In the "Configure your environment variables" section:
COVERALLS_REPO_TOKEN=your_token
```

## GitHub Actions

Add a new step after phpunit generate coverage report.

```yaml
- name: Upload coverage results to Coveralls
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
composer global require php-coveralls/php-coveralls
php-coveralls --coverage_clover=build/logs/clover.xml -v
```

## From local environment

If you would like to call Coveralls API from your local environment, you can set `COVERALLS_RUN_LOCALLY` environment variable. This configuration requires `repo_token` to specify which project on Coveralls your project maps to. This can be done by configuring `.coveralls.yml` or `COVERALLS_REPO_TOKEN` environment variable.
Expand All @@ -257,6 +270,25 @@ php-coveralls set the following properties to `json_file` which is sent to Cover
- service_name: php-coveralls
- service_event_type: manual

## Parallel Builds

Coveralls provides the ability to combine coverage result from multiple parallel builds into one. To enable the feature you can set the following in your environment variable.

```sh
COVERALLS_PARALLEL=true
```

To distinguish your job name, please set the `COVERALLS_FLAG_NAME` environment variable.

```sh
COVERALLS_FLAG_NAME=$YOUR_PHP_VERSION
```

Bear in mind that you will need to configure your build to send a webhook after all the parallel builds are done in order for Coveralls to merge the results.

Refer to [Parallel Builds Webhook](https://docs.coveralls.io/parallel-build-webhook) for more information for setup on your environment.


## CLI options

You can get help information for `coveralls` with the `--help (-h)` option.
Expand Down
2 changes: 1 addition & 1 deletion box.json
Expand Up @@ -11,7 +11,7 @@
],
"finder": [
{
"name": ["*.php", "*.pem"],
"name": ["*.php", "*.php8", "*.pem"],
"exclude": ["tests"],
"in": ["vendor"]
}
Expand Down
12 changes: 4 additions & 8 deletions composer.json
Expand Up @@ -30,18 +30,19 @@
}
],
"require": {
"php": "^5.5 || ^7.0",
"php": "^5.5 || ^7.0 || ^8.0",
"ext-json": "*",
"ext-simplexml": "*",
"guzzlehttp/guzzle": "^6.0",
"guzzlehttp/guzzle": "^6.0 || ^7.0",
"psr/log": "^1.0",
"symfony/config": "^2.1 || ^3.0 || ^4.0 || ^5.0",
"symfony/console": "^2.1 || ^3.0 || ^4.0 || ^5.0",
"symfony/stopwatch": "^2.0 || ^3.0 || ^4.0 || ^5.0",
"symfony/yaml": "^2.0.5 || ^3.0 || ^4.0 || ^5.0"
},
"require-dev": {
"phpunit/phpunit": "^4.8.35 || ^5.4.3 || ^6.0"
"phpunit/phpunit": "^4.8.35 || ^5.4.3 || ^6.0 || ^7.0 || ^8.0 || ^9.0",
"sanmai/phpunit-legacy-adapter": "^6.1 || ^8.0"
},
"suggest": {
"symfony/http-kernel": "Allows Symfony integration"
Expand All @@ -66,10 +67,5 @@
"optimize-autoloader": true,
"process-timeout": 0,
"sort-packages": true
},
"extra": {
"branch-alias": {
"dev-master": "2.2-dev"
}
}
}

0 comments on commit e382fe1

Please sign in to comment.