|
| 1 | +name: Test application |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + push: |
| 6 | + branches: |
| 7 | + - 'master' |
| 8 | + - '[0-9]+.x' |
| 9 | + - '[0-9]+.[0-9]+' |
| 10 | + - '[0-9]+.[0-9]+.x' |
| 11 | + |
| 12 | +jobs: |
| 13 | + test: |
| 14 | + name: 'PHP ${{ matrix.php-version }}, Symfony ${{ matrix.symfony-version }}' |
| 15 | + runs-on: ubuntu-latest |
| 16 | + |
| 17 | + env: |
| 18 | + SYMFONY_PHPUNIT_VERSION: 8 |
| 19 | + |
| 20 | + strategy: |
| 21 | + fail-fast: false |
| 22 | + matrix: |
| 23 | + include: |
| 24 | + - php-version: '7.1' |
| 25 | + composer-flags: '--prefer-lowest' |
| 26 | + symfony-version: '^3.4' |
| 27 | + env: |
| 28 | + SYMFONY_DEPRECATIONS_HELPER: 'weak' |
| 29 | + - php-version: '7.2' |
| 30 | + - php-version: '7.3' |
| 31 | + - php-version: '7.4' |
| 32 | + symfony-version: '^4.4' |
| 33 | + - php-version: '7.4' |
| 34 | + symfony-version: '5.0.*' |
| 35 | + - php-version: '8.0' |
| 36 | + |
| 37 | + steps: |
| 38 | + - name: Checkout project |
| 39 | + uses: actions/checkout@v2 |
| 40 | + |
| 41 | + - name: Install and configure PHP |
| 42 | + uses: shivammathur/setup-php@v2 |
| 43 | + with: |
| 44 | + php-version: ${{ matrix.php-version }} |
| 45 | + tools: 'composer:v2' |
| 46 | + |
| 47 | + - name: Get composer cache directory |
| 48 | + id: composer-cache-dir |
| 49 | + run: echo "::set-output name=dir::$(composer config cache-files-dir)" |
| 50 | + |
| 51 | + - name: Cache dependencies |
| 52 | + uses: actions/cache@v2 |
| 53 | + with: |
| 54 | + path: ${{ steps.composer-cache-dir.outputs.dir }} |
| 55 | + key: ${{ runner.os }}-composer-${{ hashFiles('composer.json', 'composer.lock') }} |
| 56 | + restore-keys: | |
| 57 | + ${{ runner.os }}-composer- |
| 58 | +
|
| 59 | + - name: Require Specific Symfony Version |
| 60 | + if: ${{ matrix.symfony-version }} |
| 61 | + run: composer require --no-update symfony/symfony:${{ matrix.symfony-version }} |
| 62 | + |
| 63 | + - name: Install dependencies |
| 64 | + run: | |
| 65 | + composer validate --strict |
| 66 | + composer update ${{ matrix.composer-flags }} |
| 67 | +
|
| 68 | + - name: Execute test cases |
| 69 | + run: make test |
0 commit comments