|
| 1 | +name: Tests |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - master |
| 7 | + - '*.x' |
| 8 | + pull_request: |
| 9 | + schedule: |
| 10 | + - cron: '0 0 * * *' |
| 11 | + |
| 12 | +jobs: |
| 13 | + linux_tests: |
| 14 | + name: PHP ${{ matrix.php }} - Linux |
| 15 | + runs-on: ubuntu-24.04 |
| 16 | + strategy: |
| 17 | + fail-fast: false |
| 18 | + matrix: |
| 19 | + php: [ 8.1, 8.2, 8.3, 8.4, 8.5 ] |
| 20 | + |
| 21 | + steps: |
| 22 | + - name: Checkout code |
| 23 | + uses: actions/checkout@v6 |
| 24 | + |
| 25 | + - name: Setup PHP |
| 26 | + uses: shivammathur/setup-php@v2 |
| 27 | + with: |
| 28 | + php-version: ${{ matrix.php }} |
| 29 | + tools: composer:v2 |
| 30 | + coverage: xdebug |
| 31 | + |
| 32 | + - name: Install dependencies |
| 33 | + run: composer install --no-interaction --no-progress --prefer-dist |
| 34 | + |
| 35 | + - name: Run tests |
| 36 | + run: vendor/bin/phpunit --coverage-clover coverage.xml |
| 37 | + |
| 38 | + - name: Upload coverage to Codecov |
| 39 | + uses: codecov/codecov-action@v5 |
| 40 | + with: |
| 41 | + token: ${{ secrets.CODECOV_TOKEN }} |
| 42 | + |
| 43 | + windows_tests: |
| 44 | + name: PHP ${{ matrix.php }} - Windows |
| 45 | + runs-on: windows-2022 |
| 46 | + |
| 47 | + strategy: |
| 48 | + fail-fast: false |
| 49 | + matrix: |
| 50 | + php: [ 8.1, 8.2, 8.3, 8.4, 8.5 ] |
| 51 | + |
| 52 | + steps: |
| 53 | + - name: Set git to use LF |
| 54 | + run: | |
| 55 | + git config --global core.autocrlf false |
| 56 | + git config --global core.eol lf |
| 57 | +
|
| 58 | + - name: Checkout code |
| 59 | + uses: actions/checkout@v6 |
| 60 | + |
| 61 | + - name: Setup PHP |
| 62 | + uses: shivammathur/setup-php@v2 |
| 63 | + with: |
| 64 | + php-version: ${{ matrix.php }} |
| 65 | + tools: composer:v2 |
| 66 | + |
| 67 | + - name: Validate composer.json |
| 68 | + run: composer validate --strict |
| 69 | + |
| 70 | + - name: Install dependencies |
| 71 | + run: composer install --no-interaction --no-progress --prefer-dist |
| 72 | + |
| 73 | + - name: Run tests |
| 74 | + run: vendor/bin/phpunit |
0 commit comments