Skip to content

Support ENUMs (#209) #269

Support ENUMs (#209)

Support ENUMs (#209) #269

Workflow file for this run

name: Tests
on: [push, pull_request]
jobs:
testing:
name: PHP ${{ matrix.php-versions }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php-versions: ['7.2', '7.3', '7.4', '8.0', '8.1']
phpstan: ['0']
# We only need to run PHPStan once on the latest PHP version.
include:
- php-versions: '8.2'
phpstan: '1'
steps:
- name: Checkout Coder
uses: actions/checkout@v3
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring
# Disable Xdebug for better performance.
coverage: none
- name: Get composer cache directory
id: composercache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache composer dependencies
uses: actions/cache@v3
with:
path: ${{ steps.composercache.outputs.dir }}
# Use composer.json for key, if composer.lock is not committed.
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install Composer dependencies
# Running composer install without a lock file will also update cached
# dependencies in vendor.
run: composer install --no-progress --prefer-dist --optimize-autoloader
- name: Run PHPUnit
run: ./vendor/bin/phpunit
- name: Run PHPCS
run: ./vendor/bin/phpcs
- name: Check custom standard autoloading
# Ensure that a custom standard can be invoked and the auto-loading of
# abstract classes works.
# Ensure that the DrupalPractice standard can be invoked standalone and the
# auto-loading of abstract classes works.
run: |
./vendor/bin/phpcs -p --standard=tests/Drupal/phpcs-ruleset.xml tests/Drupal/good/ --ignore=tests/Drupal/good/GoodUnitTest.php
./vendor/bin/phpcs -p --standard=coder_sniffer/DrupalPractice tests/DrupalPractice/good/ --ignore=tests/DrupalPractice/good/GoodUnitTest.php
- name: Run PHPStan
run: if [[ ${{ matrix.phpstan }} == "1" ]]; then ./vendor/bin/phpstan analyse; fi