Skip to content

feat: add scrutinizer #12

feat: add scrutinizer

feat: add scrutinizer #12

Workflow file for this run

name: CI

Check failure on line 1 in .github/workflows/ci.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/ci.yml

Invalid workflow file

(Line: 67, Col: 13): Unrecognized named-value: 'secrets'. Located at position 1 within expression: secrets.SCRUTINIZER_TOKEN != ''
on:
push:
branches:
- master
- main
pull_request:
jobs:
tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php-version:
- '8.1'
- '8.2'
- '8.3'
- '8.4'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
tools: composer:v2
coverage: none
- name: Validate composer.json
run: composer validate --strict --no-check-lock
- name: Install dependencies
run: composer update --prefer-dist --no-progress
- name: Run PHPStan
run: composer phpstan
- name: Run PHPUnit
run: vendor/bin/phpunit --no-coverage
coverage:
runs-on: ubuntu-latest
if: github.event_name == 'push'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.4'
tools: composer:v2
coverage: xdebug
- name: Install dependencies
run: composer update --prefer-dist --no-progress
- name: Run PHPUnit with Clover coverage
run: vendor/bin/phpunit --exclude-group performance --coverage-clover coverage.xml
- name: Upload coverage to Scrutinizer
if: ${{ secrets.SCRUTINIZER_TOKEN != '' }}
run: |
curl -LsS https://scrutinizer-ci.com/ocular.phar -o ocular.phar
php ocular.phar code-coverage:upload --format=php-clover coverage.xml --access-token="${{ secrets.SCRUTINIZER_TOKEN }}"