From a502004ed41922153c0835b3d5c2fb7451d504c7 Mon Sep 17 00:00:00 2001 From: Marijus Kilmanas Date: Tue, 28 May 2024 10:06:38 +0300 Subject: [PATCH] Actually use symfony matrix in tests (#97) * Allow matthiasnoback/symfony-dependency-injection-test v5 for full symfony7 compatibility in dev * Use symfony flex for ensuring symfony version in test matrix * Exclude Symfony7 + php8.1 combo from the matrix as it is inherently incompatible * update versions of standard github actions (checkout+cache) --- .github/workflows/static-analyse.yml | 4 ++-- .github/workflows/tests.yml | 16 +++++++++++----- composer.json | 2 +- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/.github/workflows/static-analyse.yml b/.github/workflows/static-analyse.yml index 40da87e..5fd2439 100644 --- a/.github/workflows/static-analyse.yml +++ b/.github/workflows/static-analyse.yml @@ -19,7 +19,7 @@ jobs: CODING_STANDARDS: 1 steps: - name: "Checkout" - uses: "actions/checkout@v2" + uses: "actions/checkout@v4" - name: "Setup PHP" uses: "shivammathur/setup-php@v2" @@ -34,7 +34,7 @@ jobs: echo "::set-output name=dir::$(composer config cache-files-dir)" - name: "Cache Composer dependencies" - uses: "actions/cache@v2" + uses: "actions/cache@v4" with: path: | ${{ steps.composer-cache.outputs.dir }} diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 6671dbf..af7e658 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -19,13 +19,16 @@ jobs: - "8.3" operating-system: - "ubuntu-latest" + exclude: + - symfony-version: "7.0.*" + php-version: "8.1" runs-on: ${{ matrix.operating-system }} env: COMPOSER_MEMORY_LIMIT: -1 steps: - name: "Checkout" - uses: "actions/checkout@v2" + uses: "actions/checkout@v4" - name: "Setup PHP" uses: "shivammathur/setup-php@v2" @@ -40,7 +43,7 @@ jobs: run: | echo "::set-output name=dir::$(composer config cache-files-dir)" - name: "Cache Composer dependencies" - uses: "actions/cache@v2" + uses: "actions/cache@v4" with: path: | ${{ steps.composer-cache.outputs.dir }} @@ -48,11 +51,14 @@ jobs: restore-keys: | php-${{ matrix.php-version }}-${{ matrix.dependencies }}-composer- - - name: "Require php-coveralls/php-coveralls" - run: "composer global require php-coveralls/php-coveralls" + - name: "Require php-coveralls/php-coveralls and symfony/flex" + run: "composer global require php-coveralls/php-coveralls symfony/flex --no-scripts --no-plugins" + + - name: "Enable symfony/flex plugin" + run: "composer global config --no-scripts --no-plugins allow-plugins.symfony/flex true" - name: "Install dependencies" - run: "composer update -n --prefer-dist" + run: "SYMFONY_REQUIRE='${{ matrix.symfony-version }}' composer update -n --prefer-dist" - name: "Test" run: "composer test-coverage" diff --git a/composer.json b/composer.json index 40795dd..9d27a1c 100644 --- a/composer.json +++ b/composer.json @@ -69,7 +69,7 @@ "prooph/bookdown-template": "^0.3", "friendsofphp/php-cs-fixer": "^3.5", "prooph/php-cs-fixer-config": "^0.5.0", - "matthiasnoback/symfony-dependency-injection-test": "^3.1 || ^4.1", + "matthiasnoback/symfony-dependency-injection-test": "^3.1 || ^4.1 || ^5.1", "phpstan/phpstan": "^1.5" }, "minimum-stability": "dev",