Skip to content

ci: setup PHPUnit, PHPStan, PHP CS Fixer and GitHub Actions workflow #2

ci: setup PHPUnit, PHPStan, PHP CS Fixer and GitHub Actions workflow

ci: setup PHPUnit, PHPStan, PHP CS Fixer and GitHub Actions workflow #2

Workflow file for this run

name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
tests:
name: PHP ${{ matrix.php }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: ['8.4']
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: mbstring, xml, ctype, iconv, intl, pdo_sqlite
coverage: none
- name: Get composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache composer dependencies
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install dependencies
run: composer update --prefer-dist --no-progress
- name: Initialize PHPUnit Bridge
run: vendor/bin/simple-phpunit -v
- name: Run PHP CS Fixer (Code Style)
if: matrix.php == '8.4'
run: composer cs:check
- name: Run PHPStan (Static Analysis)
run: composer stan
- name: Run PHPUnit (Tests)
run: composer tests