Skip to content

Commit a760545

Browse files
Update dev dependencies, pipelines and Scrutinizer
1 parent 0623cd7 commit a760545

File tree

6 files changed

+102
-88
lines changed

6 files changed

+102
-88
lines changed

.github/workflows/build.yml

+19-43
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ name: build
66

77
jobs:
88
tests:
9-
name: PHP ${{ matrix.php-version }}-${{ matrix.os }}
9+
name: PHP ${{ matrix.php }}-${{ matrix.os }}
10+
1011
env:
11-
extensions: curl, mbstring, dom, intl, json, libxml, xml, xmlwriter
1212
key: cache-v1
1313

1414
runs-on: ${{ matrix.os }}
@@ -19,72 +19,48 @@ jobs:
1919
- ubuntu-latest
2020
- windows-latest
2121

22-
php-version:
22+
php:
2323
- "7.4"
2424
- "8.0"
2525

2626
steps:
2727
- name: Checkout
28-
uses: actions/checkout@v2
29-
30-
- name: Setup cache environment
31-
id: cache-env
32-
uses: shivammathur/cache-extensions@v1
33-
with:
34-
php-version: ${{ matrix.php-version }}
35-
extensions: ${{ env.extensions }}
36-
key: ${{ env.key }}
37-
38-
- name: Cache extensions
39-
uses: actions/cache@v1
40-
with:
41-
path: ${{ steps.cache-env.outputs.dir }}
42-
key: ${{ steps.cache-env.outputs.key }}
43-
restore-keys: ${{ steps.cache-env.outputs.key }}
28+
uses: actions/[email protected]
4429

45-
- name: Install PHP with extensions
30+
- name: Install PHP
4631
uses: shivammathur/setup-php@v2
4732
with:
48-
php-version: ${{ matrix.php-version }}
49-
extensions: ${{ env.extensions }}
33+
php-version: ${{ matrix.php }}
5034
ini-values: date.timezone='UTC'
5135
coverage: pcov
5236
tools: composer:v2
5337

5438
- name: Determine composer cache directory on Linux
5539
if: matrix.os == 'ubuntu-latest'
56-
run: echo "::set-env name=COMPOSER_CACHE_DIR::$(composer config cache-dir)"
40+
run: echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_ENV
5741

5842
- name: Determine composer cache directory on Windows
5943
if: matrix.os == 'windows-latest'
60-
run: ECHO "::set-env name=COMPOSER_CACHE_DIR::~\AppData\Local\Composer"
44+
run: echo "COMPOSER_CACHE_DIR=~\AppData\Local\Composer" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
6145

