Skip to content

Tests

Tests #850

Workflow file for this run

name: Tests
on:
push:
pull_request:
workflow_dispatch:
schedule:
- cron: 0 6 * * *
jobs:
Test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php:
- 8.1
- 8.2
dependencies:
- hi
- lo
steps:
- uses: actions/checkout@v3
- name: Setup PHP ${{ matrix.php }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: xdebug
- name: Validate composer.json
run: composer validate
- name: Cache dependencies
id: composer-cache
uses: actions/cache@v3
with:
path: vendor
key: php-${{ matrix.php }}-${{ matrix.dependencies }}-${{ hashFiles('composer.json') }}
- name: Install dependencies ${{ matrix.dependencies == 'lo' && '(lowest)' || '' }}
run: composer update --no-interaction --no-progress
${{ matrix.dependencies == 'lo' && '--prefer-lowest' || '' }}
- name: Run test suite with coverage
run: composer test -- --coverage-clover=build/logs/clover.xml --coverage-xml=build/coverage/coverage-xml
--log-junit=build/coverage/junit.xml
- name: Upload test coverage
run: |
curl -Os https://uploader.codecov.io/latest/linux/codecov
chmod +x codecov
./codecov
- name: Run mutation tests
run: |
ln -sfv ../build test
composer mutate -- --min-msi=99 --threads=$(nproc) --show-mutations --coverage=build/coverage
env:
INFECTION_BADGE_API_KEY: ${{ secrets.INFECTION_BADGE_API_KEY }}