WIP #18
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Check code | |
on: | |
push: | |
pull_request: | |
jobs: | |
check: | |
name: Run checks - PHP ${{ matrix.php }} - ${{ matrix.dependency-version }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
php: [ 8.2, 8.3 ] | |
dependency-version: [ prefer-lowest, prefer-stable ] | |
os: [ ubuntu-latest ] | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v3 | |
- name: Cache PHP dependencies | |
uses: actions/cache@v3 | |
with: | |
path: '**/vendor' | |
key: ${{ runner.os }}-vendor-cache-${{ hashFiles('**/composer.lock') }} | |
restore-keys: | | |
${{ runner.os }}-vendor-cache- | |
- name: Cache Composer dependencies | |
uses: actions/cache@v3 | |
with: | |
path: ~/.composer/cache/files | |
key: composer-${{ runner.os }}-php-${{ matrix.php }}-${{ hashFiles('composer.json') }} | |
- name: Validate Composer configuration file | |
run: composer validate --strict | |
- name: Set up PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php }} | |
extensions: mbstring | |
coverage: none | |
- name: Install dependencies | |
run: composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-progress --optimize-autoloader | |
- name: Lint code | |
run: PHP_CS_FIXER_IGNORE_ENV=true vendor/bin/php-cs-fixer fix --dry-run --diff | |
- name: Run tests | |
run: vendor/bin/phpunit |