Skip to content

Commit 85fec60

Browse files
Update dev dependencies, pipelines and Scrutinizer
1 parent 100f975 commit 85fec60

File tree

7 files changed

+123
-90
lines changed

7 files changed

+123
-90
lines changed

.github/workflows/bc.yml_

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
on:
2+
- pull_request
3+
- push
4+
5+
name: backwards compatibility
6+
jobs:
7+
roave_bc_check:
8+
name: Roave BC Check
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@master
12+
- name: fetch tags
13+
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
14+
- name: Roave BC Check
15+
uses: docker://nyholm/roave-bc-check-ga

.github/workflows/build.yml

+19-47
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,76 +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 on Linux php 8.0
83-
if: matrix.os == 'ubuntu-latest' && matrix.php-version == '8.0'
84-
run: vendor/bin/phpunit
85-
86-
- name: Run tests with phpunit without coverage on Windows
87-
if: matrix.os == 'windows-latest'
88-
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
8964

90-
- name: Upload code coverage scrutinizer on Linux php 7.4
91-
if: matrix.os == 'ubuntu-latest' && matrix.php-version == '7.4'
92-
run: |
93-
wget https://scrutinizer-ci.com/ocular.phar
94-
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

+18-13
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,36 +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
50-
run: vendor/bin/infection --no-progress
52+
- name: Run infection
53+
run: |
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
5156
env:
5257
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}

.github/workflows/static.yml

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

77
jobs:
88
mutation:
9-
name: PHP ${{ matrix.php-version }}-${{ matrix.os }}
9+
name: PHP ${{ matrix.php }}-${{ matrix.os }}
1010

1111
runs-on: ${{ matrix.os }}
1212

@@ -15,33 +15,36 @@ jobs:
1515
os:
1616
- ubuntu-latest
1717

18-
php-version:
18+
php:
1919
- "7.4"
2020

2121
steps:
22-
- name: "Checkout"
23-
uses: "actions/checkout@v2"
22+
- name: Checkout
23+
uses: actions/checkout@v2.3.4
2424

25-
- name: "Install PHP"
26-
uses: "shivammathur/setup-php@v2"
25+
- name: Install PHP
26+
uses: shivammathur/setup-php@v2
2727
with:
28-
php-version: "${{ matrix.php-version }}"
28+
php-version: "${{ matrix.php }}"
2929
tools: composer:v2, cs2pr
3030
coverage: none
3131

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

3535
- name: Cache dependencies installed with composer
3636
uses: actions/cache@v2
3737
with:
3838
path: ${{ env.COMPOSER_CACHE_DIR }}
39-
key: php${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.json') }}
39+
key: php${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
4040
restore-keys: |
41-
php${{ matrix.php-version }}-composer-
41+
php${{ matrix.php }}-composer-
42+
43+
- name: Update composer
44+
run: composer self-update
4245

4346
- name: Install dependencies with composer
44-
run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader
47+
run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
4548

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

.scrutinizer.yml

+30-12
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,36 @@
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 self-update
25+
- composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
26+
27+
tests:
28+
override:
29+
-
30+
command: "./vendor/bin/phpunit --coverage-clover ./coverage.xml"
31+
on_node: 1
32+
coverage:
33+
file: coverage.xml
34+
format: php-clover
35+
36+

README.md

+23-3
Original file line numberDiff line numberDiff line change
@@ -15,29 +15,49 @@ The package allows responding with data that is automatically converted into PSR
1515
[![Code Coverage](https://scrutinizer-ci.com/g/yiisoft/data-response/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/yiisoft/data-response/?branch=master)
1616
[![Mutation testing badge](https://img.shields.io/endpoint?style=flat&url=https%3A%2F%2Fbadge-api.stryker-mutator.io%2Fgithub.com%2Fyiisoft%2Fdata-response%2Fmaster)](https://dashboard.stryker-mutator.io/reports/github.com/yiisoft/data-response/master)
1717
[![static analysis](https://github.com/yiisoft/data-response/workflows/static%20analysis/badge.svg)](https://github.com/yiisoft/data-response/actions?query=workflow%3A%22static+analysis%22)
18+
[![type-coverage](https://shepherd.dev/github/yiisoft/data-response/coverage.svg)](https://shepherd.dev/github/yiisoft/data-response)
1819

1920
## General usage
2021

2122
### Unit testing
2223

2324
The package is tested with [PHPUnit](https://phpunit.de/). To run tests:
2425

25-
```php
26+
```shell
2627
./vendor/bin/phpunit
2728
```
2829

2930
### Mutation testing
3031

3132
The package tests are checked with [Infection](https://infection.github.io/) mutation framework. To run it:
3233

33-
```php
34+
```shell
3435
./vendor/bin/infection
3536
```
3637

3738
### Static analysis
3839

3940
The code is statically analyzed with [Psalm](https://psalm.dev/). To run static analysis:
4041

41-
```php
42+
```shell
4243
./vendor/bin/psalm
4344
```
45+
46+
### Support the project
47+
48+
[![Open Collective](https://img.shields.io/badge/Open%20Collective-sponsor-7eadf1?logo=open%20collective&logoColor=7eadf1&labelColor=555555)](https://opencollective.com/yiisoft)
49+
50+
### Follow updates
51+
52+
[![Official website](https://img.shields.io/badge/Powered_by-Yii_Framework-green.svg?style=flat)](https://www.yiiframework.com/)
53+
[![Twitter](https://img.shields.io/badge/twitter-follow-1DA1F2?logo=twitter&logoColor=1DA1F2&labelColor=555555?style=flat)](https://twitter.com/yiiframework)
54+
[![Telegram](https://img.shields.io/badge/telegram-join-1DA1F2?style=flat&logo=telegram)](https://t.me/yii3en)
55+
[![Facebook](https://img.shields.io/badge/facebook-join-1DA1F2?style=flat&logo=facebook&logoColor=ffffff)](https://www.facebook.com/groups/yiitalk)
56+
[![Slack](https://img.shields.io/badge/slack-join-1DA1F2?style=flat&logo=slack)](https://yiiframework.com/go/slack)
57+
58+
## License
59+
60+
The Data response is free software. It is released under the terms of the BSD License.
61+
Please see [`LICENSE`](./LICENSE.md) for more information.
62+
63+
Maintained by [Yii Software](https://www.yiiframework.com/).

composer.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@
2727
"yiisoft/strings": "^1.0"
2828
},
2929
"require-dev": {
30-
"infection/infection": "^0.16.3",
31-
"phpunit/phpunit": "^9.3",
3230
"nyholm/psr7": "^1.0",
33-
"vimeo/psalm": "^4.0"
31+
"phpunit/phpunit": "^9.4",
32+
"roave/infection-static-analysis-plugin": "^1.3",
33+
"vimeo/psalm": "^4.1"
3434
},
3535
"autoload": {
3636
"psr-4": {

0 commit comments

Comments
 (0)