|
| 1 | +name: coveralls |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - master |
| 7 | + - '*.x' |
| 8 | + pull_request: |
| 9 | + |
| 10 | +jobs: |
| 11 | + types: |
| 12 | + runs-on: ubuntu-24.04 |
| 13 | + |
| 14 | + strategy: |
| 15 | + fail-fast: true |
| 16 | + matrix: |
| 17 | + php: [ 8.1, 8.2, 8.3 ] |
| 18 | + phpunit: [ '9.3.9', '10.5.38' ] |
| 19 | + |
| 20 | + name: PHP ${{ matrix.php }} - PHPUnit ${{ matrix.phpunit }} |
| 21 | + |
| 22 | + steps: |
| 23 | + - name: Checkout code |
| 24 | + uses: actions/checkout@v4 |
| 25 | + |
| 26 | + - name: Setup PHP |
| 27 | + uses: shivammathur/setup-php@v2 |
| 28 | + with: |
| 29 | + php-version: 8.1 |
| 30 | + extensions: mbstring, xml, xdebug |
| 31 | + tools: composer:v2 |
| 32 | + coverage: xdebug |
| 33 | + |
| 34 | + - name: Set Framework version |
| 35 | + run: composer config version "10.x-dev" |
| 36 | + |
| 37 | + - name: Set minimum PHP 8.1 versions |
| 38 | + uses: nick-fields/retry@v3 |
| 39 | + with: |
| 40 | + timeout_minutes: 5 |
| 41 | + max_attempts: 5 |
| 42 | + command: composer require symfony/css-selector:^6.0 --no-interaction --no-update |
| 43 | + |
| 44 | + - name: Set minimum PHP 8.2 versions |
| 45 | + uses: nick-fields/retry@v3 |
| 46 | + with: |
| 47 | + timeout_minutes: 5 |
| 48 | + max_attempts: 5 |
| 49 | + command: composer require guzzlehttp/psr7:^2.4 --no-interaction --no-update |
| 50 | + if: matrix.php >= 8.2 |
| 51 | + |
| 52 | + - name: Set PHPUnit |
| 53 | + uses: nick-fields/retry@v3 |
| 54 | + with: |
| 55 | + timeout_minutes: 5 |
| 56 | + max_attempts: 5 |
| 57 | + command: composer require phpunit/phpunit:^${{ matrix.phpunit }} --dev --no-interaction --no-update |
| 58 | + |
| 59 | + - name: Install dependencies |
| 60 | + uses: nick-fields/retry@v3 |
| 61 | + with: |
| 62 | + timeout_minutes: 5 |
| 63 | + max_attempts: 5 |
| 64 | + command: composer update --prefer-stable --prefer-dist --no-interaction --no-progress |
| 65 | + |
| 66 | + - name: Execute tests with coverage |
| 67 | + run: vendor/bin/phpunit --configuration="phpunit.xml.dist" --coverage-clover="build/logs/clover.xml" |
| 68 | + |
| 69 | + - name: Store coverage results to Coveralls |
| 70 | + env: |
| 71 | + COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 72 | + run: | |
| 73 | + composer global require php-coveralls/php-coveralls --prefer-stable --prefer-dist --no-interaction --no-progress |
| 74 | + php-coveralls --coverage_clover="build/logs/clover.xml" -v |
0 commit comments