Skip to content
This repository has been archived by the owner on Mar 5, 2024. It is now read-only.

Commit

Permalink
Merge pull request #40 from elbgoods/v2
Browse files Browse the repository at this point in the history
V2
  • Loading branch information
Gummibeer authored Nov 5, 2020
2 parents d1e2976 + f7f27f2 commit 378d70a
Show file tree
Hide file tree
Showing 19 changed files with 225 additions and 266 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/composer-normalize.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,23 @@ name: normalize composer.json
on:
push:
paths:
- 'composer.json'
- "composer.json"

jobs:
normalize:
timeout-minutes: 1
runs-on: ubuntu-latest
steps:
- name: Git checkout
uses: actions/checkout@v2

- name: Validate Composer configuration
run: composer validate --strict

- name: normalize composer.json
run: |
composer global require ergebnis/composer-normalize
composer normalize
composer normalize --indent-style=space --indent-size=4 --no-check-lock --no-update-lock --no-interaction --ansi
- uses: stefanzweifel/[email protected]
with:
Expand Down
54 changes: 28 additions & 26 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,40 +6,42 @@ jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: true
fail-fast: false
matrix:
php: [7.4, 7.3, 7.2]
dependency-version: [prefer-lowest, prefer-stable]
php: [ 7.4, 7.3 ]
laravel: [ 8.*, 7.* ]

name: P${{ matrix.php }} - ${{ matrix.dependency-version }}
name: P${{ matrix.php }} - L${{ matrix.laravel }}

steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, mysql, mysqli, pdo_mysql, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo
coverage: none
tools: composer:v2

- name: Checkout code
uses: actions/checkout@v1
uses: actions/checkout@v2

- name: Cache dependencies
uses: actions/cache@v1
uses: actions/cache@v2
with:
path: ~/.composer/cache
key: dependencies-laravel-php-${{ matrix.php }}-${{ matrix.dependency-version}}-composer-${{ hashFiles('composer.json') }}
key: dependencies-laravel-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}
restore-keys: |
dependencies-laravel-php-${{ matrix.php }}-composer-
dependencies-laravel-php-
- name: Install dependencies
run: composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest

- name: php-cs-test
run: bin/php-cs-test

- name: php-md-test
run: bin/php-md-test ./src

- name: php-tlint-test
run: bin/php-tlint-test ./src

- name: php-insights-test
run: bin/php-insights-test

- name: php-stan-test
run: bin/php-stan-test

- name: php-mn-test
run: bin/php-mn-test ./src
run: |
composer require --dev "laravel/framework:${{ matrix.laravel }}" --no-interaction --no-update
composer update --prefer-stable --prefer-dist --no-interaction --no-suggest
- run: bin/php-cs-test
- run: bin/php-mn-test ./src
- run: bin/php-md-test ./src
- run: bin/php-tlint-test ./src
- run: bin/php-insights-test
- run: bin/php-stan-test
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/vendor
/node_modules
/vendor/
/node_modules/
composer.lock
/vendor-bin/*/vendor/
/vendor-bin/*/composer.lock
63 changes: 43 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,7 @@
## Installation

```bash
composer require --dev bamarni/composer-bin-plugin:^1.4 jasonmccreary/laravel-test-assertions:^0.4.1
composer bin ci require --dev elbgoods/ci-test-tools

yarn add --dev elbgoods/ci-test-tools
```

If you experience a `PHP Fatal error: Allowed memory size` error, fix your setup or use:
```bash
COMPOSER_MEMORY_LIMIT=-1 composer require --dev elbgoods/ci-test-tools
composer require --dev bamarni/composer-bin-plugin elbgoods/ci-test-tools
```

## PHP
Expand All @@ -26,6 +18,12 @@ COMPOSER_MEMORY_LIMIT=-1 composer require --dev elbgoods/ci-test-tools
* **tool:** https://github.com/FriendsOfPHP/PHP-CS-Fixer
* **config:** [configs/.php_cs.dist](configs/.php_cs.dist)

#### Installation

```bash
composer bin php-cs require --dev friendsofphp/php-cs-fixer
```

#### Usage

