diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bcb016d21a6..2a9e828e5df 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,6 +5,11 @@ on: permissions: read-all +defaults: + run: + # Simulate an interactive terminal with color support + shell: script -q -e -c "export TERM=xterm; bash {0}" + jobs: rector: name: Rector @@ -18,12 +23,17 @@ jobs: coverage: none - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 + with: + show-progress: false - - name: Install the dependencies - run: | - composer install --no-interaction --no-progress - composer bin rector install --no-interaction --no-progress + - name: Install Contao + uses: ramsey/composer-install@v3 + + - name: Install Rector + uses: ramsey/composer-install@v3 + with: + working-directory: vendor-bin/rector - name: Run Rector run: vendor-bin/rector/vendor/bin/rector --dry-run --no-progress-bar @@ -40,12 +50,17 @@ jobs: coverage: none - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 + with: + show-progress: false - - name: Install the dependencies - run: | - composer install --no-interaction --no-progress - composer bin ecs install --no-interaction --no-progress + - name: Install Contao + uses: ramsey/composer-install@v3 + + - name: Install ECS + uses: ramsey/composer-install@v3 + with: + working-directory: vendor-bin/ecs - name: Run ECS run: vendor-bin/ecs/vendor/bin/ecs check --no-progress-bar @@ -62,12 +77,17 @@ jobs: coverage: none - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 + with: + show-progress: false - - name: Install the dependencies - run: | - composer install --no-interaction --no-progress - composer bin ecs install --no-interaction --no-progress + - name: Install Contao + uses: ramsey/composer-install@v3 + + - name: Install ECS + uses: ramsey/composer-install@v3 + with: + working-directory: vendor-bin/ecs - name: Run ECS run: | @@ -86,12 +106,17 @@ jobs: coverage: none - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 + with: + show-progress: false - - name: Install the dependencies - run: | - composer install --no-interaction --no-progress - composer bin phpstan install --no-interaction --no-progress + - name: Install Contao + uses: ramsey/composer-install@v3 + + - name: Install PHPStan + uses: ramsey/composer-install@v3 + with: + working-directory: vendor-bin/phpstan - name: Run PHPStan run: vendor-bin/phpstan/vendor/bin/phpstan analyse --no-progress @@ -101,14 +126,12 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 + with: + show-progress: false - name: Run YAMLlint - run: | - python3 -m pip install --upgrade pip - python3 -m pip install --upgrade setuptools wheel - python3 -m pip install --upgrade yamllint - /home/runner/.local/bin/yamllint . + run: yamllint --format=github . service-linter: name: Service linter @@ -122,12 +145,17 @@ jobs: coverage: none - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 + with: + show-progress: false - - name: Install the dependencies - run: | - composer install --no-interaction --no-progress - composer bin service-linter install --no-interaction --no-progress + - name: Install Contao + uses: ramsey/composer-install@v3 + + - name: Install the service linter + uses: ramsey/composer-install@v3 + with: + working-directory: vendor-bin/service-linter - name: Run the service linter run: vendor-bin/service-linter/bin/lint-service-ids @@ -144,19 +172,27 @@ jobs: coverage: none - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 + show-progress: false - - name: Install the dependencies - run: | - composer install --no-interaction --no-progress - composer -dcore-bundle install --no-interaction --no-progress - composer bin depcheck install --no-interaction --no-progress + - name: Install Contao + uses: ramsey/composer-install@v3 + + - name: Install depcheck + uses: ramsey/composer-install@v3 + with: + working-directory: vendor-bin/depcheck - name: Check for unknown symbols (contao/contao) run: vendor-bin/depcheck/vendor/bin/composer-dependency-analyser --config=depcheck.php + - name: Install the core bundle + uses: ramsey/composer-install@v3 + with: + working-directory: core-bundle + - name: Check for unknown symbols (contao/core-bundle) run: vendor-bin/depcheck/vendor/bin/composer-dependency-analyser --config=depcheck.php --composer-json=core-bundle/composer.json @@ -181,10 +217,12 @@ jobs: mysql -uroot -proot -e "CREATE database contao_test" - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 + with: + show-progress: false - - name: Install the dependencies - run: composer install --no-interaction --no-progress + - name: Install Contao + uses: ramsey/composer-install@v3 - name: Run the unit tests run: vendor/bin/phpunit @@ -211,10 +249,12 @@ jobs: coverage: none - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 + with: + show-progress: false - - name: Install the dependencies - run: composer install --no-interaction --no-progress + - name: Install Contao + uses: ramsey/composer-install@v3 - name: Run the unit tests in reverse order run: vendor/bin/phpunit --order-by=reverse --extensions Contao\\CoreBundle\\Tests\\PhpunitExtension\\GlobalStateWatcher @@ -237,10 +277,14 @@ jobs: mysql -uroot -proot -e "CREATE database contao_test" - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 + with: + show-progress: false - - name: Install the dependencies - run: composer install --ignore-platform-req=php+ --no-interaction --no-progress + - name: Install Contao + uses: ramsey/composer-install@v3 + with: + composer-options: --ignore-platform-req=php+ - name: Run the unit tests run: vendor/bin/phpunit @@ -267,10 +311,14 @@ jobs: mysql -uroot -proot -e "CREATE database contao_test" - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 + with: + show-progress: false - - name: Install the dependencies - run: composer update --prefer-lowest --prefer-stable --no-interaction --no-progress + - name: Install Contao + uses: ramsey/composer-install@v3 + with: + dependency-versions: lowest - name: Run the unit tests run: vendor/bin/phpunit @@ -297,7 +345,9 @@ jobs: coverage: none - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 + with: + show-progress: false - name: Test the single bundles run: | @@ -337,12 +387,17 @@ jobs: coverage: none - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 + with: + show-progress: false - - name: Install the dependencies - run: | - composer install --no-interaction --no-progress - composer bin monorepo-tools install --no-interaction --no-progress + - name: Install Contao + uses: ramsey/composer-install@v3 + + - name: Install the monorepo tools + uses: ramsey/composer-install@v3 + with: + working-directory: vendor-bin/monorepo-tools - name: Validate the composer.json files run: vendor-bin/monorepo-tools/vendor/bin/monorepo-tools composer-json --validate diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 82a9157764c..09efe832906 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -10,6 +10,11 @@ on: permissions: read-all +defaults: + run: + # Simulate an interactive terminal with color support + shell: script -q -e -c "export TERM=xterm; bash {0}" + jobs: coverage: name: Codecov @@ -23,16 +28,18 @@ jobs: coverage: pcov - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 + with: + show-progress: false - - name: Install the dependencies - run: composer install --no-interaction --no-progress + - name: Install Contao + uses: ramsey/composer-install@v3 - name: Generate the coverage report run: php -d pcov.enabled=1 vendor/bin/phpunit --testsuite=coverage --coverage-clover=clover.xml - name: Upload the coverage report - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@v4 with: files: ./clover.xml fail_ci_if_error: true diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 604f89cee13..3f6d8f93397 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -13,8 +13,8 @@ jobs: runs-on: ubuntu-latest continue-on-error: true steps: - - name: Assign the PR - uses: toshimaru/auto-author-assign@v1.4.0 + - name: Assign the author + uses: toshimaru/auto-author-assign@v2.1.0 - name: Assign the milestone uses: zoispag/action-assign-milestone@v1 diff --git a/.github/workflows/split.yml b/.github/workflows/split.yml index 4af23f3f984..f3b191d391a 100644 --- a/.github/workflows/split.yml +++ b/.github/workflows/split.yml @@ -9,6 +9,11 @@ on: permissions: read-all +defaults: + run: + # Simulate an interactive terminal with color support + shell: script -q -e -c "export TERM=xterm; bash {0}" + jobs: monorepo-split: name: Monorepo split @@ -22,16 +27,18 @@ jobs: coverage: none - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 + with: + show-progress: false - name: Cache the monorepo split - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: .monorepo-split-cache key: dev-${GITHUB_REF##*/} - name: Install the dependencies - run: composer global require contao/monorepo-tools:dev-main + run: composer global require contao/monorepo-tools:^0.2 - name: Split the monorepo run: $HOME/.composer/vendor/bin/monorepo-tools split ${GITHUB_REF##*/} ${{ github.event.forced && '--force-push' || '' }} diff --git a/composer.json b/composer.json index d2df07f888e..a55d94f2eb9 100644 --- a/composer.json +++ b/composer.json @@ -165,7 +165,7 @@ "toflar/psr6-symfony-http-cache-store": "^4.0", "twig/extra-bundle": "^3.0", "twig/string-extra": "^3.0", - "twig/twig": "^3.8", + "twig/twig": "^3.10.2", "ua-parser/uap-php": "^3.9", "webignition/robots-txt-file": "^3.0", "wikimedia/less.php": "^1.7" @@ -202,8 +202,6 @@ "nikic/php-parser": "4.7.0", "terminal42/contao-ce-access": "<3.0", "thecodingmachine/safe": "<1.2", - "twig/intl-extra": "3.9.0", - "twig/twig": "3.9.0", "zendframework/zend-code": "<3.3.1" }, "autoload": { diff --git a/core-bundle/composer.json b/core-bundle/composer.json index 42c2b1cba14..33e7d47dcaf 100644 --- a/core-bundle/composer.json +++ b/core-bundle/composer.json @@ -151,7 +151,7 @@ "terminal42/service-annotation-bundle": "^1.1", "toflar/cronjob-supervisor": "^2.0", "twig/string-extra": "^3.0", - "twig/twig": "^3.8", + "twig/twig": "^3.10.2", "ua-parser/uap-php": "^3.9", "webignition/robots-txt-file": "^3.0", "wikimedia/less.php": "^1.7" @@ -179,9 +179,7 @@ "contao/manager-plugin": "<2.0 || >=3.0", "doctrine/cache": "<1.10", "terminal42/contao-ce-access": "<3.0", - "thecodingmachine/safe": "<1.2", - "twig/intl-extra": "3.9.0", - "twig/twig": "3.9.0" + "thecodingmachine/safe": "<1.2" }, "autoload": { "psr-4": { diff --git a/core-bundle/contao/templates/twig/component/_picture.html.twig b/core-bundle/contao/templates/twig/component/_picture.html.twig index 940291fedd8..8adea47869f 100644 --- a/core-bundle/contao/templates/twig/component/_picture.html.twig +++ b/core-bundle/contao/templates/twig/component/_picture.html.twig @@ -27,15 +27,15 @@ {# Just an image (no sources) #} {% block image %} {% set img = figure.image.img %} - {% set defineProportions = img.width|default(false) and img.height|default(false) %} + {% set define_proportions = img.width|default(false) and img.height|default(false) %} {% set img_attributes = attrs() .set('src', img.src) .set('alt', figure.hasMetadata ? figure.metadata.alt|insert_tag : '') .setIfExists('title', figure.hasMetadata ? figure.metadata.title|insert_tag : null) .setIfExists('srcset', img.srcset is defined and img.srcset != img.src ? img.srcset : null) .setIfExists('sizes', img.sizes|default) - .setIfExists('width', defineProportions ? img.width : null) - .setIfExists('height', defineProportions ? img.height : null) + .setIfExists('width', define_proportions ? img.width : null) + .setIfExists('height', define_proportions ? img.height : null) .setIfExists('loading', img.loading|default) .addClass(img.class|default) .mergeWith(figure.options.img_attr|default) @@ -53,14 +53,14 @@ {% block sources %} {% for source in figure.image.sources %} {% block source %} - {% set defineProportions = source.width|default(false) and source.height|default(false) %} + {% set define_proportions = source.width|default(false) and source.height|default(false) %} {% set source_attributes = attrs() .set('srcset', source.srcset) .setIfExists('sizes', source.sizes|default) .setIfExists('media', source.media|default) .setIfExists('type', source.type|default) - .setIfExists('width', defineProportions ? source.width : null) - .setIfExists('height', defineProportions ? source.height : null) + .setIfExists('width', define_proportions ? source.width : null) + .setIfExists('height', define_proportions ? source.height : null) .mergeWith(figure.options.picture_attr|default) .mergeWith(source_attributes|default) %} diff --git a/core-bundle/contao/templates/twig/content_element/description_list.html.twig b/core-bundle/contao/templates/twig/content_element/description_list.html.twig index 03d63f055e6..fc4cfa1457a 100644 --- a/core-bundle/contao/templates/twig/content_element/description_list.html.twig +++ b/core-bundle/contao/templates/twig/content_element/description_list.html.twig @@ -1,14 +1,14 @@ {% extends "@Contao/content_element/_base.html.twig" %} {% block content %} -