Skip to content

Commit

Permalink
Update template.
Browse files Browse the repository at this point in the history
  • Loading branch information
terabytesoftw committed Jul 2, 2023
1 parent ace469c commit 127120c
Show file tree
Hide file tree
Showing 10 changed files with 93 additions and 85 deletions.
23 changes: 14 additions & 9 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Autodetect text files
* text=auto
* text=auto eol=lf

# ...Unless the name matches the following overriding patterns

Expand All @@ -21,14 +21,19 @@
*.gif binary
*.ttf binary

# Ignore some meta files when creating an archive of this repository
/.github export-ignore
/.editorconfig export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.scrutinizer.yml export-ignore
/docs export-ignore

# Avoid merge conflicts in CHANGELOG
# https://about.gitlab.com/2015/02/10/gitlab-reduced-merge-conflicts-by-90-percent-with-changelog-placeholders/
/CHANGELOG.md merge=union

# Exclude files from the archive
/.gitattributes export-ignore
/.github export-ignore
/.gitignore export-ignore
/.styleci.yml export-ignore
/codeception.yml export-ignore
/composer-require-checker.json export-ignore
/docs export-ignore
/phpunit.xml.dist export-ignore
/psalm.xml export-ignore
/rector.php export-ignore
/tests export-ignore
4 changes: 3 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ name: build

jobs:
phpunit:
uses: yiisoft/actions/.github/workflows/phpunit.yml@master
uses: php-forge/actions/.github/workflows/phpunit.yml@main
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
os: >-
['ubuntu-latest', 'windows-latest']
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dependency-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ name: dependency-check

jobs:
composer-require-checker:
uses: yiisoft/actions/.github/workflows/composer-require-checker.yml@master
uses: php-forge/actions/.github/workflows/composer-require-checker.yml@main
with:
os: >-
['ubuntu-latest']
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/mutation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ name: mutation test

jobs:
mutation:
uses: yiisoft/actions/.github/workflows/roave-infection.yml@master
uses: php-forge/actions/.github/workflows/roave-infection.yml@main
secrets:
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}
with:
os: >-
['ubuntu-latest']
php: >-
['8.1']
secrets:
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}
2 changes: 1 addition & 1 deletion .github/workflows/static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ name: static analysis

jobs:
psalm:
uses: yiisoft/actions/.github/workflows/psalm.yml@master
uses: php-forge/actions/.github/workflows/psalm.yml@main
with:
os: >-
['ubuntu-latest']
Expand Down
6 changes: 2 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,12 @@

# phpunit
phpunit.phar
/phpunit.xml
.phpunit.result.cache
.phpunit.cache
phpunit.xlm

#yii3 config packages
/config/packages

# windows thumbnail cache
Thumbs.db

# package-lock.json
package-lock.json
46 changes: 10 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,45 +6,19 @@
<br>
</p>

## Install
## Requirements

For use create a new repository from this template. For more information see [Creating a repository from a template](https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/creating-a-repository-from-a-template).
The minimun version of `PHP` required by this package is `PHP 8.1`.

Also you can git clone this repository. For more information see [Cloning a repository](https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/cloning-a-repository).
For install this package, you need [composer](https://getcomposer.org/).

## Checking dependencies
## Usage

This package uses [composer-require-checker](https://github.com/maglnet/ComposerRequireChecker) to check if all dependencies are correctly defined in `composer.json`.

To run the checker, execute the following command:

```shell
composer run check-dependencies
```

## Mutation testing

Mutation testing is checked with [Infection](https://infection.github.io/). To run it:

```shell
composer run mutation
```

## Static analysis

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

```shell
composer run psalm
```
[Check the documentation docs](/docs/README.md) to learn about usage.

## Testing

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

```
composer run test
```
[Check the documentation testing](/docs/testing.md) to learn about testing.

## CI status

Expand All @@ -55,10 +29,10 @@ composer run test
[![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)

## License

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

## 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.
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
"php": "^8.1"
},
"require-dev": {
"maglnet/composer-require-checker": "^4.3",
"phpunit/phpunit": "^9.5",
"roave/infection-static-analysis-plugin": "^1.28",
"vimeo/psalm": "^5.6"
"maglnet/composer-require-checker": "^4.6",
"phpunit/phpunit": "^10.2",
"roave/infection-static-analysis-plugin": "^1.32",
"vimeo/psalm": "^5.1"
},
"autoload": {
"psr-4": {
Expand Down
35 changes: 35 additions & 0 deletions docs/testing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Testing

## Checking dependencies

This package uses [composer-require-checker](https://github.com/maglnet/ComposerRequireChecker) to check if all dependencies are correctly defined in `composer.json`.

To run the checker, execute the following command:

```shell
composer run check-dependencies
```

## Mutation testing

Mutation testing is checked with [Infection](https://infection.github.io/). To run it:

```shell
composer run mutation
```

## Static analysis

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

```shell
composer run psalm
```

## Unit tests

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

```
composer run test
```
46 changes: 20 additions & 26 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,30 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>

<?xml version="1.0" encoding="UTF-8"?>
<phpunit
bootstrap="vendor/autoload.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
stopOnFailure="false"
verbose="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.2/phpunit.xsd"
bootstrap="vendor/autoload.php"
cacheDirectory=".phpunit.cache"
colors="true"
executionOrder="depends,defects"
failOnRisky="true"
failOnWarning="true"
stopOnFailure="false"
>
<php>
<ini name="error_reporting" value="-1" />
</php>

<coverage>
<include>
<directory>./src</directory>
</include>
<exclude>
<directory>./vendor</directory>
</exclude>
</coverage>
<testsuites>
<testsuite name="Template">
<directory>tests</directory>
</testsuite>
</testsuites>

<testsuites>
<testsuite name="Template">
<directory>./tests</directory>
</testsuite>
</testsuites>
<source>
<include>
<directory suffix=".php">./src</directory>
</include>
</source>
</phpunit>

0 comments on commit 127120c

Please sign in to comment.