Skip to content

Commit

Permalink
Merge pull request #12 from php-etl/feature/qualityflow-improvments
Browse files Browse the repository at this point in the history
Feature/qualityflow improvments
  • Loading branch information
sebprt authored Apr 4, 2023
2 parents 2e487db + 6e5be44 commit c3e3631
Show file tree
Hide file tree
Showing 21 changed files with 2,322 additions and 737 deletions.
64 changes: 0 additions & 64 deletions .github/workflows/actions.yml

This file was deleted.

34 changes: 34 additions & 0 deletions .github/workflows/infection.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Mutations
on: push
jobs:
infection:
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: Infection
run: |
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@v3
with:
path: infection.log
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
23 changes: 23 additions & 0 deletions .github/workflows/phpstan-7.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: PHPStan level 7
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: 7
23 changes: 23 additions & 0 deletions .github/workflows/phpstan-8.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: PHPStan level 8
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: 8
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
37 changes: 37 additions & 0 deletions .github/workflows/quality.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Quality (PHPStan lvl 5)
on: push
jobs:
cs-fixer:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- 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 --dry-run --config=.php-cs-fixer.dist.php
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/
args: --level=5

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/string-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]'
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.result.cache
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
# String Expression Language
String Expression Language
===
This package extends the [ExpressionLanguage](https://symfony.com/doc/current/components/expression_language.html) component of Symfony to compile and evaluate arrays with custom functions.

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

# Installation
```
composer require php-etl/string-expression-language
Expand Down
11 changes: 7 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,14 @@
"minimum-stability": "dev",
"prefer-stable": true,
"require": {
"php": "^8.0",
"symfony/expression-language": "^5.2"
"php": "^8.2",
"symfony/expression-language": "^6.0"
},
"require-dev": {
"phpunit/phpunit": "^9.0"
"phpunit/phpunit": "^10.0",
"rector/rector": "^0.15",
"phpstan/phpstan": "^1.10",
"friendsofphp/php-cs-fixer": "^3.0"
},
"autoload": {
"psr-4": {
Expand All @@ -30,7 +33,7 @@
},
"extra": {
"branch-alias": {
"dev-main": "0.1.x-dev"
"dev-main": "0.2.x-dev"
}
},
"config": {
Expand Down
Loading

0 comments on commit c3e3631

Please sign in to comment.