|
| 1 | +name: "unit tests" |
| 2 | + |
| 3 | +on: [ "pull_request", "push" ] |
| 4 | + |
| 5 | +jobs: |
| 6 | + unit-tests: |
| 7 | + name: "unit tests" |
| 8 | + |
| 9 | + runs-on: "ubuntu-latest" |
| 10 | + |
| 11 | + strategy: |
| 12 | + matrix: |
| 13 | + symfony-version: |
| 14 | + - "4.4.*" |
| 15 | + - "5.2.*" |
| 16 | + php-version: |
| 17 | + - "7.2" |
| 18 | + - "7.3" |
| 19 | + - "7.4" |
| 20 | + - "8.0" |
| 21 | + dependencies: |
| 22 | + - "lowest" |
| 23 | + - "highest" |
| 24 | + include: |
| 25 | + - { symfony-version: "4.4.*", php-version: "7.1", dependencies: "lowest" } |
| 26 | + - { symfony-version: "4.4.*", php-version: "7.1", dependencies: "highest" } |
| 27 | + |
| 28 | + steps: |
| 29 | + - name: "checkout" |
| 30 | + uses: "actions/checkout@v2" |
| 31 | + |
| 32 | + - name: "installing PHP" |
| 33 | + uses: "shivammathur/setup-php@v2" |
| 34 | + with: |
| 35 | + php-version: "${{ matrix.php-version }}" |
| 36 | + tools: composer:v2, cs2pr |
| 37 | + extensions: intl, bcmath, curl, openssl, mbstring, pdo, pdo_sqlite |
| 38 | + coverage: pcov |
| 39 | + ini-values: memory_limit=-1 |
| 40 | + |
| 41 | + - name: "caching dependencies" |
| 42 | + uses: "actions/cache@v2" |
| 43 | + with: |
| 44 | + path: | |
| 45 | + ~/.composer/cache |
| 46 | + vendor |
| 47 | + key: "php-${{ matrix.php-version }}" |
| 48 | + restore-keys: "php-${{ matrix.php-version }}" |
| 49 | + |
| 50 | + - name: "configuring composer platform" |
| 51 | + if: (startsWith(matrix.php, '8.0')) |
| 52 | + run: composer config platform.php 7.4.99 |
| 53 | + |
| 54 | + - name: "install lowest dependencies" |
| 55 | + if: ${{ matrix.dependencies == 'lowest' }} |
| 56 | + run: | |
| 57 | + composer require --no-update symfony/config=${{ matrix.symfony-version }} symfony/http-kernel=${{ matrix.symfony-version }} symfony/dependency-injection=${{ matrix.symfony-version }} symfony/options-resolver=${{ matrix.symfony-version }} |
| 58 | + composer require --no-update --dev symfony/framework-bundle=${{ matrix.symfony-version }} symfony/yaml=${{ matrix.symfony-version }} |
| 59 | + composer update --prefer-lowest --no-interaction --no-progress --prefer-dist |
| 60 | +
|
| 61 | + - name: "install highest dependencies" |
| 62 | + if: ${{ matrix.dependencies == 'highest' }} |
| 63 | + run: | |
| 64 | + composer require --no-update symfony/config=${{ matrix.symfony-version }} symfony/http-kernel=${{ matrix.symfony-version }} symfony/dependency-injection=${{ matrix.symfony-version }} symfony/options-resolver=${{ matrix.symfony-version }} |
| 65 | + composer require --no-update --dev symfony/framework-bundle=${{ matrix.symfony-version }} symfony/yaml=${{ matrix.symfony-version }} |
| 66 | + composer update --no-interaction --no-progress --prefer-dist |
| 67 | +
|
| 68 | + - name: "installing phpunit" |
| 69 | + run: vendor/bin/simple-phpunit install |
| 70 | + |
| 71 | + - name: "running unit tests" |
| 72 | + run: vendor/bin/simple-phpunit |
0 commit comments