name: run-tests
on: [push, pull_request]
jobs:
run-tests:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest, windows-latest]
php: [8.0]
dependency-version: [prefer-lowest, prefer-stable]
name: PHP${{ matrix.php }}-${{ matrix.dependency-version }}-${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick
coverage: xdebug
- name: Setup problem matchers for PHP
run: |
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- name: Install dependencies
run: composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest
- name: Run tests with coverage
run: composer test:coverage
- name: Upload coverage to CodeClimate
if: "!startsWith(matrix.os, 'windows')"
uses: paambaati/codeclimate-action@v2.7.4
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
with:
coverageLocations: ${{github.workspace}}/build/coverage.xml:clover
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ${{github.workspace}}/build/coverage.xml
env_vars: ${{ matrix.os }},PHP{{ matrix.php }}
name: PHP${{ matrix.php }}-${{ matrix.dependency-version }}-${{ matrix.os }}
fail_ci_if_error: false
|