Skip to content
This repository has been archived by the owner on Jun 29, 2022. It is now read-only.

Commit

Permalink
Update dev dependencies, pipelines and Scrutinizer
Browse files Browse the repository at this point in the history
  • Loading branch information
terabytesoftw authored and devanych committed Feb 1, 2021
1 parent 3c5a606 commit 8b1fb74
Show file tree
Hide file tree
Showing 8 changed files with 158 additions and 120 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/bc.yml_
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
on:
- pull_request
- push

name: backwards compatibility
jobs:
roave_bc_check:
name: Roave BC Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: fetch tags
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
- name: Roave BC Check
uses: docker://nyholm/roave-bc-check-ga
39 changes: 7 additions & 32 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ jobs:
name: PHP ${{ matrix.php }}-${{ matrix.os }}

env:
extensions: dom, json
key: cache-v1

runs-on: ${{ matrix.os }}
Expand All @@ -28,26 +27,10 @@ jobs:
- name: Checkout
uses: actions/[email protected]

- name: Setup cache environment
id: cache-env
uses: shivammathur/[email protected]
with:
php-version: ${{ matrix.php }}
extensions: ${{ env.extensions }}
key: ${{ env.key }}

- name: Cache extensions
uses: actions/cache@v2
with:
path: ${{ steps.cache-env.outputs.dir }}
key: ${{ steps.cache-env.outputs.key }}
restore-keys: ${{ steps.cache-env.outputs.key }}

- name: Install PHP with extensions
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: ${{ env.extensions }}
ini-values: date.timezone='UTC'
coverage: pcov
tools: composer:v2
Expand All @@ -68,24 +51,16 @@ jobs:
restore-keys: |
php${{ matrix.php }}-composer-
- name: Update composer
run: composer self-update

- name: Install dependencies with composer php 7.4
if: matrix.php == '7.4'
run: composer install --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi

- name: Install dependencies with composer php 8.0
if: matrix.php == '8.0'
run: composer install --ignore-platform-reqs --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
run: composer update --ignore-platform-reqs --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi

- name: Run tests with phpunit and coverage on Linux php 7.4
if: matrix.os == 'ubuntu-latest' && matrix.php == '7.4'
run: vendor/bin/phpunit --coverage-clover=coverage.clover --colors=always

- name: Run tests with phpunit without coverage
if: matrix.os != 'ubuntu-latest' || matrix.php != '7.4'
- name: Run tests with phpunit
run: vendor/bin/phpunit --colors=always

- name: Upload code coverage scrutinizer on Linux php 7.4
if: matrix.os == 'ubuntu-latest' && matrix.php == '7.4'
run: |
wget https://scrutinizer-ci.com/ocular.phar
php ocular.phar code-coverage:upload --format=php-clover coverage.clover
57 changes: 57 additions & 0 deletions .github/workflows/mutation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
on:
pull_request:
push:
branches:
- "master"

name: mutation test

jobs:
mutation:
name: PHP ${{ matrix.php }}-${{ matrix.os }}

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

strategy:
matrix:
os:
- ubuntu-latest

php:
- "7.4"

steps:
- name: Checkout
uses: actions/[email protected]

- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: "${{ matrix.php }}"
ini-values: memory_limit=-1
coverage: "pcov"
tools: composer:v2

- name: Determine composer cache directory
run: echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_ENV

- name: Cache dependencies installed with composer
uses: actions/cache@v2
with:
path: ${{ env.COMPOSER_CACHE_DIR }}
key: php${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: |
php${{ matrix.php }}-composer-
- name: Update composer
run: composer self-update

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

- name: Run infection
run: |
git fetch --depth=1 origin $GITHUB_BASE_REF
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
env:
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}
7 changes: 5 additions & 2 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
extensions: ${{ env.extensions }}
php-version: "${{ matrix.php }}"
tools: composer:v2, cs2pr
coverage: none

Expand All @@ -40,8 +40,11 @@ jobs:
restore-keys: |
php${{ matrix.php }}-composer-
- name: Update composer
run: composer self-update

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

