diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml deleted file mode 100644 index 2ec5f64..0000000 --- a/.github/workflows/actions.yml +++ /dev/null @@ -1,63 +0,0 @@ -name: Quality -on: push -jobs: - cs-fixer: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - 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 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 - strategy: - matrix: - phpstan-level: [ 3, 5, 7, 8 ] - steps: - - uses: actions/checkout@v2 - - 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: PHPStan - uses: php-actions/phpstan@v2 - with: - path: src/ - args: --level=${{ matrix.phpstan-level }} diff --git a/.github/workflows/quality.yaml b/.github/workflows/quality.yaml new file mode 100644 index 0000000..56fde70 --- /dev/null +++ b/.github/workflows/quality.yaml @@ -0,0 +1,78 @@ +name: Quality + +on: + push: + branches: [main, master, next] + pull_request: + branches: [main, master, next] + +env: + PHP_VERSION: '8.4' + +jobs: + quality: + name: PHP-CS-Fixer, PHPStan, Rector, PHPUnit, Infection, PHPSpec + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: shivammathur/setup-php@v2 + with: + php-version: ${{ env.PHP_VERSION }} + tools: composer:v2 + coverage: pcov + + - uses: actions/cache@v4 + with: + path: vendor + key: ${{ runner.os }}-composer-${{ hashFiles('composer.lock', 'composer.json') }} + restore-keys: | + ${{ runner.os }}-composer- + + - name: Install dependencies + run: composer install --no-interaction --prefer-dist + + - name: PHP-CS-Fixer + run: | + if [ -f vendor/bin/php-cs-fixer ] && [ -d src ]; then + vendor/bin/php-cs-fixer fix src --dry-run + fi + + - name: PHPStan + run: | + if [ ! -d src ]; then exit 0; fi + if [ -f vendor/bin/phpstan ]; then + vendor/bin/phpstan analyse src --level=8 --no-progress + elif [ -f vendor/phpstan/phpstan/phpstan ]; then + php vendor/phpstan/phpstan/phpstan analyse src --level=8 --no-progress + fi + + - name: Rector + run: | + if [ -f bin/rector ]; then + bin/rector process --dry-run + elif [ -f vendor/bin/rector ]; then + vendor/bin/rector process --dry-run + fi + + - name: PHPUnit + run: | + if [ -f phpunit.xml ] || [ -f phpunit.xml.dist ]; then + if [ -f infection.json ] || [ -f infection.json.dist ]; then + vendor/bin/phpunit --coverage-html var/coverage --coverage-text + else + vendor/bin/phpunit + fi + fi + + - name: Infection + run: | + if [ -f infection.json ] || [ -f infection.json.dist ]; then + vendor/bin/infection run --no-progress --min-msi=0 --min-covered-msi=0 + fi + + - name: PHPSpec + run: | + if [ -f bin/phpspec ] && [ -d spec ]; then + bin/phpspec run spec + fi diff --git a/composer.lock b/composer.lock index 33bb335..67be76c 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "442af5c3a40be4aa1422359d53836005", + "content-hash": "509df2254f5a7ccd3b35e99929b4e96b", "packages": [ { "name": "php-etl/bucket", @@ -271,12 +271,12 @@ "packages-dev": [], "aliases": [], "minimum-stability": "dev", - "stability-flags": [], + "stability-flags": {}, "prefer-stable": true, "prefer-lowest": false, "platform": { - "php": "^8.0" + "php": "^8.4" }, - "platform-dev": [], - "plugin-api-version": "2.3.0" + "platform-dev": {}, + "plugin-api-version": "2.9.0" }