Skip to content

Resolve held back dependencies #1363

Resolve held back dependencies

Resolve held back dependencies #1363

Workflow file for this run

name: CI
on:
push:
branches:
- '*'
- '!v1'
pull_request:
branches-ignore:
- v1
env:
COMPOSER_ALLOW_SUPERUSER: '1' # https://getcomposer.org/doc/03-cli.md#composer-allow-superuser
COMPOSER_INSTALLER_COMMIT: 2855762e882810a64816eded274321c56d9b274a
COVERAGE: '0'
EXT_PCOV_VERSION: '1.0.6'
INFECTION_VERSION: '0.29.14'
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
php-cs-fixer:
name: PHP-CS-Fixer (PHP ${{ matrix.php }})
runs-on: ubuntu-latest
strategy:
matrix:
php:
- '8.4'
fail-fast: false
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: intl, bcmath, curl, openssl, mbstring
ini-values: memory_limit=-1
tools: pecl, composer, php-cs-fixer
coverage: none
- name: Run PHP-CS-Fixer fix
env:
PHP_CS_FIXER_IGNORE_ENV: '1'
run: php-cs-fixer fix --dry-run --diff --ansi
phpunit:
name: PHPUnit (Symfony ${{ matrix.symfony }}) (PHP ${{ matrix.php }})
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.experimental }}
strategy:
matrix:
php:
- '8.3'
- '8.4'
symfony:
- '7.2'
experimental:
- false
include:
- php: '8.4'
symfony: '7.2'
experimental: false
coverage: true
fail-fast: false
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup PHP
uses: shivammathur/setup-php@v2
env:
GD_CONFIGURE_OPTS: --enable-gd=shared,/usr --with-external-gd --with-jpeg --with-freetype
GD_LIBS: libjpeg-dev libpng-dev
GD_PATH: ext/gd
with:
php-version: ${{ matrix.php }}
tools: pecl, composer
extensions: intl, bcmath, curl, openssl, mbstring, pdo_sqlite, gd-php/php-src@PHP-${{ matrix.php }}, exif, xsl
coverage: pcov
ini-values: memory_limit=-1
- name: Get composer cache directory
id: composercache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache dependencies
uses: actions/cache@v3
with:
path: ${{ steps.composercache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-
- name: Enable code coverage
if: matrix.coverage
run: echo "COVERAGE=1" >> $GITHUB_ENV
- name: Disable deprecations helper
if: ${{ !matrix.coverage }}
run: echo "SYMFONY_DEPRECATIONS_HELPER=disabled=1" >> $GITHUB_ENV
- name: Update project dependencies
run: |
composer config extra.symfony.require ${{ matrix.symfony }}
composer update --no-progress --ansi
- name: Install PHPUnit
run: vendor/bin/simple-phpunit --version
- name: Clear test app cache
run: tests/Functional/app/bin/console cache:clear --ansi
- name: Run PHPUnit tests
run: |
mkdir -p build/logs/phpunit
if [ "$COVERAGE" = '1' ]; then
vendor/bin/simple-phpunit --configuration=phpunit.coverage.xml.dist --coverage-xml=build/logs/phpunit/coverage-xml --coverage-clover=build/logs/phpunit/clover.xml --log-junit=build/logs/phpunit/junit.xml
else
vendor/bin/simple-phpunit --log-junit build/logs/phpunit/junit.xml
fi
- name: Upload test artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: phpunit-logs-php${{ matrix.php }}
path: build/logs/phpunit
continue-on-error: true
- name: Upload coverage results to Codecov
if: matrix.coverage
uses: codecov/codecov-action@v3
with:
name: phpunit-php${{ matrix.php }}
flags: phpunit
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}
- name: Run Infection Mutation Tests
if: matrix.coverage
env: # Or as an environment variable
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}
run: |
wget https://github.com/infection/infection/releases/download/$INFECTION_VERSION/infection.phar
wget https://github.com/infection/infection/releases/download/$INFECTION_VERSION/infection.phar.asc
gpg --keyserver keyserver.ubuntu.com --recv-keys C6D76C329EBADE2FB9C458CFC5095986493B4AA0
gpg --with-fingerprint --verify infection.phar.asc infection.phar
chmod +x infection.phar
./infection.phar --only-covered --coverage=build/logs/phpunit --min-covered-msi=85 --threads=30
- name: Upload Infection Mutation Logs
if: matrix.coverage
uses: actions/upload-artifact@v4
with:
name: infection-logs-php${{ matrix.php }}
path: infection.log
behat:
name: Behat (Symfony ${{ matrix.symfony }}) (PHP ${{ matrix.php }})
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.experimental }}
strategy:
matrix:
php:
- '8.3'
- '8.4'
symfony:
- '7.2'
experimental:
- false
include:
- php: '8.4'
symfony: '7.2'
experimental: false
coverage: true
fail-fast: false
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup PHP
uses: shivammathur/setup-php@v2
env:
GD_CONFIGURE_OPTS: --enable-gd=shared,/usr --with-external-gd --with-jpeg --with-freetype
GD_LIBS: libjpeg-dev libpng-dev
GD_PATH: ext/gd
with:
php-version: ${{ matrix.php }}
tools: pecl, composer
extensions: intl, bcmath, curl, openssl, mbstring, pdo_sqlite, gd-php/php-src@PHP-${{ matrix.php }}, exif, xsl
coverage: pcov
ini-values: memory_limit=-1
- name: Get Composer Cache Directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Restore composer cache
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: composer-php${{ matrix.php }}-${{ hashFiles('**/composer.json') }}
restore-keys: |
composer-php${{ matrix.php }}-
continue-on-error: true
- name: Update project dependencies
run: |
composer config extra.symfony.require ${{ matrix.symfony }}
composer update --no-progress --ansi
- name: Clear test app cache
run: tests/Functional/app/bin/console cache:clear --ansi
- name: Enable code coverage
if: matrix.coverage
run: echo "COVERAGE=1" >> $GITHUB_ENV
- name: Run Behat tests
run: |
mkdir -p build/logs/behat
if [ "$COVERAGE" = '1' ]; then
php -d memory_limit=-1 -d error_reporting="E_ALL & ~E_NOTICE & ~E_DEPRECATED" vendor/bin/behat --format=progress --out=std --format=junit --out=build/logs/behat/junit --profile=default-coverage --no-interaction --colors --tags='~@wip'
else
php -d memory_limit=-1 -d error_reporting="E_ALL & ~E_NOTICE & ~E_DEPRECATED" vendor/bin/behat --format=progress --out=std --format=junit --out=build/logs/behat/junit --profile=default --no-interaction --colors --tags='~@wip'
fi
- name: Merge code coverage reports
if: matrix.coverage
run: |
wget -qO /usr/local/bin/phpcov https://phar.phpunit.de/phpcov.phar
chmod +x /usr/local/bin/phpcov
phpcov merge --clover build/logs/behat/clover.xml build/coverage
continue-on-error: true
- name: Upload test artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: behat-logs-php${{ matrix.php }}
path: build/logs/behat
continue-on-error: true
- name: Upload coverage results to Codecov
if: matrix.coverage
uses: codecov/codecov-action@v3
with:
name: behat-php${{ matrix.php }}
flags: behat
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}
phpunit-lowest-deps:
name: PHPUnit (Symfony ${{ matrix.symfony }}) (PHP ${{ matrix.php }}) (lowest dependencies)
runs-on: ubuntu-latest
strategy:
matrix:
php:
- '8.4'
symfony:
- '^7.2'
fail-fast: false
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup PHP
uses: shivammathur/setup-php@v2
env:
GD_CONFIGURE_OPTS: --enable-gd=shared,/usr --with-external-gd --with-jpeg --with-freetype
GD_LIBS: libjpeg-dev libpng-dev
GD_PATH: ext/gd
with:
php-version: ${{ matrix.php }}
tools: pecl, composer
extensions: intl, bcmath, curl, openssl, mbstring, pdo_sqlite, gd-php/php-src@PHP-${{ matrix.php }}, exif, xsl
coverage: none
ini-values: memory_limit=-1
- name: Get Composer Cache Directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Restore composer cache
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: composer-lowest-deps-php${{ matrix.php }}-${{ hashFiles('**/composer.json') }}
restore-keys: |
composer-lowest-deps-php${{ matrix.php }}-
continue-on-error: true
- name: Update project dependencies
run: composer update --no-progress --ansi --prefer-stable --prefer-lowest
- name: Clear test app cache
run: tests/Functional/app/bin/console cache:clear --ansi
- name: Disable deprecations helper
run: echo "SYMFONY_DEPRECATIONS_HELPER=disabled=1" >> $GITHUB_ENV
- name: Run PHPUnit tests
run: |
mkdir -p build/logs/phpunit
vendor/bin/simple-phpunit --log-junit build/logs/phpunit/junit.xml
- name: Upload test artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: phpunit-logs-php${{ matrix.php }}-lowest-deps
path: build/logs/phpunit
continue-on-error: true
behat-lowest-deps:
name: Behat (Symfony ${{ matrix.symfony }}) (PHP ${{ matrix.php }}) (lowest dependencies)
runs-on: ubuntu-latest
strategy:
matrix:
php:
- '8.4'
symfony:
- '^7.2'
fail-fast: false
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup PHP
uses: shivammathur/setup-php@v2
env:
GD_CONFIGURE_OPTS: --enable-gd=shared,/usr --with-external-gd --with-jpeg --with-freetype
GD_LIBS: libjpeg-dev libpng-dev
GD_PATH: ext/gd
with:
php-version: ${{ matrix.php }}
tools: pecl, composer
extensions: intl, bcmath, curl, openssl, mbstring, pdo_sqlite, gd-php/php-src@PHP-${{ matrix.php }}, exif, xsl
coverage: none
ini-values: memory_limit=-1
- name: Get Composer Cache Directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Restore composer cache
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: composer-lowest-deps-php${{ matrix.php }}-${{ hashFiles('**/composer.json') }}
restore-keys: |
composer-lowest-deps-php${{ matrix.php }}-
continue-on-error: true
- name: Update project dependencies
run: composer update --no-progress --ansi --prefer-stable --prefer-lowest
- name: Clear test app cache
run: tests/Functional/app/bin/console cache:clear --ansi
- name: Run Behat tests
run: |
mkdir -p build/logs/behat
php -d memory_limit=-1 -d error_reporting="E_ALL & ~E_NOTICE & ~E_DEPRECATED" vendor/bin/behat --format=progress --out=std --format=junit --out=build/logs/behat/junit --profile=default --no-interaction --colors --tags='~@wip'
- name: Upload test artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: behat-logs-php${{ matrix.php }}-lowest-deps
path: build/logs/behat
continue-on-error: true
phpunit-symfony-next:
name: PHPUnit (Symfony NEXT ${{ matrix.symfony }}) (PHP ${{ matrix.php }})
runs-on: ubuntu-latest
strategy:
matrix:
php:
- '8.4'
symfony:
- '7.3'
fail-fast: false
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup PHP
uses: shivammathur/setup-php@v2
env:
GD_CONFIGURE_OPTS: --enable-gd=shared,/usr --with-external-gd --with-jpeg --with-freetype
GD_LIBS: libjpeg-dev libpng-dev
GD_PATH: ext/gd
with:
php-version: ${{ matrix.php }}
tools: pecl, composer
extensions: intl, bcmath, curl, openssl, mbstring, pdo_sqlite, gd-php/php-src@PHP-${{ matrix.php }}, exif, xsl
coverage: none
ini-values: memory_limit=-1
- name: Get Composer Cache Directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Restore composer cache
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: composer-php${{ matrix.php }}-${{ hashFiles('**/composer.json') }}
restore-keys: |
composer-php${{ matrix.php }}-symfony${{ matrix.symfony }}-
composer-php${{ matrix.php }}-
composer-
continue-on-error: true
- name: Update project dependencies
run: |
composer config minimum-stability dev
composer config prefer-stable false
composer update --no-progress --ansi
- name: Flag held back Symfony packages
env:
symfony_version: ${{ matrix.symfony }}
run: |
version_pattern=$symfony_version.x-dev
if [ "${symfony_version%.4}" != "$symfony_version" ]; then
current_major=${symfony_version%.4}
next_major=$((current_major + 1))
version_pattern=$version_pattern'|'$next_major.0.x-dev'|'dev-main
fi
version_pattern=$(echo "$version_pattern" | sed -r 's/\./\\./g')
symfony_packages=$(composer show symfony/* | tr -s ' ' '\t' | cut -f1-2 | grep -vE 'polyfill|contracts|mercure|debug|maker-bundle|monolog-bundle')
! echo "$symfony_packages" | grep -vE "$version_pattern"
continue-on-error: true
- name: Clear test app cache
run: tests/Functional/app/bin/console cache:clear --ansi
- name: Run PHPUnit tests
run: |
mkdir -p build/logs/phpunit
vendor/bin/simple-phpunit --log-junit build/logs/phpunit/junit.xml
- name: Upload test artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: phpunit-logs-php${{ matrix.php }}-symfony${{ matrix.symfony }}
path: build/logs/phpunit
continue-on-error: true
behat-symfony-next:
name: Behat (Symfony NEXT ${{ matrix.symfony }}) (PHP ${{ matrix.php }})
runs-on: ubuntu-latest
strategy:
matrix:
php:
- '8.4'
symfony:
- '7.3'
fail-fast: false
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup PHP
uses: shivammathur/setup-php@v2
env:
GD_CONFIGURE_OPTS: --enable-gd=shared,/usr --with-external-gd --with-jpeg --with-freetype
GD_LIBS: libjpeg-dev libpng-dev
GD_PATH: ext/gd
with:
php-version: ${{ matrix.php }}
tools: pecl, composer
extensions: intl, bcmath, curl, openssl, mbstring, pdo_sqlite, gd-php/php-src@PHP-${{ matrix.php }}, exif, xsl
coverage: none
ini-values: memory_limit=-1
- name: Get Composer Cache Directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Restore composer cache
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: composer-php${{ matrix.php }}-symfony${{ matrix.symfony }}-${{ github.sha }}
restore-keys: |
composer-php${{ matrix.php }}-symfony${{ matrix.symfony }}-
composer-php${{ matrix.php }}-
composer-
continue-on-error: true
- name: Update project dependencies
run: |
composer config minimum-stability dev
composer config prefer-stable false
composer update --no-progress --ansi
- name: Clear test app cache
run: tests/Functional/app/bin/console cache:clear --ansi
- name: Run Behat tests
run: |
mkdir -p build/logs/behat
php -d memory_limit=-1 -d error_reporting="E_ALL & ~E_NOTICE & ~E_DEPRECATED" vendor/bin/behat --format=progress --out=std --format=junit --out=build/logs/behat/junit --profile=default --no-interaction --colors --tags='~@wip'
- name: Upload test artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: behat-logs-php${{ matrix.php }}-symfony${{ matrix.symfony }}
path: build/logs/behat
continue-on-error: true