Skip to content

Merge pull request #23 from willemverspyck/master #32

Merge pull request #23 from willemverspyck/master

Merge pull request #23 from willemverspyck/master #32

name: Unit tests and checkstyle
on: [push]
jobs:
phpunit:
runs-on: ubuntu-latest
strategy:
matrix:
operating-system: ['ubuntu-latest']
php-versions: ['8.1', '8.2', '8.3']
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
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