```bash
Expand Down Expand Up @@ -53,7 +51,12 @@ If you want to adjust the default configuration you can use your `composer.json[
### TLint

* **tool:** https://github.com/tightenco/tlint
* **config:** [src/TlintPreset.php](src/TlintPreset.php)

#### Installation

```bash
composer bin php-tlint require --dev tightenco/tlint
```

#### Usage

Expand All @@ -67,7 +70,11 @@ You have to create a `tlint.json` file on your project root level with the follo

```json
{
"preset": "\\Elbgoods\\CiTestTools\\TlintPreset"
"preset": "laravel",
"disabled": [
"NoInlineVarDocs",
"NoParensEmptyInstantiations"
]
}
```

Expand All @@ -76,35 +83,45 @@ You have to create a `tlint.json` file on your project root level with the follo
* **tool:** https://github.com/phpmd/phpmd
* **config:** [configs/phpmd.xml](configs/phpmd.xml)

#### Usage
#### Installation

```bash
vendor/bin/php-md-test
composer bin php-md require --dev phpmd/phpmd
```

#### Configuration
#### Usage

If you think that a rule should be adjusted/ignored open a PR in [this repo](https://github.com/elbgoods/ci-test-tools) to discuss it.
```bash
vendor/bin/php-md-test
```

### PHP Insights

* **tool:** https://github.com/nunomaduro/phpinsights
* **config:** [configs/phpinsights.php](configs/phpinsights.php)

#### Usage
#### Installation

```bash
vendor/bin/php-insights-test
composer bin php-insights require --dev nunomaduro/phpinsights
```

#### Configuration
#### Usage

If you think that a rule should be adjusted/ignored open a PR in [this repo](https://github.com/elbgoods/ci-test-tools) to discuss it.
```bash
vendor/bin/php-insights-test
```

### PHPMND

* **tool:** https://github.com/povils/phpmnd

#### Installation

```bash
composer bin php-mn require --dev povils/phpmnd
```

#### Usage

```bash
Expand All @@ -116,6 +133,12 @@ vendor/bin/php-mn-test
* **tool:** https://github.com/nunomaduro/larastan
* **config:** [configs/phpstan.neon.dist](configs/phpstan.neon.dist)

#### Installation

```bash
composer bin php-stan require --dev nunomaduro/larastan
```

#### Usage

```bash
Expand All @@ -128,7 +151,7 @@ You have to create a `phpstan.neon.dist` file on your project root level with th

```neon
includes:
- ./vendor/nunomaduro/larastan/extension.neon
- ./vendor-bin/php-stan/vendor/nunomaduro/larastan/extension.neon
- ./vendor/elbgoods/ci-test-tools/configs/phpstan.neon.dist
parameters:
Expand Down
113 changes: 61 additions & 52 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,56 +1,65 @@
{
"name": "elbgoods/ci-test-tools",
"description": "CI Test Tools used by Elbgoods GmbH",
"keywords": [],
"license": "MIT",
"authors": [
{
"name": "Tom Witkowski",
"email": "[email protected]",
"homepage": "https://gummibeer.de",
"role": "Developer"
}
],
"require": {
"php": "^7.2",
"friendsofphp/php-cs-fixer": "^2.16.1",
"illuminate/support": "^6.0 || ^7.0",
"jasonmccreary/laravel-test-assertions": "^0.3",
"nunomaduro/larastan": "^0.5.0",
"nunomaduro/phpinsights": "^1.14",
"orchestra/testbench": "^4.0 || ^5.0",
"pdepend/pdepend": "@stable",
"phpmd/phpmd": "^2.8",
"phpstan/phpstan": "^0.12.8",
"phpunit/phpunit": "^8.0 || ^9.0",
"povils/phpmnd": "^2.2",
"tightenco/tlint": "^5.0.5"
},
"require-dev": {
"illuminate/database": "^6.0 || ^7.0",
"laravel/framework": "^6.0 || ^7.0",
"spatie/enum": "^2.3"
},
"autoload": {
"psr-4": {
"Elbgoods\\CiTestTools\\": "src/"
"name": "elbgoods/ci-test-tools",
"description": "CI Test Tools used by Elbgoods GmbH",
"keywords": [],
"license": "MIT",
"authors": [
{
"name": "Tom Witkowski",
"email": "[email protected]",
"homepage": "https://gummibeer.de",
"role": "Developer"
}
],
"require": {
"php": "^7.3 || ^8.0",
"illuminate/database": "^7.0 || ^8.0",
"illuminate/support": "^7.0 || ^8.0",
"illuminate/testing": "^7.0 || ^8.0",
"phpunit/phpunit": "^9.3"
},
"require-dev": {
"bamarni/composer-bin-plugin": "^1.4"
},
"files": [
"override/SlevomatCodingStandard/Helpers/SuppressHelper.php"
"suggest": {
"friendsofphp/php-cs-fixer": "vendor/bin/php-cs-test",
"nunomaduro/larastan": "vendor/bin/php-stan-test",
"nunomaduro/phpinsights": "vendor/bin/php-insights-test",
"phpmd/phpmd": "vendor/bin/php-md-test",
"povils/phpmnd": "vendor/bin/php-mn-test",
"tightenco/tlint": "vendor/bin/php-tlint-test"
},
"autoload": {
"psr-4": {
"Elbgoods\\CiTestTools\\": "src/"
}
},
"minimum-stability": "dev",
"prefer-stable": true,
"bin": [
"bin/php-cs-fix",
"bin/php-cs-test",
"bin/php-insights-test",
"bin/php-md-test",
"bin/php-mn-test",
"bin/php-stan-test",
"bin/php-tlint-test"
],
"exclude-from-classmap": [
"vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/SuppressHelper.php"
]
},
"minimum-stability": "dev",
"prefer-stable": true,
"bin": [
"bin/php-cs-fix",
"bin/php-cs-test",
"bin/php-insights-test",
"bin/php-md-test",
"bin/php-mn-test",
"bin/php-stan-test",
"bin/php-tlint-test"
]
"scripts": {
"post-install-cmd": [
"@composer bin all install --ansi --no-interaction --quiet"
],
"post-update-cmd": [
"@composer bin all update --ansi --no-interaction --quiet"
],
"bin": "echo 'composer install --dev'",
"test": [
"bin/php-cs-test",
"bin/php-mn-test ./src",
"bin/php-md-test ./src",
"bin/php-tlint-test ./src",
"bin/php-insights-test",
"bin/php-stan-test"
]
}
}
3 changes: 0 additions & 3 deletions configs/phpstan.neon.dist
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
parameters:
level: 5
checkMissingIterableValueType: false
ignoreErrors:
- '#Unsafe usage of new static#'
- '#PHPDoc tag @var for variable \$[a-zA-Z0-9]+ has invalid type .+#'
4 changes: 1 addition & 3 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
includes:
- ./vendor/nunomaduro/larastan/extension.neon
- ./vendor-bin/php-stan/vendor/nunomaduro/larastan/extension.neon
- ./configs/phpstan.neon.dist

parameters:
paths:
- ./src
ignoreErrors:
- '#Call to static method [a-zA-Z0-9_]+\(\) on trait [a-zA-Z\\]+#'
Loading

0 comments on commit 378d70a

Please sign in to comment.