Skip to content

Commit 2d13b79

Browse files
authored
Update CI (#168)
1 parent a518bb8 commit 2d13b79

File tree

3 files changed

+54
-49
lines changed

3 files changed

+54
-49
lines changed

.github/workflows/ci.yml

Lines changed: 46 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,53 @@
11
name: CI
22

3-
on: [push, pull_request]
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- "master"
48

59
jobs:
610
phpstan:
711
name: PHPStan
812
runs-on: ubuntu-latest
913
steps:
1014
- name: "Checkout"
11-
uses: actions/checkout@v2
15+
uses: actions/checkout@v3
16+
1217
- name: "Setup PHP"
1318
uses: shivammathur/setup-php@v2
1419
with:
15-
php-version: 8.1
16-
tools: cs2pr
17-
- name: "Install dependencies with composer"
20+
coverage: none
21+
php-version: 8.2
22+
23+
- name: "Install Dependencies with Composer"
24+
uses: ramsey/composer-install@v2
25+
26+
- name: "Run PHPStan"
1827
run: |
19-
composer install --prefer-dist --no-progress --no-suggest
2028
vendor/bin/simple-phpunit --version
21-
- name: "Run PHPStan"
22-
run: vendor/bin/phpstan analyse --error-format=checkstyle | cs2pr
29+
vendor/bin/phpstan analyse --error-format=github
30+
2331
php-cs-fixer:
2432
name: PHP-CS-Fixer
2533
runs-on: ubuntu-latest
2634
steps:
2735
- name: "Checkout"
28-
uses: actions/checkout@v2
36+
uses: actions/checkout@v3
37+
2938
- name: "Setup PHP"
3039
uses: shivammathur/setup-php@v2
3140
with:
32-
php-version: 8.0
41+
coverage: none
42+
php-version: 8.1
3343
tools: cs2pr
34-
- name: "Install dependencies with composer"
35-
run: composer install --prefer-dist --no-progress --no-suggest
44+
45+
- name: "Install Dependencies with Composer"
46+
uses: ramsey/composer-install@v2
47+
3648
- name: "Run PHP-CS-Fixer"
3749
run: vendor/bin/php-cs-fixer fix --dry-run --format=checkstyle | cs2pr
50+
3851
phpunit:
3952
name: PHPUnit
4053
runs-on: ubuntu-latest
@@ -47,22 +60,20 @@ jobs:
4760
composer-flags: --prefer-stable --prefer-lowest
4861
- php-version: 8.1
4962
composer-flags: --prefer-stable --prefer-lowest
50-
- php-version: 7.4
51-
symfony-version: 4.4.*
52-
- php-version: 8.0
53-
symfony-version: 4.4.*
54-
- php-version: 8.1
55-
symfony-version: 4.4.*
63+
- php-version: 8.2
64+
composer-flags: --prefer-stable --prefer-lowest
5665
- php-version: 7.4
5766
symfony-version: 5.4.*
58-
- php-version: 8.0
59-
symfony-version: 5.4.*
60-
- php-version: 8.1
61-
symfony-version: 5.4.*
6267
- php-version: 8.0
6368
symfony-version: 6.0.*
6469
- php-version: 8.1
6570
symfony-version: 6.0.*
71+
- php-version: 8.2
72+
symfony-version: 6.0.*
73+
- php-version: 8.2
74+
symfony-version: 6.1.*
75+
- php-version: 8.2
76+
symfony-version: 6.2.*
6677
steps:
6778
- name: "Checkout"
6879
uses: actions/checkout@v2
@@ -81,33 +92,27 @@ jobs:
8192
if: matrix.composer-flags
8293
run: |
8394
composer update ${{ matrix.composer-flags }} --no-interaction --no-progress --no-suggest
84-
- name: "Run tests with phpunit/phpunit"
95+
96+
- name: "Run tests with PHPUnit"
8597
env:
8698
SYMFONY_DEPRECATIONS_HELPER: 'max[self]=1'
8799
run: vendor/bin/simple-phpunit
100+
88101
codecov:
89102
name: "Code coverage"
90103
runs-on: ubuntu-latest
91-
env:
92-
XDEBUG_MODE: 'coverage'
93-
strategy:
94-
matrix:
95-
include:
96-
- php-version: 8.1
97-
symfony-version: 6.0.*
98104
steps:
99105
- name: "Checkout"
100-
uses: actions/checkout@v2
106+
uses: actions/checkout@v3
107+
101108
- name: "Setup PHP"
102109
uses: shivammathur/setup-php@v2
103110
with:
104-
coverage: xdebug
105-
php-version: ${{ matrix.php-version }}
106-
- name: "Install dependencies with composer"
107-
run: |
108-
composer remove --dev friendsofphp/php-cs-fixer
109-
composer require symfony/options-resolver:${{ matrix.symfony-version }} --no-interaction --no-update
110-
composer update --no-interaction --no-progress --no-suggest
111-
- name: "Run tests with phpunit/phpunit"
112-
run: |
113-
vendor/bin/simple-phpunit --coverage-text
111+
coverage: pcov
112+
php-version: 8.2
113+
114+
- name: "Install Dependencies with Composer"
115+
uses: ramsey/composer-install@v2
116+
117+
- name: "Run tests with PHPUnit and collect coverage"
118+
run: php -dpcov.enabled=1 -dpcov.directory=. -dpcov.exclude="~vendor~" vendor/bin/simple-phpunit --colors=always --coverage-text -vvv

composer.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@
2020
"symfony/options-resolver": "^4.4|^5.0|^6.0"
2121
},
2222
"require-dev": {
23-
"friendsofphp/php-cs-fixer": "^3.3",
24-
"nyholm/psr7": "^1.2",
25-
"phpstan/phpstan": "^1.0",
26-
"phpstan/phpstan-phpunit": "^1.0",
27-
"symfony/http-client": "^5.0|^6.0",
28-
"symfony/phpunit-bridge": "^5.3|^6.0"
23+
"nyholm/psr7": "^1.5.1",
24+
"php-cs-fixer/shim": "^3.13.2",
25+
"phpstan/phpstan": "^1.9.3",
26+
"phpstan/phpstan-phpunit": "^1.3.2",
27+
"symfony/http-client": "^5.0|^6.2",
28+
"symfony/phpunit-bridge": "^5.3|^6.2"
2929
},
3030
"autoload": {
3131
"psr-4": { "OneSignal\\": "src/" }

phpstan.neon.dist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ parameters:
88
- src/
99
- tests/
1010
tmpDir: %currentWorkingDirectory%/.phpstan
11-
level: 8
11+
level: 9
1212
inferPrivatePropertyTypeFromConstructor: true
1313
checkMissingIterableValueType: false
14-
checkGenericClassInNonGenericObjectType: false
14+
checkGenericClassInNonGenericObjectType: true
1515
checkUninitializedProperties: true
1616
ignoreErrors:
1717
-

0 commit comments

Comments
 (0)