mirror of
https://github.com/twigphp/Twig.git
synced 2026-08-31 12:37:15 +00:00
134 lines
4.0 KiB
YAML
134 lines
4.0 KiB
YAML
name: "CI"
|
|
|
|
on:
|
|
pull_request:
|
|
push:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
tests:
|
|
name: "PHP ${{ matrix.php-version }}"
|
|
|
|
runs-on: 'ubuntu-latest'
|
|
|
|
strategy:
|
|
matrix:
|
|
php-version:
|
|
- '8.2'
|
|
- '8.3'
|
|
- '8.4'
|
|
- '8.5'
|
|
|
|
steps:
|
|
- name: "Checkout code"
|
|
uses: actions/checkout@v7
|
|
|
|
- name: "Install PHP with extensions"
|
|
uses: shivammathur/setup-php@v2
|
|
with:
|
|
coverage: "none"
|
|
php-version: ${{ matrix.php-version }}
|
|
ini-values: memory_limit=-1
|
|
|
|
- name: "Add PHPUnit matcher"
|
|
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
|
|
|
|
- run: composer install
|
|
|
|
- name: "Run tests"
|
|
run: vendor/bin/phpunit
|
|
|
|
extension-tests:
|
|
needs:
|
|
- 'tests'
|
|
|
|
name: "${{ matrix.extension }} PHP ${{ matrix.php-version }}"
|
|
|
|
runs-on: 'ubuntu-latest'
|
|
|
|
continue-on-error: true
|
|
|
|
strategy:
|
|
matrix:
|
|
php-version:
|
|
- '8.2'
|
|
- '8.3'
|
|
- '8.4'
|
|
- '8.5'
|
|
extension:
|
|
- 'cache-extra'
|
|
- 'cssinliner-extra'
|
|
- 'html-extra'
|
|
- 'inky-extra'
|
|
- 'intl-extra'
|
|
- 'markdown-extra'
|
|
- 'string-extra'
|
|
- 'twig-extra-bundle'
|
|
|
|
steps:
|
|
- name: "Checkout code"
|
|
uses: actions/checkout@v7
|
|
|
|
- name: "Install PHP with extensions"
|
|
uses: shivammathur/setup-php@v2
|
|
with:
|
|
coverage: "none"
|
|
php-version: ${{ matrix.php-version }}
|
|
ini-values: memory_limit=-1
|
|
tools: phpunit:11.3
|
|
|
|
- name: "Add PHPUnit matcher"
|
|
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
|
|
|
|
- name: "Prevent installing symfony/translation-contracts 3.0"
|
|
if: "matrix.extension == 'twig-extra-bundle'"
|
|
working-directory: extra/${{ matrix.extension }}
|
|
run: "composer require --no-update 'symfony/translation-contracts:^1.1|^2.0'"
|
|
|
|
- name: "Prevent installing tempest/markdown, which requires PHP 8.5"
|
|
if: "matrix.extension == 'markdown-extra' && matrix.php-version != '8.5'"
|
|
working-directory: extra/${{ matrix.extension }}
|
|
run: composer remove --dev --no-update tempest/markdown
|
|
|
|
- name: "Composer install ${{ matrix.extension }}"
|
|
working-directory: extra/${{ matrix.extension }}
|
|
run: composer install
|
|
|
|
- name: "Run tests for ${{ matrix.extension }}"
|
|
working-directory: extra/${{ matrix.extension }}
|
|
env:
|
|
# intl-extra's integration tests expect en_US-formatted ICU output. The Ubuntu
|
|
# runner default (C.UTF-8) makes ICU fall back to the "C" locale, producing e.g.
|
|
# "€ 1000000.00" instead of "€1,000,000.00". phpunit.xml.dist's <env> entry is
|
|
# too late because ICU caches the default locale at the first call.
|
|
LANG: 'en_US.UTF-8'
|
|
run: phpunit
|
|
|
|
phpstan:
|
|
name: "PHPStan"
|
|
|
|
runs-on: 'ubuntu-latest'
|
|
|
|
strategy:
|
|
matrix:
|
|
php-version:
|
|
- '8.5'
|
|
|
|
steps:
|
|
- name: "Checkout code"
|
|
uses: actions/checkout@v7
|
|
|
|
- name: "Install PHP with extensions"
|
|
uses: shivammathur/setup-php@v2
|
|
with:
|
|
coverage: "none"
|
|
php-version: ${{ matrix.php-version }}
|
|
ini-values: memory_limit=-1
|
|
|
|
- run: composer install
|
|
|
|
- name: "Run tests"
|
|
run: vendor/bin/phpstan
|