Skip to content

Commit

Permalink
Merge pull request #10 from php-etl/feature/qualityflow-improvments
Browse files Browse the repository at this point in the history
Split github actions, Add a phpstan lvl 6, validate cs-fixer, validat…
  • Loading branch information
clemzarch authored Apr 5, 2023
2 parents 344128b + 5c71024 commit 5e28f7d
Show file tree
Hide file tree
Showing 69 changed files with 2,298 additions and 2,407 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/infection.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,31 @@ jobs:
infection:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
php-version: '8.2'
tools: composer:v2
coverage: pcov
- uses: actions/cache@v2
- uses: actions/cache@v3
with:
path: '**/vendor'
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- uses: php-actions/composer@v5
- uses: php-actions/composer@v6
with:
args: --prefer-dist
php_version: 8.1
php_version: '8.2'

- name: Infection
run: |
wget -q https://github.com/infection/infection/releases/download/0.26.10/infection.phar
wget -q https://github.com/infection/infection/releases/download/0.26.10/infection.phar.asc
wget -q https://github.com/infection/infection/releases/download/0.26.18/infection.phar
wget -q https://github.com/infection/infection/releases/download/0.26.18/infection.phar.asc
chmod +x infection.phar
./infection.phar
- name: Store infection log
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
path: infection.log
12 changes: 6 additions & 6 deletions .github/workflows/phpstan-5.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@ jobs:
phpstan-5:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: '**/vendor'
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- uses: php-actions/composer@v5
- uses: php-actions/composer@v6
with:
args: --prefer-dist
php_version: 8.1
php_version: '8.2'

- name: PHPStan
uses: php-actions/phpstan@v2
with:
path: src/
args: --level=5
php_version: 8.1
level: 5
php_version: '8.2'
24 changes: 24 additions & 0 deletions .github/workflows/phpstan-6.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: PHPStan level 6
on: push
jobs:
phpstan-5:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: '**/vendor'
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- uses: php-actions/composer@v6
with:
args: --prefer-dist
php_version: '8.2'

- name: PHPStan
uses: php-actions/phpstan@v2
with:
path: src/
level: 6
php_version: '8.2'
14 changes: 7 additions & 7 deletions .github/workflows/phpstan-7.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@ jobs:
phpstan-7:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: '**/vendor'
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- uses: php-actions/composer@v5
- uses: php-actions/composer@v6
with:
args: --prefer-dist
php_version: 8.1
php_version: '8.2'

- name: PHPStan
uses: php-actions/phpstan@v2
uses: php-actions/phpstan@v3
with:
path: src/
args: --level=7
php_version: 8.1
level: 7
php_version: '8.2'
14 changes: 7 additions & 7 deletions .github/workflows/phpstan-8.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@ jobs:
phpstan-8:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: '**/vendor'
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- uses: php-actions/composer@v5
- uses: php-actions/composer@v6
with:
args: --prefer-dist
php_version: 8.1
php_version: '8.2'

- name: PHPStan
uses: php-actions/phpstan@v2
uses: php-actions/phpstan@v3
with:
path: src/
args: --level=8
php_version: 8.1
level: 8
php_version: '8.2'
30 changes: 30 additions & 0 deletions .github/workflows/phpunit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: PHPUnit
on: push
jobs:
phpunit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
tools: composer:v2
coverage: pcov
- uses: actions/cache@v3
with:
path: '**/vendor'
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- uses: php-actions/composer@v6
with:
args: --prefer-dist
php_version: '8.2'

- name: Run tests & generate Coverage
run: bin/phpunit --coverage-html var/coverage

- name: Store coverage files
uses: actions/upload-artifact@v3
with:
path: var/coverage
45 changes: 10 additions & 35 deletions .github/workflows/quality.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,58 +5,33 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
- name: Cs-Fixer
run: |
wget -q https://cs.symfony.com/download/php-cs-fixer-v3.phar -O php-cs-fixer
chmod a+x php-cs-fixer
PHP_CS_FIXER_IGNORE_ENV=true ./php-cs-fixer fix src --dry-run
phpunit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
tools: composer:v2
coverage: pcov
- uses: actions/cache@v2
with:
path: '**/vendor'
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- uses: php-actions/composer@v5
with:
args: --prefer-dist
php_version: 8.1

- name: Run tests & generate Coverage
run: bin/phpunit --configuration=phpunit.xml tests --coverage-html var/coverage --whitelist=src

- name: Store coverage files
uses: actions/upload-artifact@v2
with:
path: var/coverage

phpstan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: '**/vendor'
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- uses: php-actions/composer@v5
- uses: php-actions/composer@v6
with:
args: --prefer-dist
php_version: 8.1
php_version: '8.2'

- name: PHPStan
uses: php-actions/phpstan@v2
uses: php-actions/phpstan@v3
with:
path: src/
args: --level=4
php_version: 8.1
level: 4
php_version: '8.2'
30 changes: 30 additions & 0 deletions .github/workflows/rector.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# github action that checks code with Rector
name: Rector

