Merge pull request #1083 from yourpropertyexpert/docs/CCN2 #7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Symfony | |
# Ensure tests pass whatever is the major version of Symfony installed | |
# along with the library | |
# Guarantee to users that it can be installed and ran with no conflict | |
# in a composer project that also include Symfony dependencies | |
on: | |
push: | |
branches: [ '**' ] | |
pull_request: | |
branches: [ '**' ] | |
jobs: | |
tests: | |
runs-on: ubuntu-latest | |
timeout-minutes: 15 | |
env: | |
COMPOSER_NO_INTERACTION: 1 | |
strategy: | |
fail-fast: false | |
matrix: | |
php: [ 8.3 ] | |
symfony: [ 2, 3, 4, 5, 6, 7 ] | |
name: Symfony ${{ matrix.symfony }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php }} | |
extensions: json, imagick | |
tools: composer:v2 | |
coverage: none | |
- name: Cache library packages | |
id: composer-cache | |
uses: actions/cache@v3 | |
with: | |
path: vendor | |
key: ${{ runner.os }}-php-${{ matrix.php }}-symfony-${{ matrix.symfony }}-${{ hashFiles('composer.lock') }} | |
restore-keys: ${{ runner.os }}-php-${{ matrix.php }}-symfony-${{ matrix.symfony }}- | |
- name: Cache test packages | |
id: composer-test-cache | |
uses: actions/cache@v3 | |
with: | |
path: src/test/vendor | |
key: ${{ runner.os }}-php-${{ matrix.php }}-symfony-test-${{ matrix.symfony }}-${{ hashFiles('src/test/composer.lock') }} | |
restore-keys: ${{ runner.os }}-php-${{ matrix.php }}-symfony-test-${{ matrix.symfony }}- | |
- name: Set Symfony version | |
run: | | |
composer require --no-update --no-interaction \ | |
symfony/dependency-injection:^${{ matrix.symfony }} \ | |
symfony/filesystem:^${{ matrix.symfony }} \ | |
symfony/config:^${{ matrix.symfony }} | |
- name: Upgrade PHPUnit | |
if: matrix.php >= 7.2 | |
run: cd src/test && composer require phpunit/phpunit:^5.7.27 --no-update --no-interaction --dev | |
- name: Install dependencies | |
if: steps.composer-cache.outputs.cache-hit != 'true' | |
run: composer update --prefer-dist --no-progress --prefer-stable --ignore-platform-req=php+ | |
- name: Install test dependencies | |
if: steps.composer-test-cache.outputs.cache-hit != 'true' | |
run: cd src/test && composer update --prefer-dist --no-progress --prefer-stable --ignore-platform-req=php+ | |
- name: Fix PHP compatibility | |
if: steps.composer-test-cache.outputs.cache-hit != 'true' | |
run: php src/test/php/fix-php-compatibility.php | |
- name: Check Symfony version | |
run: php src/test/symfony-version.php | |
- name: Run test suite | |
run: src/test/vendor/bin/phpunit -v |