|
| 1 | +name: "Merge Coverage" |
| 2 | + |
| 3 | +on: [pull_request] |
| 4 | + |
| 5 | +jobs: |
| 6 | + unit: |
| 7 | + runs-on: ubuntu-latest |
| 8 | + steps: |
| 9 | + - uses: actions/checkout@v4 |
| 10 | + - uses: shivammathur/setup-php@v2 |
| 11 | + with: |
| 12 | + php-version: '8.1' |
| 13 | + tools: composer, phpunit:10 |
| 14 | + coverage: xdebug |
| 15 | + env: |
| 16 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 17 | + - run: composer install |
| 18 | + - run: phpunit --testsuite unit --coverage-php reports/unit.php |
| 19 | + - uses: actions/cache/save@v4 |
| 20 | + with: |
| 21 | + path: reports |
| 22 | + key: reports-unit-${{ github.run_id }} |
| 23 | + |
| 24 | + integration: |
| 25 | + runs-on: ubuntu-latest |
| 26 | + steps: |
| 27 | + - uses: actions/checkout@v4 |
| 28 | + - uses: shivammathur/setup-php@v2 |
| 29 | + with: |
| 30 | + php-version: '8.1' |
| 31 | + tools: composer, phpunit:10 |
| 32 | + coverage: xdebug |
| 33 | + env: |
| 34 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 35 | + - run: composer install |
| 36 | + - run: phpunit --testsuite integration --coverage-php reports/integration.php |
| 37 | + - uses: actions/cache/save@v4 |
| 38 | + with: |
| 39 | + path: reports |
| 40 | + key: reports-integration-${{ github.run_id }} |
| 41 | + |
| 42 | + coverage: |
| 43 | + runs-on: ubuntu-latest |
| 44 | + needs: [integration, unit] |
| 45 | + |
| 46 | + steps: |
| 47 | + - uses: actions/checkout@v4 |
| 48 | + - uses: actions/cache/restore@v4 |
| 49 | + with: |
| 50 | + path: reports |
| 51 | + key: reports-unit-${{ github.run_id }} |
| 52 | + - uses: actions/cache/restore@v4 |
| 53 | + with: |
| 54 | + path: reports |
| 55 | + key: reports-integration-${{ github.run_id }} |
| 56 | + |
| 57 | + - uses: shivammathur/setup-php@v2 |
| 58 | + with: |
| 59 | + php-version: '8.1' |
| 60 | + tools: composer, phpunit:10 |
| 61 | + coverage: xdebug |
| 62 | + env: |
| 63 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 64 | + - run: composer install |
| 65 | + - run: php bin/merge-coverage.php |
| 66 | + |
| 67 | + |
0 commit comments