Skip to content

Fix unit test

Fix unit test #29

name: Unit tests and checkstyle
on: [push]
jobs:
phpunit:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
extensions: mbstring
coverage: xdebug
tools: composer:v2, php-cs-fixer, phpunit
- name: Get composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache dependencies
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install dependencies
run: composer install --prefer-dist
- name: Run PHPCS
run: ./vendor/bin/phpcs src -v --standard=PSR2 --exclude=Generic.Files.LineLength
- name: Run PHPUnit
run: ./vendor/bin/phpunit --coverage-text --colors