on:
pull_request: null

jobs:
rector:
runs-on: ubuntu-latest
if: github.event.pull_request.head.repo.full_name == 'php-etl/sylius-plugin'
steps:
- uses: actions/checkout@v3

-
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
coverage: none

- uses: "ramsey/composer-install@v2"

- run: bin/rector --ansi

-
# commit only to core contributors who have repository access
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: '[rector] Rector fixes'
commit_author: 'GitHub Action <[email protected]>'
commit_user_email: '[email protected]'
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
/vendor/
bin/
.php-cs-fixer.cache
.phpunit.cache/
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
Sylius Data Flows
===

[![Mutations](https://github.com/php-etl/sylius-plugin/actions/workflows/infection.yaml/badge.svg)](https://github.com/php-etl/sylius-plugin/actions/workflows/infection.yaml)
[![PHPUnit](https://github.com/php-etl/sylius-plugin/actions/workflows/phpunit.yaml/badge.svg)](https://github.com/php-etl/sylius-plugin/actions/workflows/phpunit.yaml)
[![Quality](https://github.com/php-etl/sylius-plugin/actions/workflows/quality.yaml/badge.svg)](https://github.com/php-etl/sylius-plugin/actions/workflows/quality.yaml)
[![PHPStan level 5](https://github.com/php-etl/sylius-plugin/actions/workflows/phpstan-5.yaml/badge.svg)](https://github.com/php-etl/sylius-plugin/actions/workflows/phpstan-5.yaml)
[![PHPStan level 6](https://github.com/php-etl/sylius-plugin/actions/workflows/phpstan-6.yaml/badge.svg)](https://github.com/php-etl/sylius-plugin/actions/workflows/phpstan-6.yaml)
[![PHPStan level 7](https://github.com/php-etl/sylius-plugin/actions/workflows/phpstan-7.yaml/badge.svg)](https://github.com/php-etl/sylius-plugin/actions/workflows/phpstan-7.yaml)
[![PHPStan level 8](https://github.com/php-etl/sylius-plugin/actions/workflows/phpstan-8.yaml/badge.svg)](https://github.com/php-etl/sylius-plugin/actions/workflows/phpstan-8.yaml)
![PHP](https://img.shields.io/packagist/php-v/php-etl/sylius-plugin)
Goal
---

Expand Down
35 changes: 18 additions & 17 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,29 @@
"minimum-stability": "dev",
"prefer-stable": true,
"require": {
"php": "^8.1",
"php": "^8.2",
"ext-json": "*",
"nikic/php-parser": "^4.10",
"symfony/config": "^5.2",
"php-etl/configurator-contracts": "^0.5.0",
"php-etl/packaging-contracts": "^0.1.0",
"php-etl/fast-map-plugin": "^0.7.0",
"php-etl/satellite-toolbox": "^0.3.0"
"symfony/config": "^6.0",
"php-etl/configurator-contracts": "^0.7.0",
"php-etl/packaging-contracts": "^0.3.0",
"php-etl/fast-map-plugin": "^0.8.0",
"php-etl/satellite-toolbox": "^0.5.0"
},
"require-dev": {
"php-http/mock-client": "^1.4@dev",
"symfony/yaml": "^5.2",
"php-etl/bucket-contracts": "^0.1.0",
"phpunit/phpunit": "^9.0",
"symfony/yaml": "^6.0",
"php-etl/bucket-contracts": "^0.2.0",
"phpunit/phpunit": "^10.0",
"laminas/laminas-diactoros": "^2.6",
"johnkary/phpunit-speedtrap": "*",
"mybuilder/phpunit-accelerator": "*",
"phpunit/php-invoker": "*",
"php-etl/sylius-api-php-client": "^2.0",
"php-etl/sylius-api-php-client": "^2.1@dev",
"friendsofphp/php-cs-fixer": "^3.0",
"infection/infection": "^0.26.10",
"php-etl/phpunit-extension": "0.4.x-dev",
"php-etl/bucket": "^0.2.0"
"infection/infection": "^0.26.18",
"rector/rector": "^0.15",
"php-etl/phpunit-extension": "^0.5.0",
"php-etl/bucket": "^0.3.0",
"symfony/http-client": "^6.2"
},
"autoload": {
"psr-4": {
Expand All @@ -48,7 +48,7 @@
},
"extra": {
"branch-alias": {
"dev-main": "0.6.x-dev"
"dev-main": "0.7.x-dev"
},
"gyroscops": {
"plugins": ["Kiboko\\Plugin\\Sylius\\Service"]
Expand All @@ -57,7 +57,8 @@
"config": {
"bin-dir": "bin",
"allow-plugins": {
"infection/extension-installer": true
"infection/extension-installer": true,
"php-http/discovery": true
}
}
}
Loading

0 comments on commit 5e28f7d

Please sign in to comment.