name: Unit Tests

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

jobs:
  test:
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2
      
    - name: Setup PHP Action
      uses: shivammathur/setup-php@2.1.3
      with:
        php-version: '7.4'
        tools: phpunit, composer

    - name: Install dependencies
      run: composer install --prefer-source --no-interaction --dev
      
    - name: Run test
      run: vendor/bin/phpunit
    
    - name: Report test results
      run: |
        CODECLIMATE_REPO_TOKEN="c8a07ee2759b229cb3bee66fb112ef1ce95494c" vendor/bin/test-reporter
    
    - name: Report test coverage
      run: bash <(curl -s https://codecov.io/bash)

name: Unit Tests

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

jobs:
  test:
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2
      
    - name: Setup PHP Action
      uses: shivammathur/setup-php@2.1.3
      with:
        php-version: '7.4'
        tools: phpunit, composer

    - name: Install dependencies
      run: composer install --prefer-source --no-interaction --dev
    
    - name: Setup codeclimate test reporter
      run: |
        curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
        chmod +x ./cc-test-reporter
        ./cc-test-reporter before-build
        
    - name: Run test
      run: vendor/bin/phpunit
      
    - name: Send report to codeclimate
      env:
        CC_TEST_REPORTER_ID: c8a07ee2759b229cb3bee66fb112ef1ce95494c
      run: ./cc-test-reporter after-build -t clover
      
    - name: Report test coverage
      run: bash <(curl -s https://codecov.io/bash)

Use the new codeclimate test reporter
Use the new codeclimate test reporter