chore: ci coverage #14
This file contains 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: ci | |
on: | |
pull_request: | |
types: [ opened, synchronize, ready_for_review, reopened ] | |
jobs: | |
### | |
phpunit-tests: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- php-version: '8.1' | |
laravel-version: '9.*' | |
steps: | |
- uses: actions/checkout@v2 | |
- name: install PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php-version }} | |
coverage: pcov | |
- run: composer validate | |
- name: require Laravel | |
run: composer require "laravel/framework:${{ matrix.laravel-version }}" --no-update | |
- name: install dependencies | |
run: composer update --prefer-dist --no-progress --no-suggest --no-interaction ${{ matrix.composer-flags }} | |
- run: composer ci:coverage | |
- name: Store test results and coverage report | |
uses: actions/upload-artifact@v3 | |
if: always() | |
with: | |
name: phpunit-reports | |
path: phpunit-reports/*.xml | |
retention-days: 1 | |
sonarcloud: | |
needs: [ phpunit-tests ] | |
if: ${{ always() && !cancelled() && github.event_name != 'merge_group' }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- uses: actions/download-artifact@v3 | |
- name: Get PHP coverage report paths | |
id: coverage | |
run: sed -i 's@'$GITHUB_WORKSPACE'@/github/workspace@g' phpunit-reports/phpunit.coverage.xml | |
- name: Analyze with SonarCloud | |
uses: sonarsource/sonarcloud-github-action@master | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |