From 2e5e2942ccf8878f4b54167c40af000e3f33c175 Mon Sep 17 00:00:00 2001 From: Tomas Date: Tue, 28 Nov 2023 13:41:17 +0200 Subject: [PATCH] Allow Symfony 7 --- .github/workflows/ci.yml | 46 ++++++++++++++++++++++++---------------- .php-cs-fixer.dist.php | 2 +- composer.json | 10 ++++----- 3 files changed, 34 insertions(+), 24 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6ec9723..a97fbf1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,13 +6,20 @@ on: branches: - "master" +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +env: + fail-fast: true + jobs: phpstan: name: PHPStan runs-on: ubuntu-latest steps: - name: "Checkout" - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: "Setup PHP" uses: shivammathur/setup-php@v2 @@ -33,7 +40,7 @@ jobs: runs-on: ubuntu-latest steps: - name: "Checkout" - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: "Setup PHP" uses: shivammathur/setup-php@v2 @@ -64,31 +71,34 @@ jobs: symfony-version: 6.2.* - php-version: 8.2 symfony-version: 6.3.* + - php-version: 8.2 + symfony-version: 6.4.* + - php-version: 8.2 + symfony-version: 7.0.* + - php-version: 8.3 + symfony-version: 7.0.* steps: - name: "Checkout" - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: "Setup PHP" uses: shivammathur/setup-php@v2 with: - coverage: none php-version: ${{ matrix.php-version }} + tools: flex - - name: "Get composer cache directory" - id: composer-cache - run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT + - name: "Change stability" + if: matrix.symfony-version == '6.4.*' || matrix.symfony-version == '7.0.*' + run: | + composer config minimum-stability "dev" + composer config prefer-stable false - - name: "Cache dependencies" - uses: actions/cache@v3 + - name: "Install Dependencies with Composer" + uses: "ramsey/composer-install@v2" + env: + SYMFONY_REQUIRE: ${{ matrix.symfony-version }} with: - path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} - restore-keys: ${{ runner.os }}-composer- - - - name: "Install dependencies with composer" - run: | - composer require symfony/filesystem:${{ matrix.symfony-version }} symfony/process:${{ matrix.symfony-version }} --no-interaction --no-update - composer update --no-interaction --no-progress --no-suggest + composer-options: "--optimize-autoloader" - name: "Run tests with PHPUnit" env: @@ -100,7 +110,7 @@ jobs: runs-on: ubuntu-latest steps: - name: "Checkout" - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: "Setup PHP" uses: shivammathur/setup-php@v2 diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index 068439c..09acd6d 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -2,7 +2,6 @@ $finder = (new PhpCsFixer\Finder()) ->files() - ->name('*.php') ->in(__DIR__ . '/src'); return (new PhpCsFixer\Config()) @@ -26,5 +25,6 @@ 'static_lambda' => true, 'align_multiline_comment' => true, 'php_unit_test_case_static_method_calls' => ['call_type' => 'self'], + 'no_superfluous_phpdoc_tags' => false, ]) ->setFinder($finder); diff --git a/composer.json b/composer.json index 5b19b40..536ece0 100644 --- a/composer.json +++ b/composer.json @@ -13,15 +13,15 @@ "require": { "php": ">=7.4.0", "ext-json": "*", - "symfony/filesystem": "^4.4|^5.1|^6.0", + "symfony/filesystem": "^4.4|^5.1|^6.0|^7.0", "symfony/polyfill-php80": "^1.26", - "symfony/process": "^4.4|^5.1|^6.0" + "symfony/process": "^4.4|^5.1|^6.0|^7.0" }, "require-dev": { "mikey179/vfsstream": "^1.6.11", - "php-cs-fixer/shim": "^3.23", - "phpstan/phpstan": "^1.10.32", - "phpstan/phpstan-phpunit": "^1.3.13", + "php-cs-fixer/shim": "^3.40", + "phpstan/phpstan": "^1.10.45", + "phpstan/phpstan-phpunit": "^1.3.15", "symfony/phpunit-bridge": "^6.3.2" }, "autoload": {