|
| 1 | +name: PHPUnit |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + |
| 6 | +jobs: |
| 7 | + phpunit: |
| 8 | + name: "PHPUnit - PHP ${{ matrix.php-version }}" |
| 9 | + runs-on: ubuntu-20.04 |
| 10 | + continue-on-error: false |
| 11 | + env: |
| 12 | + SYMFONY_REQUIRE: ${{matrix.symfony-require}} |
| 13 | + SYMFONY_DEPRECATIONS_HELPER: ${{matrix.symfony-deprecations-helper}} |
| 14 | + |
| 15 | + strategy: |
| 16 | + matrix: |
| 17 | + php-version: |
| 18 | + - "7.4" |
| 19 | + - "8.0" |
| 20 | + - "8.1" |
| 21 | + deps: |
| 22 | + - "stable" |
| 23 | + symfony-require: |
| 24 | + - "5.4.*" |
| 25 | + symfony-deprecations-helper: |
| 26 | + - "5" |
| 27 | + include: |
| 28 | + - symfony-require: "4.4.*" |
| 29 | + php-version: "7.4" |
| 30 | + deps: "low" |
| 31 | + symfony-deprecations-helper: "" |
| 32 | + |
| 33 | + - symfony-require: "4.4.*" |
| 34 | + php-version: "7.4" |
| 35 | + deps: "stable" |
| 36 | + symfony-deprecations-helper: "5" |
| 37 | + |
| 38 | + - symfony-require: "6.0.*" |
| 39 | + php-version: "8.0" |
| 40 | + deps: "stable" |
| 41 | + symfony-deprecations-helper: "5" |
| 42 | + |
| 43 | + - symfony-require: "6.0.*" |
| 44 | + php-version: "8.1" |
| 45 | + deps: "stable" |
| 46 | + symfony-deprecations-helper: "5" |
| 47 | + |
| 48 | + fail-fast: true |
| 49 | + |
| 50 | + steps: |
| 51 | + - name: Checkout code |
| 52 | + uses: actions/checkout@v2 |
| 53 | + |
| 54 | + - name: Install PHP with extensions |
| 55 | + uses: shivammathur/setup-php@v2 |
| 56 | + with: |
| 57 | + coverage: none |
| 58 | + php-version: ${{ matrix.php-version }} |
| 59 | + extensions: mbstring, intl, pdo, pdo_sqlite, sqlite3 |
| 60 | + ini-values: date.timezone=UTC |
| 61 | + |
| 62 | + - name: Validate composer.json and composer.lock |
| 63 | + run: composer validate --strict |
| 64 | + |
| 65 | + - name: Install dependencies with Composer |
| 66 | + run: composer update --no-interaction --prefer-dist --optimize-autoloader --prefer-stable |
| 67 | + |
| 68 | + - name: Cache dependencies installed with Composer |
| 69 | + uses: actions/cache@v2 |
| 70 | + with: |
| 71 | + path: ~/.composer/cache |
| 72 | + key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}" |
| 73 | + restore-keys: "php-${{ matrix.php-version }}-composer-locked-" |
| 74 | + |
| 75 | + - name: Install stable dependencies with Composer |
| 76 | + run: composer update --no-interaction --prefer-dist --prefer-stable |
| 77 | + if: "${{ matrix.deps == 'stable' }}" |
| 78 | + |
| 79 | + - name: Install dev dependencies with Composer |
| 80 | + run: composer update --no-interaction --prefer-dist |
| 81 | + if: "${{ matrix.deps == 'dev' }}" |
| 82 | + |
| 83 | + - name: Install lowest possible dependencies with Composer |
| 84 | + run: composer update --no-interaction --prefer-dist --prefer-stable --prefer-lowest |
| 85 | + if: "${{ matrix.deps == 'low' }}" |
| 86 | + |
| 87 | + - name: Install PHPUnit |
| 88 | + run: composer run-script test install |
| 89 | + |
| 90 | + - name: Run tests |
| 91 | + run: composer run-script test -v |
0 commit comments