|
| 1 | +name: CI |
| 2 | + |
| 3 | +env: |
| 4 | + SYMFONY_PHPUNIT_DIR: "$HOME/symfony-bridge/.phpunit" |
| 5 | + |
| 6 | +on: |
| 7 | + push: |
| 8 | + branches: |
| 9 | + - master |
| 10 | + pull_request: |
| 11 | + |
| 12 | +jobs: |
| 13 | + build: |
| 14 | + runs-on: ubuntu-latest |
| 15 | + strategy: |
| 16 | + matrix: |
| 17 | + include: |
| 18 | + # Test the latest stable release |
| 19 | + - php-version: '7.2' |
| 20 | + - php-version: '7.3' |
| 21 | + - php-version: '7.4' |
| 22 | + # Test Symfony LTS versions. Read more at https://github.com/symfony/lts |
| 23 | + - php-version: '7.4' |
| 24 | + dependencies: 'symfony/lts:^3' |
| 25 | + - php-version: '7.4' |
| 26 | + symfony-version: '^4' |
| 27 | + - php-version: '7.4' |
| 28 | + symfony-version: '^5' |
| 29 | + # Minimum supported dependencies with the oldest PHP version |
| 30 | + - php-version: '7.2' |
| 31 | + composer-flag: '--prefer-stable --prefer-lowest' |
| 32 | + # Test latest unreleased versions |
| 33 | + - php-version: '7.4' |
| 34 | + symfony-version: '^5' |
| 35 | + stability: 'dev' |
| 36 | + name: PHP ${{ matrix.php-version }} Test on Symfony ${{ matrix.symfony-version }} ${{ matrix.dependencies}} ${{ matrix.stability }} ${{ matrix.composer-flag }} |
| 37 | + steps: |
| 38 | + - name: Pull the code |
| 39 | + uses: actions/checkout@v2 |
| 40 | + - name: Install PHP and Composer |
| 41 | + uses: shivammathur/setup-php@v2 |
| 42 | + with: |
| 43 | + php-version: ${{ matrix.php-version }} |
| 44 | + tools: composer:v2 |
| 45 | + - name: Check PHP Version |
| 46 | + run: php -v |
| 47 | + - name: Stability |
| 48 | + run: composer config minimum-stability ${{ matrix.stability }} |
| 49 | + if: ${{ matrix.stability }} |
| 50 | + - name: Additional require |
| 51 | + run: composer require --no-update ${{ matrix.dependencies }} |
| 52 | + if: ${{ matrix.dependencies }} |
| 53 | + - name: Symfony version |
| 54 | + run: composer require --no-update symfony/flex && composer config extra.symfony.require ${{ matrix.symfony-version}} |
| 55 | + if: ${{ matrix.symfony-version }} |
| 56 | + - name: Composer update |
| 57 | + run: composer update ${{ matrix.composer-flag }} --prefer-dist --no-interaction |
| 58 | + - name: Composer validate |
| 59 | + run: composer validate --strict --no-check-lock |
| 60 | + - name: Run tests |
| 61 | + run: php vendor/bin/simple-phpunit -v |
| 62 | + |
0 commit comments