|
| 1 | +name: "PHPUnit" |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + paths-ignore: |
| 6 | + - 'examples/**' |
| 7 | + pull_request: |
| 8 | + paths-ignore: |
| 9 | + - 'examples/**' |
| 10 | + |
| 11 | +env: |
| 12 | + COMPOSER_FLAGS: "--ansi --no-interaction --no-progress --prefer-dist" |
| 13 | + SYMFONY_PHPUNIT_VERSION: "" |
| 14 | + |
| 15 | +jobs: |
| 16 | + tests: |
| 17 | + name: "PHPUnit" |
| 18 | + |
| 19 | + runs-on: ubuntu-latest |
| 20 | + continue-on-error: ${{ matrix.experimental }} |
| 21 | + |
| 22 | + strategy: |
| 23 | + matrix: |
| 24 | + include: |
| 25 | + - php-version: "7.2" |
| 26 | + experimental: false |
| 27 | + - php-version: "7.4" |
| 28 | + experimental: false |
| 29 | + - php-version: "8.0" |
| 30 | + experimental: false |
| 31 | + - php-version: "8.1" |
| 32 | + experimental: false |
| 33 | + fail-fast: false |
| 34 | + |
| 35 | + steps: |
| 36 | + - name: "Checkout" |
| 37 | + uses: "actions/checkout@v3" |
| 38 | + |
| 39 | + - name: "Install PHP" |
| 40 | + uses: "shivammathur/setup-php@v2" |
| 41 | + with: |
| 42 | + coverage: "none" |
| 43 | + extensions: "intl, zip" |
| 44 | + ini-values: "memory_limit=-1" |
| 45 | + php-version: "${{ matrix.php-version }}" |
| 46 | + |
| 47 | + - name: "Determine composer cache directory" |
| 48 | + id: "determine-composer-cache-directory" |
| 49 | + run: "echo \"::set-output name=directory::$(composer config cache-dir)\"" |
| 50 | + |
| 51 | + - name: "Cache dependencies installed with composer" |
| 52 | + uses: "actions/cache@v2" |
| 53 | + with: |
| 54 | + path: "${{ steps.determine-composer-cache-directory.outputs.directory }}" |
| 55 | + key: "php-${{ matrix.php-version }}-symfony-php-unit-version-${{ env.SYMFONY_PHPUNIT_VERSION }}-${{ hashFiles('**/composer.lock') }}" |
| 56 | + restore-keys: "php-${{ matrix.php-version }}-symfony-php-unit-version-${{ env.SYMFONY_PHPUNIT_VERSION }}" |
| 57 | + |
| 58 | + - name: "Install highest dependencies" |
| 59 | + if: "matrix.experimental == true" |
| 60 | + run: "composer config platform --unset && composer update ${{ env.COMPOSER_FLAGS }}" |
| 61 | + |
| 62 | + - name: "Install locked dependencies" |
| 63 | + if: "matrix.experimental == false" |
| 64 | + run: "composer config platform --unset && composer update ${{ env.COMPOSER_FLAGS }}" |
| 65 | + |
| 66 | + - name: "Initialize PHPUnit sources" |
| 67 | + run: "vendor/bin/simple-phpunit --filter NO_TEST_JUST_AUTOLOAD_THANKS" |
| 68 | + |
| 69 | + - name: "Run PHPUnit" |
| 70 | + run: "composer phpunit" |
0 commit comments