.github/workflows/php.yml

Summary

Maintainability
Test Coverage
name: PHP tests

on: [push]

jobs:
  Tests:
    runs-on: ubuntu-latest
    strategy:
          matrix:
            php-versions: ['8.0', '8.1', 'latest']
          fail-fast: false
    steps:
    - uses: actions/checkout@v1
    - name: Setup PHP
      uses: shivammathur/setup-php@v2
      with:
        php-version: ${{ matrix.php-versions }}
        extensions: mbstring, bcmath
        coverage: xdebug
    - name: Install dependencies
      run: |
        curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > $HOME/cc-test-reporter
        composer install --optimize-autoloader
        chmod +x ./primi ./bin/* $HOME/cc-test-reporter
    - name: Prepare
      run: $HOME/cc-test-reporter before-build
    - name: Run tests
      run: chmod +x ./primi ./bin/* && ./bin/tests.sh --php php --coverage xml
    - name: Run benchmarks
      run: export XDEBUG_MODE=off && ./bin/bench
    - name: Run static analysis
      continue-on-error: true
      run: ./bin/phpstan.sh
    - name: Gather test results
      continue-on-error: true
      env:
        CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
      run: |
        $HOME/cc-test-reporter format-coverage --output=./coverage.json --input-type=clover ./coverage.xml
        $HOME/cc-test-reporter upload-coverage --input=./coverage.json