Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update PHP versions and add ECS workflow. #10

Merged
merged 3 commits into from
Jan 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ jobs:
os: >-
['ubuntu-latest', 'windows-latest']
php: >-
['8.1', '8.2']
['8.1', '8.2', '8.3']
2 changes: 1 addition & 1 deletion .github/workflows/dependency-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ jobs:
os: >-
['ubuntu-latest']
php: >-
['8.1', '8.2']
['8.1']
34 changes: 34 additions & 0 deletions .github/workflows/ecs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
on:
pull_request:
paths-ignore:
- 'docs/**'
- 'README.md'
- 'CHANGELOG.md'
- '.gitignore'
- '.gitattributes'
- 'infection.json.dist'
- 'phpunit.xml.dist'

push:
branches: ['main']
paths-ignore:
- 'docs/**'
- 'README.md'
- 'CHANGELOG.md'
- '.gitignore'
- '.gitattributes'
- 'infection.json.dist'
- 'phpunit.xml.dist'

name: ecs

jobs:
easy-coding-standard:
uses: php-forge/actions/.github/workflows/ecs.yml@main
secrets:
AUTH_TOKEN: ${{ secrets.AUTH_TOKEN }}
with:
os: >-
['ubuntu-latest']
php: >-
['8.1']
2 changes: 1 addition & 1 deletion .github/workflows/static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ jobs:
os: >-
['ubuntu-latest']
php: >-
['8.1', '8.2']
['8.1']
55 changes: 42 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,33 +6,62 @@
<br>
</p>

## Requirements
<p align="center">
<a href="https://github.com/yii-tools/template/actions/workflows/build.yml" target="_blank">
<img src="https://github.com/yii-tools/template/actions/workflows/build.yml/badge.svg" alt="PHPUnit">
</a>
<a href="https://codecov.io/gh/yii-tools/template" target="_blank">
<img src="https://codecov.io/gh/yii-tools/template/branch/main/graph/badge.svg?token=MF0XUGVLYC" alt="Codecov">
</a>
<a href="https://dashboard.stryker-mutator.io/reports/github.com/yii-tools/template/main" target="_blank">
<img src="https://img.shields.io/endpoint?style=flat&url=https%3A%2F%2Fbadge-api.stryker-mutator.io%2Fgithub.com%2Fyii2-extensions%2Fasset-bootstrap5%2Fmain" alt="Infection">
</a>
<a href="https://github.com/yii-tools/template/actions/workflows/static.yml" target="_blank">
<img src="https://github.com/yii-tools/template/actions/workflows/static.yml/badge.svg" alt="Psalm">
</a>
<a href="https://shepherd.dev/github/yii-tools/template" target="_blank">
<img src="https://shepherd.dev/github/yii-tools/template/coverage.svg" alt="Psalm Coverage">
</a>
<a href="https://github.styleci.io/repos/494495136?branch=main" target="_blank">
<img src="https://github.styleci.io/repos/494495136/shield?branch=main" alt="Style ci">
</a>
</p>

## Installation

