From e67ebbaa165ce862b7f3bcecc860a0999160b58a Mon Sep 17 00:00:00 2001 From: freek Date: Tue, 8 Sep 2020 19:53:55 +0200 Subject: [PATCH] wip --- .github/workflows/php-cs-fixer.yml | 29 ++++++++++++++++++++++++++ .github/workflows/run-tests.yml | 4 +++- .scrutinizer.yml | 33 ------------------------------ .styleci.yml | 1 - composer.json | 16 +++++++++------ phpunit.xml.dist | 31 ++++++++++------------------ phpunit.xml.dist.bak | 22 ++++++++++++++++++++ 7 files changed, 75 insertions(+), 61 deletions(-) create mode 100644 .github/workflows/php-cs-fixer.yml delete mode 100644 .scrutinizer.yml delete mode 100644 .styleci.yml create mode 100644 phpunit.xml.dist.bak diff --git a/.github/workflows/php-cs-fixer.yml b/.github/workflows/php-cs-fixer.yml new file mode 100644 index 000000000..5cb3a86dc --- /dev/null +++ b/.github/workflows/php-cs-fixer.yml @@ -0,0 +1,29 @@ +name: Check & fix styling + +on: [push] + +jobs: + style: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v1 + + - name: Fix style + uses: docker://oskarstark/php-cs-fixer-ga + with: + args: --config=.php_cs --allow-risky=yes + + - name: Extract branch name + shell: bash + run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" + id: extract_branch + + - name: Commit changes + uses: stefanzweifel/git-auto-commit-action@v2.3.0 + with: + commit_message: Fix styling + branch: ${{ steps.extract_branch.outputs.branch }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 1a05721ac..0cb2b3fd3 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -13,9 +13,11 @@ jobs: fail-fast: false matrix: php: [7.4] - laravel: [7.*, 6.*] + laravel: [8.*, 7.*, 6.*] dependency-version: [prefer-lowest, prefer-stable] include: + - laravel: 8.* + testbench: 6.* - laravel: 7.* testbench: 5.* - laravel: 6.* diff --git a/.scrutinizer.yml b/.scrutinizer.yml deleted file mode 100644 index bb9766566..000000000 --- a/.scrutinizer.yml +++ /dev/null @@ -1,33 +0,0 @@ -filter: - excluded_paths: [tests/*] -checks: - php: - code_rating: true - remove_extra_empty_lines: true - remove_php_closing_tag: true - remove_trailing_whitespace: true - fix_use_statements: - remove_unused: true - preserve_multiple: false - preserve_blanklines: true - order_alphabetically: true - fix_php_opening_tag: true - fix_linefeed: true - fix_line_ending: true - fix_identation_4spaces: true - fix_doc_comments: true -tools: - external_code_coverage: false - php_analyzer: true - php_code_coverage: false - php_code_sniffer: - config: - standard: PSR2 - filter: - paths: ['src'] - php_loc: - enabled: true - excluded_dirs: [vendor, tests] - php_cpd: - enabled: true - excluded_dirs: [vendor, tests] diff --git a/.styleci.yml b/.styleci.yml deleted file mode 100644 index 0285f1790..000000000 --- a/.styleci.yml +++ /dev/null @@ -1 +0,0 @@ -preset: laravel diff --git a/composer.json b/composer.json index c2552a259..39fca2c19 100644 --- a/composer.json +++ b/composer.json @@ -25,11 +25,11 @@ "php": "^7.4", "ext-fileinfo": "*", "ext-json": "*", - "illuminate/bus": "^6.18|^7.0", - "illuminate/console": "^6.18|^7.0", - "illuminate/database": "^6.18|^7.0", - "illuminate/pipeline": "^6.18|^7.0", - "illuminate/support": "^6.18|^7.0", + "illuminate/bus": "^6.18|^7.0|^8.0", + "illuminate/console": "^6.18|^7.0|^8.0", + "illuminate/database": "^6.18|^7.0|^8.0", + "illuminate/pipeline": "^6.18|^7.0|^8.0", + "illuminate/support": "^6.18|^7.0|^8.0", "league/flysystem": "^1.0.64", "maennchen/zipstream-php": "^1.0|^2.0", "spatie/image": "^1.4.0", @@ -44,7 +44,7 @@ "guzzlehttp/guzzle": "^6.3", "league/flysystem-aws-s3-v3": "^1.0.23", "mockery/mockery": "^1.3", - "orchestra/testbench": "^4.0|^5.0", + "orchestra/testbench": "^4.0|^5.0|^6.0", "php-ffmpeg/php-ffmpeg": "^0.16.0", "phpunit/phpunit": "^9.1", "spatie/pdf-to-image": "^2.0", @@ -63,6 +63,10 @@ "Spatie\\MediaLibrary\\": "src" } }, + "scripts": { + "format": "vendor/bin/php-cs-fixer fix --allow-risky=yes", + "test": "vendor/bin/phpunit" + }, "autoload-dev": { "psr-4": { "Spatie\\MediaLibrary\\Tests\\": "tests" diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 7a65b9f44..22da30cc8 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,22 +1,13 @@ - - - - tests - - - - - src/ - - + + + + src/ + + + + + tests + + diff --git a/phpunit.xml.dist.bak b/phpunit.xml.dist.bak new file mode 100644 index 000000000..7a65b9f44 --- /dev/null +++ b/phpunit.xml.dist.bak @@ -0,0 +1,22 @@ + + + + + tests + + + + + src/ + + +