|
| 1 | +name: tests |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + pull_request: |
| 6 | + schedule: |
| 7 | + - cron: '0 0 * * *' |
| 8 | + |
| 9 | +jobs: |
| 10 | + tests: |
| 11 | + name: Tests (${{matrix.php}}, ${{ matrix.os }}, ${{ matrix.stability }}) |
| 12 | + runs-on: ${{ matrix.os }} |
| 13 | + strategy: |
| 14 | + fail-fast: false |
| 15 | + matrix: |
| 16 | + php: [ '8.1', '8.2', '8.3' ] |
| 17 | + os: [ ubuntu-latest, macos-latest, windows-latest ] |
| 18 | + stability: [ prefer-lowest, prefer-stable ] |
| 19 | + steps: |
| 20 | + - name: Set Git To Use LF |
| 21 | + run: | |
| 22 | + git config --global core.autocrlf false |
| 23 | + git config --global core.eol lf |
| 24 | + - name: Checkout |
| 25 | + uses: actions/checkout@v3.3.0 |
| 26 | + - name: Setup PHP ${{ matrix.php }} |
| 27 | + uses: shivammathur/setup-php@v2 |
| 28 | + with: |
| 29 | + php-version: ${{ matrix.php }} |
| 30 | + tools: pecl |
| 31 | + ini-values: "memory_limit=-1" |
| 32 | + - name: Validate Composer |
| 33 | + run: composer validate |
| 34 | + - name: Get Composer Cache Directory |
| 35 | + id: composer-cache |
| 36 | + run: echo "::set-output name=dir::$(composer config cache-files-dir)" |
| 37 | + - name: Restore Composer Cache |
| 38 | + uses: actions/cache@v1 |
| 39 | + with: |
| 40 | + path: ${{ steps.composer-cache.outputs.dir }} |
| 41 | + key: ${{ runner.os }}-${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }} |
| 42 | + restore-keys: ${{ runner.os }}-${{ matrix.php }}-composer- |
| 43 | + - name: Install Dependencies |
| 44 | + uses: nick-invision/retry@v1 |
| 45 | + with: |
| 46 | + timeout_minutes: 5 |
| 47 | + max_attempts: 5 |
| 48 | + command: composer update --${{ matrix.stability }} --ignore-platform-reqs --prefer-dist --no-interaction --no-progress |
| 49 | + - name: Execute Unit Tests |
| 50 | + run: composer test:unit |
| 51 | + - name: Execute Functional Tests |
| 52 | + run: composer test:functional |
0 commit comments