Skip to content

Commit

Permalink
Merge pull request #11 from php-etl/feature/qualityflow-improvments
Browse files Browse the repository at this point in the history
update composer to php 8.2, update github actions, update phpunit et …
  • Loading branch information
clemzarch authored Apr 4, 2023
2 parents b999d5a + fde2a58 commit e0a72c3
Show file tree
Hide file tree
Showing 40 changed files with 3,518 additions and 1,388 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/infection.yaml
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
name: Mutations
name: Infection
on: push
jobs:
infection:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: shivammathur/setup-php@v2
with:
php-version: '8.0'
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.0
args: --prefer-dist --ignore-platform-reqs
php_version: '8.2'

- name: Infection
run: |
wget -q https://github.com/infection/infection/releases/download/0.20.0/infection.phar
wget -q https://github.com/infection/infection/releases/download/0.20.0/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
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/phpstan-5.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@ jobs:
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.0

php_version: '8.2'
- name: PHPStan
uses: php-actions/phpstan@v2
uses: php-actions/phpstan@v3
with:
path: src/
args: --level=5
level: 5
php_version: '8.2'
23 changes: 23 additions & 0 deletions .github/workflows/phpstan-6.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: PHPStan level 6
on: push
jobs:
phpstan:
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@v3
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,20 +4,20 @@ jobs:
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.0

php_version: '8.2'
- name: PHPStan
uses: php-actions/phpstan@v2
uses: php-actions/phpstan@v3
with:
path: src/
args: --level=7
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,20 +4,20 @@ jobs:
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.0

php_version: '8.2'
- name: PHPStan
uses: php-actions/phpstan@v2
uses: php-actions/phpstan@v3
with:
path: src/
args: --level=8
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
50 changes: 13 additions & 37 deletions .github/workflows/quality.yaml
Original file line number Diff line number Diff line change
@@ -1,61 +1,37 @@
name: Quality
name: Quality (PHPStan lvl 4)
on: push
jobs:
cs-fixer:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
coverage: none
- 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.0'
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.0

- 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.0

php_version: '8.2'
- name: PHPStan
uses: php-actions/phpstan@v2
uses: php-actions/phpstan@v3
with:
path: src/
args: --level=4
level: 4
php_version: '8.2'
32 changes: 32 additions & 0 deletions .github/workflows/rector.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# 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/akeneo-expression-language'
steps:
-
if: github.event.pull_request.head.repo.full_name == github.repository
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]'
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
.env
.idea/
vendor/
!.idea/runConfigurations
!.idea/runConfigurations
/.php-cs-fixer.cache
/bin/
1 change: 1 addition & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
return (new PhpCsFixer\Config())
->setRiskyAllowed(true)
->setRules([
'@PHP82Migration' => true,
'@PHP81Migration' => true,
'@PHP80Migration:risky' => true,
'@PHPUnit84Migration:risky' => true,
Expand Down
52 changes: 0 additions & 52 deletions .phpunit.xml

This file was deleted.

5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@ Akeneo Expression Language

This package extends the [ExpressionLanguage](https://symfony.com/doc/current/components/expression_language.html) Symfony component add filtering functions to Akeneo attributes data.

[![Quality](https://github.com/php-etl/akeneo-expression-language/actions/workflows/quality.yaml/badge.svg)](https://github.com/php-etl/akeneo-expression-language/actions/workflows/quality.yaml)
[![Quality (PHPStan lvl 4)](https://github.com/php-etl/akeneo-expression-language/actions/workflows/quality.yaml/badge.svg)](https://github.com/php-etl/akeneo-expression-language/actions/workflows/quality.yaml)
[![PHPUnit](https://github.com/php-etl/akeneo-expression-language/actions/workflows/phpunit.yaml/badge.svg)](https://github.com/php-etl/akeneo-expression-language/actions/workflows/phpunit.yaml)
[![Infection](https://github.com/php-etl/akeneo-expression-language/actions/workflows/infection.yaml/badge.svg)](https://github.com/php-etl/akeneo-expression-language/actions/workflows/infection.yaml)
[![PHPStan level 5](https://github.com/php-etl/akeneo-expression-language/actions/workflows/phpstan-5.yaml/badge.svg)](https://github.com/php-etl/akeneo-expression-language/actions/workflows/phpstan-5.yaml)
[![PHPStan level 6](https://github.com/php-etl/akeneo-expression-language/actions/workflows/phpstan-6.yaml/badge.svg)](https://github.com/php-etl/akeneo-expression-language/actions/workflows/phpstan-6.yaml)
[![PHPStan level 7](https://github.com/php-etl/akeneo-expression-language/actions/workflows/phpstan-7.yaml/badge.svg)](https://github.com/php-etl/akeneo-expression-language/actions/workflows/phpstan-7.yaml)
[![PHPStan level 8](https://github.com/php-etl/akeneo-expression-language/actions/workflows/phpstan-8.yaml/badge.svg)](https://github.com/php-etl/akeneo-expression-language/actions/workflows/phpstan-8.yaml)
![PHP](https://img.shields.io/packagist/php-v/php-etl/akeneo-expression-language)
Expand Down
Loading

0 comments on commit e0a72c3

Please sign in to comment.