Skip to content

Use composer install action #38

Use composer install action

Use composer install action #38

Workflow file for this run

name: PHPCS + Unit Tests
on:
pull_request:
workflow_dispatch:
env:
COMPOSER_AUTH: '${{ secrets.COMPOSER_AUTH_JSON }}'
jobs:
phpcs:
name: Test (PHP ${{ matrix.php-versions }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php-versions: ['7.4','8.0','8.1','8.2']
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
- name: Validate Composer
run: composer validate
- name: Install Composer dependencies
uses: ramsey/composer-install@v2
- name: Detect File Changes
uses: dorny/paths-filter@v2
id: filter
with:
list-files: shell
filters: |
src:
- added|modified: 'src/**/*.php'
- name: PHP CodeSniffer
if: ${{ steps.filter.outputs.src == 'true' }}
run: ./vendor/bin/phpcs ${{ steps.filter.outputs.src_files }}
- name: Unit testing
run: ./vendor/bin/phpunit