From 7996e39b1c6aa5020ac761f586926246cf62a3f1 Mon Sep 17 00:00:00 2001 From: Evert Harmeling Date: Thu, 16 Nov 2023 11:43:16 +0100 Subject: [PATCH 1/4] Optimized ci workflow config --- .github/workflows/build.yaml | 93 ++++++++++++++++++++---------------- 1 file changed, 52 insertions(+), 41 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index ceeb93b..2c8f6d6 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -6,71 +6,82 @@ on: jobs: phpstan: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest name: PHPStan steps: - name: Checkout uses: actions/checkout@v3 - - name: PHPStan + - name: Run PHPStan uses: docker://oskarstark/phpstan-ga env: REQUIRE_DEV: true with: args: analyse cs-fixer: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest name: PHP-CS-Fixer steps: - name: Checkout uses: actions/checkout@v3 - - name: Fix CS + - name: Run PHP-CS-Fixer uses: docker://oskarstark/php-cs-fixer-ga tests: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest strategy: matrix: php: - - '8.0' - - '8.1' - - '8.2' + - '8.1' + - '8.2' + - '8.3' + dependency: + - '' + symfony: + - '6.3.*' + - '6.4.*' + - '7.0.*' include: - - description: 'Symfony 6.0' - php: '8.0' - composer_option: '--prefer-lowest' - - description: 'Symfony 6.1' - php: '8.1' - symfony: 6.1.* - - description: 'Symfony 6.2' - php: '8.2' - symfony: 6.2.* - - description: 'Symfony 6.3' - php: '8.2' - symfony: 6.3.* - - description: 'Symfony 6.4' - php: '8.2' - symfony: 6.4.*-dev - - description: 'Symfony 7.0' - php: '8.2' - symfony: 7.0.*-dev - name: PHP ${{ matrix.php }} tests (${{ matrix.description }}) + - php: '8.1' + symfony: '6.3.*' + dependency: 'lowest' + exclude: + - php: '8.1' + symfony: '7.0.*' + name: PHPUnit PHP ${{ matrix.php }} ${{ matrix.dependency }} (Symfony ${{ matrix.symfony }}) steps: - name: Checkout uses: actions/checkout@v3 - - name: Cache - uses: actions/cache@v3 - with: - path: ~/.composer/cache/files - key: ${{ matrix.php }}-${{ matrix.symfony }}-${{ matrix.composer_option }} + - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: ${{ matrix.php }} - - run: | - sed -ri 's/"symfony\/(.+)": "(.+)"/"symfony\/\1": "'${{ matrix.symfony }}'"/' composer.json; - if: contains(matrix.symfony, '-dev') - - run: composer config minimum-stability dev - - run: composer config prefer-stable true - if: matrix.symfony - - run: composer update --no-interaction --no-progress --ansi ${{ matrix.composer_option }} - - run: vendor/bin/phpunit + php-version: ${{ matrix.php }} + + - name: Get Composer cache directory + id: composer-cache + run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT + + - name: Cache dependencies + uses: actions/cache@v3 + with: + path: ${{ steps.composer-cache.outputs.dir }} + key: ${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }} + restore-keys: ${{ matrix.php }}-composer- + + - name: Update project dependencies + if: matrix.dependency == '' + run: composer update --no-progress --ansi --prefer-stable + env: + SYMFONY_REQUIRE: ${{ matrix.symfony }} + + - name: Update project dependencies lowest + if: matrix.dependency == 'lowest' + run: composer update --no-progress --ansi --prefer-stable --prefer-lowest + env: + SYMFONY_REQUIRE: ${{ matrix.symfony }} + + - name: Validate composer + run: composer validate --strict --no-check-lock + + - name: Run tests + run: vendor/bin/phpunit From dd5e967f4676b9750be4369a6eb13bb2b2d67bcd Mon Sep 17 00:00:00 2001 From: Evert Harmeling Date: Thu, 16 Nov 2023 11:51:16 +0100 Subject: [PATCH 2/4] Bump Symfony version to 6.3 (latest supported atm) --- composer.json | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/composer.json b/composer.json index 0ddab0b..5c6e097 100644 --- a/composer.json +++ b/composer.json @@ -16,22 +16,22 @@ } ], "require": { - "php": "^8.0", + "php": "^8.1", "knplabs/knp-components": "^4.1", - "symfony/config": "^6.0 || ^7.0", - "symfony/dependency-injection": "^6.0 || ^7.0", - "symfony/event-dispatcher": "^6.0 || ^7.0", - "symfony/http-foundation": "^6.0 || ^7.0", - "symfony/http-kernel": "^6.0 || ^7.0", - "symfony/routing": "^6.0 || ^7.0", - "symfony/translation": "^6.0 || ^7.0", + "symfony/config": "^6.3 || ^7.0", + "symfony/dependency-injection": "^6.3 || ^7.0", + "symfony/event-dispatcher": "^6.3 || ^7.0", + "symfony/http-foundation": "^6.3 || ^7.0", + "symfony/http-kernel": "^6.3 || ^7.0", + "symfony/routing": "^6.3 || ^7.0", + "symfony/translation": "^6.3 || ^7.0", "twig/twig": "^3.0" }, "require-dev": { "phpstan/phpstan": "^1.9", "phpunit/phpunit": "^9.5", - "symfony/expression-language": "^6.0 || ^7.0", - "symfony/templating": "^6.0 || ^7.0" + "symfony/expression-language": "^6.3 || ^7.0", + "symfony/templating": "^6.3 || ^7.0" }, "autoload": { "psr-4": { From ed3b1743204b2b352e577b17b3fdedfa4b795032 Mon Sep 17 00:00:00 2001 From: Evert Harmeling Date: Thu, 16 Nov 2023 19:42:59 +0100 Subject: [PATCH 3/4] Reverted ubuntu image version --- .github/workflows/build.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 2c8f6d6..314e511 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -6,7 +6,7 @@ on: jobs: phpstan: - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 name: PHPStan steps: - name: Checkout @@ -18,7 +18,7 @@ jobs: with: args: analyse cs-fixer: - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 name: PHP-CS-Fixer steps: - name: Checkout @@ -26,7 +26,7 @@ jobs: - name: Run PHP-CS-Fixer uses: docker://oskarstark/php-cs-fixer-ga tests: - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 strategy: matrix: php: From ccedac46805a3d0977c5029392b94119ab074d57 Mon Sep 17 00:00:00 2001 From: Evert Harmeling Date: Fri, 17 Nov 2023 17:05:38 +0100 Subject: [PATCH 4/4] Added PHP 8.2 / SF 7.0 with lowest deps --- .github/workflows/build.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 314e511..b670ae5 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -43,6 +43,9 @@ jobs: - php: '8.1' symfony: '6.3.*' dependency: 'lowest' + - php: '8.2' + symfony: '7.0.*' + dependency: 'lowest' exclude: - php: '8.1' symfony: '7.0.*'