feat: more IDL #72
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: "PHP Workflow" | |
on: | |
workflow_dispatch: | |
pull_request: | |
paths: [ "**.php" ] | |
branches: ["main"] | |
push: | |
paths: ["**.php"] | |
branches: ["main"] | |
env: | |
PHP_CS_FIXER_IGNORE_ENV: 1 | |
COMPOSER_FLAGS: "--ansi --no-interaction --no-progress --no-suggest --ignore-platform-req=php" | |
jobs: | |
php-code-checks: | |
name: "PHP Code Quality Checks" | |
runs-on: ${{ matrix.operating-system }} | |
strategy: | |
matrix: | |
dependencies: | |
- "locked" | |
- "highest" | |
- "lowest" | |
php-version: | |
- "8.1" | |
- "8.2" | |
operating-system: | |
- "ubuntu-latest" | |
steps: | |
- name: "Checkout Code" | |
uses: "actions/checkout@v2" | |
- name: "Install PHP" | |
uses: "shivammathur/setup-php@v2" | |
with: | |
coverage: "pcov" | |
php-version: "${{ matrix.php-version }}" | |
ini-values: memory_limit=-1 | |
tools: composer:v2 | |
- name: "Cache Dependencies" | |
uses: "actions/cache@v2" | |
with: | |
path: | | |
~/.composer/cache | |
vendor | |
key: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}" | |
restore-keys: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}" | |
# Our code should work with the highest possible dependencies | |
- name: "Install Highest Dependencies" | |
if: ${{ matrix.dependencies == 'highest' }} | |
run: "composer update ${{ env.COMPOSER_FLAGS }}" | |
# Our code should work with the lowest possible dependencies | |
- name: "Install Lowest Dependencies" | |
if: ${{ matrix.dependencies == 'lowest' }} | |
run: "composer update --prefer-lowest ${{ env.COMPOSER_FLAGS }}" | |
# Our code should work with the locked dependencies | |
- name: "Install Locked Dependencies" | |
if: ${{ matrix.dependencies == 'locked' }} | |
run: "composer install ${{ env.COMPOSER_FLAGS }}" | |
# We only run code style checker on locked | |
- name: "Run Code Style Checker" | |
run: "vendor/bin/php-cs-fixer fix --dry-run -v" | |
if: ${{ matrix.dependencies == 'locked' }} | |
# We only run static analysis on locked | |
- name: "Run Static Analysis" | |
if: ${{ matrix.dependencies == 'locked' }} | |
run: "vendor/bin/psalm --shepherd --stats" | |
# We always run the test suite | |
- name: "Run Test Suite" | |
run: "vendor/bin/phpunit" | |
continue-on-error: ${{ matrix.dependencies == 'lowest' }} |