- name: Static analysis with psalm
- name: Static analysis
run: vendor/bin/psalm --shepherd --stats --output-format=checkstyle | cs2pr --graceful-warnings --colorize
42 changes: 30 additions & 12 deletions .scrutinizer.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,36 @@
checks:
php: true

filter:
paths:
- "src/*"

build:
environment:
php: "7.4.12"
nodes:
analysis:
environment:
php: 7.4.12

tests:
override:
- php-scrutinizer-run
filter:
paths:
- "src/*"
checks:
php: true
tools:
php_code_coverage:
enabled: true
external_code_coverage:
timeout: 600

tests-and-coverage:
environment:
php: 7.4.12

dependencies:
override:
- composer self-update
- composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi

tests:
override:
-
command: "./vendor/bin/phpunit --coverage-clover ./coverage.xml"
on_node: 1
coverage:
file: coverage.xml
format: php-clover


101 changes: 27 additions & 74 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,110 +6,63 @@
<br>
</p>

[Yii Framework] is a modern framework designed to be a solid foundation for your PHP application.

This [Yii Framework] extension allows easy creation of web applications.

[Yii Framework]: https://github.com/yiisoft/core

[![Latest Stable Version](https://poser.pugx.org/yiisoft/yii-web/v/stable.png)](https://packagist.org/packages/yiisoft/yii-web)
[![Total Downloads](https://poser.pugx.org/yiisoft/yii-web/downloads.png)](https://packagist.org/packages/yiisoft/yii-web)
[![Build Status](https://github.com/yiisoft/yii-web/workflows/build/badge.svg)](https://github.com/yiisoft/yii-web/actions?query=workflow%3Abuild)
[![Scrutinizer Quality Score](https://scrutinizer-ci.com/g/yiisoft/yii-web/badges/quality-score.png?s=b1074a1ff6d0b214d54fa5ab7abbb90fc092471d)](https://scrutinizer-ci.com/g/yiisoft/yii-web/)
[![Code Coverage](https://scrutinizer-ci.com/g/yiisoft/yii-web/badges/coverage.png?s=31d80f1036099e9d6a3e4d7738f6b000b3c3d10e)](https://scrutinizer-ci.com/g/yiisoft/yii-web/)
[![Mutation testing badge](https://img.shields.io/endpoint?style=flat&url=https%3A%2F%2Fbadge-api.stryker-mutator.io%2Fgithub.com%2Fyiisoft%2Fyii-web%2Fmaster)](https://dashboard.stryker-mutator.io/reports/github.com/yiisoft/yii-web/master)
[![static analysis](https://github.com/yiisoft/yii-web/workflows/static%20analysis/badge.svg)](https://github.com/yiisoft/yii-web/actions?query=workflow%3A%22static+analysis%22)
[![type-coverage](https://shepherd.dev/github/yiisoft/yii-web/coverage.svg)](https://shepherd.dev/github/yiisoft/yii-web)

Installation
------------

- The minimum required PHP version of Yii 3.0 is PHP 7.4.
- [Follow the Definitive Guide](https://github.com/yiisoft/docs/tree/master/guide/en)
in order to get step by step instructions.

Documentation
-------------

- A [Definitive Guide](https://github.com/yiisoft/docs/tree/master/guide/en) and
a [Class Reference](#) cover every detail
of the framework.

Community
---------

- Participate in [discussions at forums](https://www.yiiframework.com/forum/).
- [Community Slack](https://join.slack.com/t/yii/shared_invite/MjIxMjMxMTk5MTU1LTE1MDE3MDAwMzMtM2VkMTMyMjY1Ng) and [Chat in IRC](https://www.yiiframework.com/chat/).
- Follow us on [Facebook](https://www.facebook.com/groups/yiitalk/), [Twitter](https://twitter.com/yiiframework)
and [GitHub](https://github.com/yiisoft/yii2).
- Check [other communities](https://github.com/yiisoft/yii2/wiki/communities).
## Installation

Contributing
------------

The framework is [Open Source](LICENSE.md) powered by [an excellent community](https://github.com/yiisoft/yii2/graphs/contributors).

You may join us and:

- [Report an issue](docs/internals/report-an-issue.md)
- [Translate documentation or messages](docs/internals/translation-workflow.md)
- [Give us feedback or start a design discussion](http://www.yiiframework.com/forum/index.php/forum/42-general-discussions-for-yii-20/)
- [Contribute to the core code or fix bugs](docs/internals/git-workflow.md)

### Reporting Security issues

Please refer to a [special page at the website](https://www.yiiframework.com/security/)
describing proper workflow for security issue reports.

### Directory Structure
The package could be installed with composer:

```
build/ internally used build tools
docs/ documentation
framework/ core framework code
tests/ tests of the core framework code
composer require yiisoft/yii-web
```
## General usage

### Spreading the Word

Acknowledging or citing Yii is as important as direct contributions.

**In presentations**

If you are giving a presentation or talk featuring work that makes use of Yii and would like to acknowledge it,
we suggest using [our logo](https://www.yiiframework.com/logo/) on your title slide.

**In projects**

If you are using Yii as part of an OpenSource project, a way to acknowledge it is to
[use a special badge](https://img.shields.io/badge/Powered_by-Yii_Framework-green.svg?style=flat) in your README:

![Yii](https://img.shields.io/badge/Powered_by-Yii_Framework-green.svg?style=flat)
### Unit testing

If your code is hosted at GitHub, you can place the following in your README.md file to get the badge:
The package is tested with [PHPUnit](https://phpunit.de/). To run tests:

```
[![Yii](https://img.shields.io/badge/Powered_by-Yii_Framework-green.svg?style=flat)](http://www.yiiframework.com/)
```shell
./vendor/bin/phpunit
```

### Unit testing
### Mutation testing

The package is tested with [PHPUnit](https://phpunit.de/). To run tests:
The package tests are checked with [Infection](https://infection.github.io/) mutation framework. To run it:

```php
./vendor/bin/phpunit
```shell
./vendor/bin/infection
```

### Static analysis

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

```php
```shell
./vendor/bin/psalm
```

### Support the project

[![Open Collective](https://img.shields.io/badge/Open%20Collective-sponsor-7eadf1?logo=open%20collective&logoColor=7eadf1&labelColor=555555)](https://opencollective.com/yiisoft)

### Follow updates

[![Official website](https://img.shields.io/badge/Powered_by-Yii_Framework-green.svg?style=flat)](https://www.yiiframework.com/)
[![Twitter](https://img.shields.io/badge/twitter-follow-1DA1F2?logo=twitter&logoColor=1DA1F2&labelColor=555555?style=flat)](https://twitter.com/yiiframework)
[![Telegram](https://img.shields.io/badge/telegram-join-1DA1F2?style=flat&logo=telegram)](https://t.me/yii3en)
[![Facebook](https://img.shields.io/badge/facebook-join-1DA1F2?style=flat&logo=facebook&logoColor=ffffff)](https://www.facebook.com/groups/yiitalk)
[![Slack](https://img.shields.io/badge/slack-join-1DA1F2?style=flat&logo=slack)](https://yiiframework.com/go/slack)

## License

The Yii Web is free software. It is released under the terms of the BSD License.
The Yii Framework Web Extension is free software. It is released under the terms of the BSD License.
Please see [`LICENSE`](./LICENSE.md) for more information.

Maintained by [Yii Software](https://www.yiiframework.com/).
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"require-dev": {
"nyholm/psr7": "^1.0",
"phpunit/phpunit": "^9.4",
"roave/infection-static-analysis-plugin": "^1.3",
"vimeo/psalm": "^4.1",
"yiisoft/cache": "^3.0@dev",
"yiisoft/composer-config-plugin": "^1.0@dev",
Expand Down
16 changes: 16 additions & 0 deletions infection.json.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"source": {
"directories": [
"src"
]
},
"logs": {
"text": "php:\/\/stderr",
"badge": {
"branch": "master"
}
},
"mutators": {
"@default": true
}
}

0 comments on commit 8b1fb74

Please sign in to comment.