Skip to content

Commit 3236723

Browse files
authored
Merge pull request #15 from ker0x/feature/ci-workflows
Update minimal PHP version and dependencies, add new CI workflow
2 parents c686905 + 2020088 commit 3236723

File tree

9 files changed

+107
-71
lines changed

9 files changed

+107
-71
lines changed

.gitattributes

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
# https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html
33

44
# Ignore all test and documentation with "export-ignore".
5+
/.github export-ignore
6+
/tests export-ignore
7+
/.editorconfig export-ignore
58
/.gitattributes export-ignore
69
/.gitignore export-ignore
7-
/.travis.yml export-ignore
10+
/.php_cs.dist export-ignore
811
/phpunit.xml.dist export-ignore
9-
/.scrutinizer.yml export-ignore
10-
/tests export-ignore

.github/workflows/ci.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: ci
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
build:
11+
12+
runs-on: ubuntu-latest
13+
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
php-version: [ '7.4' ]
18+
allow-failure: [ false ]
19+
coverage: [ false ]
20+
composer-flags: [ '' ]
21+
include:
22+
- php-version: '7.3'
23+
coverage: true
24+
- php-version: '8.0'
25+
allow-failure: true
26+
composer-flags: '--ignore-platform-req php'
27+
28+
steps:
29+
- uses: actions/checkout@v2
30+
31+
- name: php-setup
32+
uses: shivammathur/setup-php@v2
33+
with:
34+
php-version: ${{ matrix.php-version }}
35+
36+
- name: composer-validate
37+
run: composer validate
38+
39+
- name: composer-cache
40+
id: composer-cache
41+
uses: actions/cache@v2
42+
with:
43+
path: vendor
44+
key: ${{ runner.os }}-${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.lock') }}
45+
restore-keys: |
46+
${{ runner.os }}-${{ matrix.php-version }}-composer-
47+
- name: composer-install
48+
if: steps.composer-cache.outputs.cache-hit != 'true'
49+
run: composer install --prefer-dist --no-progress --no-suggest ${{ matrix.composer-flags }}
50+
51+
- name: phpstan
52+
run: vendor/bin/phpstan --level=max --memory-limit="-1" --no-progress analyze
53+
54+
- name: php-cs-fixer
55+
continue-on-error: ${{ matrix.allow-failure }}
56+
env:
57+
PHP_CS_FIXER_IGNORE_ENV: ${{ matrix.allow-failure }}
58+
run: vendor/bin/php-cs-fixer fix --dry-run --diff --verbose --config=.php_cs.dist
59+
60+
- name: phpunit
61+
run: vendor/bin/phpunit --coverage-text --coverage-clover=build/coverage.xml
62+
63+
- name: coverage
64+
if: ${{ matrix.coverage }}
65+
uses: codecov/codecov-action@v1
66+
with:
67+
token: ${{ secrets.CODECOV_TOKEN }}
68+
directory: ./build

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ vendor/
33
composer.lock
44
.php_cs
55
.php_cs.cache
6+
.phpunit.result.cache
67
phpunit.xml

.php_cs.dist

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,19 @@
22

33
$finder = PhpCsFixer\Finder::create()
44
->in(__DIR__ . '/src')
5-
->in(__DIR__ . '/tests')
65
;
76

87
return PhpCsFixer\Config::create()
98
->setRiskyAllowed(true)
109
->setRules([
1110
'@Symfony' => true,
12-
'@PHP71Migration' => true,
11+
'@Symfony:risky' => true,
12+
'@PHP74Migration' => true,
13+
'array_syntax' => ['syntax' => 'short'],
1314
'binary_operator_spaces' => array(
1415
'align_equals' => false,
1516
'align_double_arrow' => false,
1617
),
17-
'@Symfony:risky' => true,
18-
'@PHP71Migration:risky' => true,
19-
'array_syntax' => ['syntax' => 'short'],
2018
'linebreak_after_opening_tag' => true,
2119
'mb_str_functions' => true,
2220
'no_php4_constructor' => true,

.scrutinizer.yml

Lines changed: 0 additions & 11 deletions
This file was deleted.

.travis.yml

Lines changed: 0 additions & 36 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,38 @@ The Fcm library follows [SemVer](http://semver.org/).
44

55
## 2.x
66

7-
Version `2.x` of this library is a full rewrite to be compliant with [HTTP v1 API](https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages). If you are on Legacy HTTP API, then you should consider using version `1.x`
7+
Version `2.x` of this library is a full rewrite to be compliant with [HTTP v1 API](https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages). If
8+
you are on Legacy HTTP API, then you should consider using version `1.x`
9+
10+
**Changelog** (since [`2.2.0`](https://github.com/ker0x/fcm/compare/2.2.0...2.3.0))
11+
12+
- 2.3.0 (2021-02)
13+
- Bump minimal PHP version to `7.3`
14+
- Bump Guzzle version to `7.2`
15+
- Bump PHPUnit version to `8.`
16+
- Update `.gitattributes`
17+
- Update CI workflow
18+
19+
**Changelog** (since [`2.1.0`](https://github.com/ker0x/fcm/compare/2.1.0...2.2.0))
20+
21+
- 2.2.0 (2020-10)
22+
- Add direct_book_ok parameter for Android configuration.
23+
- Change test namespace from `Tests\Kerox\Fcm` to `Kerox\Fcm\Tests`
24+
- Update PHPStan to `0.12`
825

926
**Changelog** (since [`2.0.0`](https://github.com/ker0x/fcm/compare/2.0.0...2.1.0))
1027

1128
- 2.1.0 (2020-01)
1229
- Change class properties visibility from `protected` to `private`.
13-
- Add new configurations classes
30+
- Add new configurations classes
1431
* `Kerox\Fcm\Model\Message\Notification\AndroidNotification\Color::class`
1532
* `Kerox\Fcm\Model\Message\Notification\AndroidNotification\LightSettings::class`
1633
* `Kerox\Fcm\Model\Message\Notification\ApnsNotification\Sound::class`
1734
- Add new options classes
1835
* `Kerox\Fcm\Model\Message\Options\AndroidOptions::class`
1936
* `Kerox\Fcm\Model\Message\Options\ApnsOptions::class`
2037
* `Kerox\Fcm\Model\Message\Options\WebpushOptions::class`
21-
- `Kerox\Fcm\Model\Message\Notification\AndroidNotification::class`: add new properties
38+
- `Kerox\Fcm\Model\Message\Notification\AndroidNotification::class`: add new properties
2239
* `$channelId`
2340
* `$ticker`
2441
* `$sticky`
@@ -32,13 +49,14 @@ Version `2.x` of this library is a full rewrite to be compliant with [HTTP v1 AP
3249
* `$visibility`
3350
* `$lightSettings`
3451
* `$image`
35-
- `Kerox\Fcm\Model\Message\Notification\ApnsNotification\Alert::class`: add new properties
52+
- `Kerox\Fcm\Model\Message\Notification\ApnsNotification\Alert::class`: add new properties
3653
* `$subTitle`
3754
* `$subTitleLocKey`
3855
* `$subTitleLocArgs`
3956
- `Kerox\Fcm\Model\Message\Android::class`: add new property `$options`.
4057
- `Kerox\Fcm\Model\Message\Apns::class`: add new property `$options`.
41-
- Method `Kerox\Fcm\Model\Message\Webpush::setOptions()`, type `array` is deprecated, use class `Kerox\Fcm\Model\Message\Options\WebpushOptions::class` instead.
58+
- Method `Kerox\Fcm\Model\Message\Webpush::setOptions()`, type `array` is deprecated, use class `Kerox\Fcm\Model\Message\Options\WebpushOptions::class`
59+
instead.
4260
- Method `Kerox\Fcm\Model\Message\AbstractNotification\Alert::setActionLocKey()` is deprecated and will be removed in 3.0 with no replacement.
4361

4462
**Changelog** (since [`1.0.1`](https://github.com/ker0x/fcm/compare/1.0.1...2.0.0))

README.md

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
<div align="center">
2-
<a href="https://travis-ci.org/ker0x/fcm" title="Build">
3-
<img src="https://img.shields.io/travis/ker0x/fcm.svg?style=for-the-badge" alt="Build">
2+
<a href="https://github.com/ker0x/fcm/actions?query=workflow%3Aci" title="CI">
3+
<img src="https://img.shields.io/github/workflow/status/ker0x/fcm/ci?style=for-the-badge" alt="CI">
44
</a>
5-
<a href="https://scrutinizer-ci.com/g/ker0x/fcm/" title="Coverage">
6-
<img src="https://img.shields.io/scrutinizer/coverage/g/ker0x/fcm.svg?style=for-the-badge" alt="Coverage">
7-
</a>
8-
<a href="https://scrutinizer-ci.com/g/ker0x/fcm/" title="Code Quality">
9-
<img src="https://img.shields.io/scrutinizer/g/ker0x/fcm.svg?style=for-the-badge" alt="Code Quality">
5+
<a href="https://codecov.io/gh/ker0x/fcm/" title="Coverage">
6+
<img src="https://img.shields.io/codecov/c/gh/ker0x/fcm?style=for-the-badge" alt="Coverage">
107
</a>
118
<a href="https://php.net" title="PHP Version">
12-
<img src="https://img.shields.io/badge/php-%3E%3D%207.1-8892BF.svg?style=for-the-badge" alt="PHP Version">
9+
<img src="https://img.shields.io/badge/php-%3E%3D%207.4-8892BF.svg?style=for-the-badge" alt="PHP Version">
1310
</a>
1411
<a href="https://packagist.org/packages/kerox/fcm" title="Downloads">
1512
<img src="https://img.shields.io/packagist/dt/kerox/fcm.svg?style=for-the-badge" alt="Downloads">

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@
1919
}
2020
],
2121
"require": {
22-
"php": ">=7.1.0",
22+
"php": ">=7.3.0",
2323
"ext-json": "*",
24-
"guzzlehttp/guzzle": "^6.2"
24+
"guzzlehttp/guzzle": "^7.2"
2525
},
2626
"require-dev": {
2727
"friendsofphp/php-cs-fixer": "^2.5",
2828
"phpstan/phpstan": "^0.12",
29-
"phpunit/phpunit": "^7.5"
29+
"phpunit/phpunit": "^8.0"
3030
},
3131
"config": {
3232
"optimize-autoloader": true,

0 commit comments

Comments
 (0)