martin-helmich/phpunit-json-assert

View on GitHub
.github/workflows/php.yml

Summary

Maintainability
Test Coverage
name: Unit tests

on:
  push:
    branches:
      - 'master'
    tags:
      - '*'
  pull_request:

jobs:
  build:
    strategy:
      matrix:
        php: ['8.0', '8.1', '8.2', '8.3']
        phpunit: ['8.0', '9.0', '10.0', '11.0']
        exclude:
          - php: '8.0'
            phpunit: '10.0'
          - php: '8.1'
            phpunit: '11.0'
          - php: '8.0'
            phpunit: '11.0'
    runs-on: ubuntu-latest
    name: PHP ${{ matrix.php }}, PHPUnit ${{ matrix.phpunit }}

    steps:
    - uses: actions/checkout@v1

    - name: Setup PHP
      uses: shivammathur/setup-php@v2
      with:
        php-version: ${{ matrix.php }}
        extensions: mbstring, intl, json
        ini-values: error_reporting=E_ALL
        coverage: pcov
        tools: composer:v2

    - name: Validate composer.json and composer.lock
      run: composer validate

    - name: Declare required PHPUnit version
      run: |
        composer require --no-update --dev phpunit/phpunit ~${{ matrix.phpunit }}

    - name: Install dependencies
      run: composer install --prefer-dist --no-progress --no-suggest

    #- name: Run type checker
    #  run: ./vendor/bin/psalm

    - name: Run unit tests
      run: ./vendor/bin/phpunit --testdox --no-coverage