Skip to content

#4 - Add console testing tools #89

#4 - Add console testing tools

#4 - Add console testing tools #89

name: Test & lint PHP codebase
on:
pull_request:
branches: [ "main" ]
types: [opened, synchronize, reopened, ready_for_review]
paths:
- '**.php'
- 'composer.json'
- 'composer.lock'
jobs:
test-and-lint-php:
name: Test & lint PHP codebase
timeout-minutes: 10
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected] # https://github.com/actions/checkout
- name: Cache dependencies
uses: actions/[email protected] # https://github.com/actions/cache
with:
path: vendor
key: ${{ runner.os }}-composer-dependencies-${{ hashFiles('composer.lock') }}
restore-keys: ${{ runner.os }}-composer-dependencies
- name: Setup PHP
uses: shivammathur/[email protected] # https://github.com/shivammathur/setup-php
with:
php-version: 8.3
coverage: none
- name: Install Composer dependencies
run: composer install --prefer-dist --no-interaction
- name: Run PHP linter
run: composer cs
- name: Run tests
run: composer test