Merge pull request #20 from egyjs/dependabot/composer/larastan/larast… #27
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: coverage | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| env: | |
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
| jobs: | |
| pest-coverage: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| php: [8.2, 8.3] | |
| name: Coverage PHP ${{ matrix.php }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Cache Composer dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.composer/cache | |
| vendor | |
| key: coverage-${{ runner.os }}-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }} | |
| restore-keys: | | |
| coverage-${{ runner.os }}- | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: ${{ matrix.php }} | |
| coverage: xdebug | |
| tools: phpunit | |
| - name: Install dependencies | |
| run: composer install --no-interaction --prefer-dist | |
| - name: Run Pest with coverage | |
| run: vendor/bin/pest --coverage --coverage-clover=build/logs/clover.xml | |
| - name: Upload coverage artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage-${{ matrix.php }} | |
| path: build/logs/clover.xml | |
| - name: Optional Codecov upload | |
| if: ${{ env.CODECOV_TOKEN != '' }} | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| token: ${{ env.CODECOV_TOKEN }} | |
| files: build/logs/clover.xml | |
| fail_ci_if_error: true |