6246
- name: Cache dependencies installed with composer
6347
uses: actions/cache@v2
6448
with:
6549
path: ${{ env.COMPOSER_CACHE_DIR }}
66-
key: php${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.json') }}
50+
key: php${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
6751
restore-keys: |
68-
php${{ matrix.php-version }}-composer-
52+
php${{ matrix.php }}-composer-
53+
54+
- name: Update composer
55+
run: composer self-update
6956

7057
- name: Install dependencies with composer php 7.4
71-
if: matrix.php-version == '7.4'
72-
run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader
58+
if: matrix.php == '7.4'
59+
run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
7360

7461
- name: Install dependencies with composer php 8.0
75-
if: matrix.php-version == '8.0'
76-
run: composer update --ignore-platform-reqs --prefer-dist --no-interaction --no-progress --optimize-autoloader
77-
78-
- name: Run tests with phpunit and coverage on Linux php 7.4
79-
if: matrix.os == 'ubuntu-latest' && matrix.php-version == '7.4'
80-
run: vendor/bin/phpunit --coverage-clover=coverage.clover
81-
82-
- name: Run tests with phpunit without coverage
83-
if: matrix.os != 'ubuntu-latest' || matrix.php-version != '7.4'
84-
run: vendor/bin/phpunit
62+
if: matrix.php == '8.0'
63+
run: composer update --ignore-platform-reqs --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
8564

86-
- name: Upload code coverage scrutinizer on Linux php 7.4
87-
if: matrix.os == 'ubuntu-latest' && matrix.php-version == '7.4'
88-
run: |
89-
wget https://scrutinizer-ci.com/ocular.phar
90-
php ocular.phar code-coverage:upload --format=php-clover coverage.clover
65+
- name: Run tests with phpunit
66+
run: vendor/bin/phpunit --colors=always

.github/workflows/mutation.yml

+17-15
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ name: mutation test
88

99
jobs:
1010
mutation:
11-
name: PHP ${{ matrix.php-version }}-${{ matrix.os }}
11+
name: PHP ${{ matrix.php }}-${{ matrix.os }}
1212

1313
runs-on: ${{ matrix.os }}
1414

@@ -17,39 +17,41 @@ jobs:
1717
os:
1818
- ubuntu-latest
1919

20-
php-version:
20+
php:
2121
- "7.4"
2222

2323
steps:
24-
- name: "Checkout"
25-
uses: "actions/checkout@v2"
24+
- name: Checkout
25+
uses: actions/checkout@v2.3.4
2626

27-
- name: "Install PHP"
28-
uses: "shivammathur/setup-php@v2"
27+
- name: Install PHP
28+
uses: shivammathur/setup-php@v2
2929
with:
30-
php-version: "${{ matrix.php-version }}"
30+
php-version: "${{ matrix.php }}"
3131
ini-values: memory_limit=-1
3232
coverage: "pcov"
3333
tools: composer:v2
3434

3535
- name: Determine composer cache directory
36-
run: echo "::set-env name=COMPOSER_CACHE_DIR::$(composer config cache-dir)"
36+
run: echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_ENV
3737

3838
- name: Cache dependencies installed with composer
3939
uses: actions/cache@v2
4040
with:
4141
path: ${{ env.COMPOSER_CACHE_DIR }}
42-
key: php${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.json') }}
42+
key: php${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
4343
restore-keys: |
44-
php${{ matrix.php-version }}-composer-
44+
php${{ matrix.php }}-composer-
45+
46+
- name: Update composer
47+
run: composer self-update
4548

4649
- name: Install dependencies with composer
47-
run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader
50+
run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
4851

49-
- name: Run test mutation infection with coverage
52+
- name: Run infection
5053
run: |
51-
mkdir -p build/logs
52-
vendor/bin/phpunit --coverage-xml=build/logs/coverage-xml --log-junit=build/logs/junit.xml
53-
vendor/bin/infection --threads=2 --coverage=build/logs --show-mutations --no-progress --min-msi=10 --min-covered-msi=10
54+
git fetch --depth=1 origin $GITHUB_BASE_REF
55+
vendor/bin/roave-infection-static-analysis-plugin -j2 --git-diff-filter=A --git-diff-base=origin/$GITHUB_BASE_REF --logger-github --ignore-msi-with-no-mutations --only-covered
5456
env:
5557
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}

.github/workflows/static.yml

+15-15
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@ name: static analysis
66

77
jobs:
88
mutation:
9-
name: PHP ${{ matrix.php-version }}-${{ matrix.os }}
10-
env:
11-
extensions: ast
9+
name: PHP ${{ matrix.php }}-${{ matrix.os }}
1210

1311
runs-on: ${{ matrix.os }}
1412

@@ -17,34 +15,36 @@ jobs:
1715
os:
1816
- ubuntu-latest
1917

20-
php-version:
18+
php:
2119
- "7.4"
2220

2321
steps:
24-
- name: "Checkout"
25-
uses: "actions/checkout@v2"
22+
- name: Checkout
23+
uses: actions/checkout@v2.3.4
2624

27-
- name: "Install PHP"
28-
uses: "shivammathur/setup-php@v2"
25+
- name: Install PHP
26+
uses: shivammathur/setup-php@v2
2927
with:
30-
php-version: "${{ matrix.php-version }}"
31-
extensions: ${{ env.extensions }}
28+
php-version: "${{ matrix.php }}"
3229
tools: composer:v2, cs2pr
3330
coverage: none
3431

3532
- name: Determine composer cache directory
36-
run: echo "::set-env name=COMPOSER_CACHE_DIR::$(composer config cache-dir)"
33+
run: echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_ENV
3734

3835
- name: Cache dependencies installed with composer
3936
uses: actions/cache@v2
4037
with:
4138
path: ${{ env.COMPOSER_CACHE_DIR }}
42-
key: php${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.json') }}
39+
key: php${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
4340
restore-keys: |
44-
php${{ matrix.php-version }}-composer-
41+
php${{ matrix.php }}-composer-
42+
43+
- name: Update composer
44+
run: composer self-update
4545

4646
- name: Install dependencies with composer
47-
run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader
47+
run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
4848

49-
- name: Static analysis with psalm
49+
- name: Static analysis
5050
run: vendor/bin/psalm --shepherd --stats --output-format=checkstyle | cs2pr --graceful-warnings --colorize

.scrutinizer.yml

+29-12
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,35 @@
1+
checks:
2+
php: true
3+
4+
filter:
5+
paths:
6+
- "src/*"
7+
18
build:
2-
environment:
3-
php: "7.4"
49
nodes:
510
analysis:
11+
environment:
12+
php: 7.4.12
13+
614
tests:
715
override:
816
- php-scrutinizer-run
9-
filter:
10-
paths:
11-
- "src/*"
12-
checks:
13-
php: true
14-
tools:
15-
php_code_coverage:
16-
enabled: true
17-
external_code_coverage:
18-
timeout: 600
17+
18+
tests-and-coverage:
19+
environment:
20+
php: 7.4.12
21+
22+
dependencies:
23+
override:
24+
- composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
25+
26+
tests:
27+
override:
28+
-
29+
command: "./vendor/bin/phpunit --coverage-clover ./coverage.xml"
30+
on_node: 1
31+
coverage:
32+
file: coverage.xml
33+
format: php-clover
34+
35+

README.md

+19
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
[![Code Coverage](https://scrutinizer-ci.com/g/yiisoft/middleware-dispatcher/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/yiisoft/middleware-dispatcher/?branch=master)
1414
[![Mutation testing badge](https://img.shields.io/endpoint?style=flat&url=https%3A%2F%2Fbadge-api.stryker-mutator.io%2Fgithub.com%2Fyiisoft%2Fmiddleware-dispatcher%2Fmaster)](https://dashboard.stryker-mutator.io/reports/github.com/yiisoft/middleware-dispatcher/master)
1515
[![static analysis](https://github.com/yiisoft/middleware-dispatcher/workflows/static%20analysis/badge.svg)](https://github.com/yiisoft/middleware-dispatcher/actions?query=workflow%3A%22static+analysis%22)
16+
[![type-coverage](https://shepherd.dev/github/yiisoft/middleware-dispatcher/coverage.svg)](https://shepherd.dev/github/yiisoft/middleware-dispatcher)
1617

1718
The package ...
1819

@@ -49,3 +50,21 @@ The code is statically analyzed with [Psalm](https://psalm.dev/). To run static
4950
```php
5051
./vendor/bin/psalm
5152
```
53+
### Support the project
54+
55+
[![Open Collective](https://img.shields.io/badge/Open%20Collective-sponsor-7eadf1?logo=open%20collective&logoColor=7eadf1&labelColor=555555)](https://opencollective.com/yiisoft)
56+
57+
### Follow updates
58+
59+
[![Official website](https://img.shields.io/badge/Powered_by-Yii_Framework-green.svg?style=flat)](https://www.yiiframework.com/)
60+
[![Twitter](https://img.shields.io/badge/twitter-follow-1DA1F2?logo=twitter&logoColor=1DA1F2&labelColor=555555?style=flat)](https://twitter.com/yiiframework)
61+
[![Telegram](https://img.shields.io/badge/telegram-join-1DA1F2?style=flat&logo=telegram)](https://t.me/yii3ru)
62+
[![Facebook](https://img.shields.io/badge/facebook-join-1DA1F2?style=flat&logo=facebook&logoColor=ffffff)](https://www.facebook.com/groups/yiitalk)
63+
[![Slack](https://img.shields.io/badge/slack-join-1DA1F2?style=flat&logo=slack)](https://yiiframework.com/go/slack)
64+
65+
## License
66+
67+
The Yii Middleware Dispatcher is free software. It is released under the terms of the BSD License.
68+
Please see [`LICENSE`](./LICENSE.md) for more information.
69+
70+
Maintained by [Yii Software](https://www.yiiframework.com/).

composer.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@
2424
"yiisoft/injector": "^1.0"
2525
},
2626
"require-dev": {
27-
"infection/infection": "^0.16.3",
28-
"phpunit/phpunit": "^9.3",
2927
"nyholm/psr7": "^1.0",
30-
"vimeo/psalm": "^3.15"
28+
"phpunit/phpunit": "^9.4",
29+
"roave/infection-static-analysis-plugin": "^1.3",
30+
"vimeo/psalm": "^4.1"
3131
},
3232
"autoload": {
3333
"psr-4": {

0 commit comments

Comments
 (0)