Add badges to README for package stats, PHP/Symfony compatibility, te… #3
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: Tests | |
| on: | |
| push: | |
| branches: [ "main", "develop" ] | |
| pull_request: | |
| branches: [ "main", "develop" ] | |
| jobs: | |
| tests: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: '8.2' | |
| coverage: xdebug | |
| extensions: mbstring, xml, ctype, iconv, intl | |
| - name: Get Composer Cache Directory | |
| id: composer-cache | |
| run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | |
| - name: Cache dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ steps.composer-cache.outputs.dir }} | |
| key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | |
| restore-keys: ${{ runner.os }}-composer- | |
| - name: Install dependencies | |
| run: | | |
| composer install --prefer-dist --no-progress --no-interaction | |
| composer run bin-ecs-install | |
| composer run bin-phpstan-install | |
| composer run bin-rector-install | |
| composer run bin-phpunit-install | |
| - name: PHP CS Fixer (ECS) | |
| run: composer run bin-ecs | |
| - name: Rector Check | |
| run: composer run bin-rector | |
| - name: PHPStan Analysis | |
| run: composer run bin-phpstan | |
| - name: Run Tests with Coverage | |
| run: vendor-bin/phpunit/vendor/bin/phpunit --configuration phpunit-coverage.xml.dist --coverage-clover var/coverage.xml | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| files: ./var/coverage.xml | |
| fail_ci_if_error: true |