|
| 1 | +name: Test |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + pull_request: |
| 6 | + branches: |
| 7 | + - master |
| 8 | + - v2 # Temporary until v2 is merged into master |
| 9 | + push: |
| 10 | + branches: |
| 11 | + - master |
| 12 | + - v2 # Temporary until v2 is merged into master |
| 13 | + |
| 14 | +concurrency: |
| 15 | + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref_name }}-${{ github.event.pull_request.number || github.sha }} |
| 16 | + cancel-in-progress: true |
| 17 | + |
| 18 | +permissions: {} |
| 19 | + |
| 20 | +jobs: |
| 21 | + phpunit: |
| 22 | + runs-on: ubuntu-latest |
| 23 | + permissions: |
| 24 | + contents: read |
| 25 | + strategy: |
| 26 | + matrix: |
| 27 | + php: ['8.1', '8.2', '8.3', '8.4'] |
| 28 | + dependency-versions: [lowest, highest] |
| 29 | + coverage: [none] |
| 30 | + exclude: |
| 31 | + - php: '8.4' |
| 32 | + dependency-versions: highest |
| 33 | + coverage: none |
| 34 | + include: |
| 35 | + - php: '8.4' |
| 36 | + dependency-versions: highest |
| 37 | + coverage: xdebug |
| 38 | + steps: |
| 39 | + - uses: actions/checkout@v4 |
| 40 | + |
| 41 | + - uses: shivammathur/setup-php@v2 |
| 42 | + with: |
| 43 | + php-version: ${{ matrix.php }} |
| 44 | + coverage: ${{ matrix.coverage }} |
| 45 | + env: |
| 46 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 47 | + |
| 48 | + - uses: ramsey/composer-install@v3 |
| 49 | + with: |
| 50 | + dependency-versions: ${{ matrix.dependency-versions }} |
| 51 | + composer-options: --no-audit --optimize-autoloader |
| 52 | + |
| 53 | + - run: composer test -- --coverage-clover coverage.xml |
| 54 | + if: ${{ matrix.coverage == 'xdebug' }} |
| 55 | + |
| 56 | + - run: composer test -- --no-coverage |
| 57 | + if: ${{ matrix.coverage != 'xdebug' }} |
| 58 | + |
| 59 | + - uses: actions/upload-artifact@v4 |
| 60 | + if: ${{ matrix.coverage == 'xdebug' }} |
| 61 | + with: |
| 62 | + name: coverage |
| 63 | + path: coverage.xml |
| 64 | + |
| 65 | + coveralls: |
| 66 | + needs: phpunit |
| 67 | + runs-on: ubuntu-latest |
| 68 | + permissions: |
| 69 | + contents: read |
| 70 | + steps: |
| 71 | + - uses: actions/download-artifact@v4 |
| 72 | + with: |
| 73 | + name: coverage |
| 74 | + - uses: coverallsapp/github-action@v2 |
| 75 | + with: |
| 76 | + file: coverage.xml |
0 commit comments