The minimun version of `PHP` required by this package is `PHP 8.1`.
The preferred way to install this extension is through [composer](https://getcomposer.org/download/).

For install this package, you need [composer](https://getcomposer.org/).
Either run

```shell
composer require --prefer-dist package
```

or add

```json
"package": "version"
```

to the require-dev section of your `composer.json` file.

## Usage

[Check the documentation docs](/docs/README.md) to learn about usage.

## Testing
## Support versions

[Check the documentation testing](/docs/testing.md) to learn about testing.
[![PHP81](https://img.shields.io/badge/PHP-%3E%3D8.1-787CB5)](https://www.php.net/releases/8.1/en.php)
[![Yii30](https://img.shields.io/badge/Yii%20version-3.0-blue)](https://yiiframework.com)

## CI status
## Testing

[![build](https://github.com/yii-tools/template/actions/workflows/build.yml/badge.svg)](https://github.com/yii-tools/template/actions/workflows/build.yml)
[![codecov](https://codecov.io/gh/yii-tools/template/branch/main/graph/badge.svg?token=MF0XUGVLYC)](https://codecov.io/gh/yii-tools/template)
[![Mutation testing badge](https://img.shields.io/endpoint?style=flat&url=https%3A%2F%2Fbadge-api.stryker-mutator.io%2Fgithub.com%2Fyii-tools%2Ftemplate%2Fmain)](https://dashboard.stryker-mutator.io/reports/github.com/yii-tools/template/main)
[![static analysis](https://github.com/yii-tools/template/actions/workflows/static.yml/badge.svg)](https://github.com/yii-tools/template/actions/workflows/static.yml)
[![type-coverage](https://shepherd.dev/github/yii-tools/template/coverage.svg)](https://shepherd.dev/github/yii-tools/template)
[![StyleCI](https://github.styleci.io/repos/494495136/shield?branch=main)](https://github.styleci.io/repos/494495136?branch=main)
[Check the documentation testing](/docs/testing.md) to learn about testing.

## Our social networks

[![Twitter](https://img.shields.io/badge/twitter-follow-1DA1F2?logo=twitter&logoColor=1DA1F2&labelColor=555555?style=flat)](https://twitter.com/Terabytesoftw)

## License

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.
The MIT License. Please see [License File](LICENSE.md) for more information.
19 changes: 12 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "yii-tools/template",
"type": "library",
"description": "_____",
"description": "template",
"keywords": [
"_____"
"template"
],
"license": "mit",
"minimum-stability": "dev",
Expand All @@ -12,10 +12,11 @@
"php": "^8.1"
},
"require-dev": {
"maglnet/composer-require-checker": "^4.6",
"phpunit/phpunit": "^10.2",
"roave/infection-static-analysis-plugin": "^1.32",
"vimeo/psalm": "^5.1"
"maglnet/composer-require-checker": "^4.7",
"phpunit/phpunit": "^10.5",
"roave/infection-static-analysis-plugin": "^1.34",
"symplify/easy-coding-standard": "^12.1",
"vimeo/psalm": "^5.19"
},
"autoload": {
"psr-4": {
Expand All @@ -40,7 +41,11 @@
},
"scripts": {
"check-dependencies": "composer-require-checker",
"mutation": "roave-infection-static-analysis-plugin",
"easy-coding-standard": "ecs check",
"mutation": [
"Composer\\Config::disableProcessTimeout",
"roave-infection-static-analysis-plugin"
],
"psalm": "psalm",
"test": "phpunit"
}
Expand Down
47 changes: 47 additions & 0 deletions ecs.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?php

declare(strict_types=1);

use PhpCsFixer\Fixer\ClassNotation\ClassDefinitionFixer;
use PhpCsFixer\Fixer\ClassNotation\OrderedClassElementsFixer;
use PhpCsFixer\Fixer\ClassNotation\OrderedTraitsFixer;
use PhpCsFixer\Fixer\Import\NoUnusedImportsFixer;
use Symplify\EasyCodingStandard\Config\ECSConfig;
use Symplify\EasyCodingStandard\ValueObject\Set\SetList;

return function (ECSConfig $ecsConfig): void {
$ecsConfig->paths(
[
__DIR__ . '/src',
__DIR__ . '/tests',
]
);

// this way you add a single rule
$ecsConfig->rules(
[
OrderedClassElementsFixer::class,
OrderedTraitsFixer::class,
NoUnusedImportsFixer::class,
]
);

// this way you can add sets - group of rules
$ecsConfig->sets(
[
// run and fix, one by one
SetList::DOCBLOCK,
SetList::NAMESPACES,
SetList::COMMENTS,
SetList::PSR_12,
]
);

// this way configures a rule
$ecsConfig->ruleWithConfiguration(
ClassDefinitionFixer::class,
[
'space_before_parenthesis' => true,
],
);
};