CI #119
This file contains hidden or 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: CI | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - main | |
| tags: | |
| - "v*" | |
| pull_request: | |
| branches: | |
| - main | |
| schedule: | |
| - cron: "23 4 * * 1" | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| composer: | |
| name: Composer validation | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: "8.3" | |
| coverage: none | |
| tools: composer:v2 | |
| - name: Validate Composer package | |
| run: composer validate --strict | |
| composer-audit: | |
| name: Composer audit | |
| runs-on: ubuntu-latest | |
| needs: composer | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| - name: Setup PHP with Composer cache | |
| uses: ./.github/actions/php-setup | |
| with: | |
| cache-key: ${{ runner.os }}-audit-php8.3-composer-${{ hashFiles('composer.lock') }} | |
| cache-restore-keys: ${{ runner.os }}-audit-php8.3-composer- | |
| - name: Install dependencies | |
| run: composer install --no-ansi --no-interaction --no-progress --prefer-dist | |
| - name: Run Composer audit | |
| run: composer audit | |
| coding-standards: | |
| name: Coding standards and PHP compatibility | |
| runs-on: ubuntu-latest | |
| needs: composer | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| - name: Setup PHP with Composer cache | |
| uses: ./.github/actions/php-setup | |
| with: | |
| cache-key: ${{ runner.os }}-phpcs-php8.3-composer-${{ hashFiles('composer.lock') }} | |
| cache-restore-keys: ${{ runner.os }}-phpcs-php8.3-composer- | |
| - name: Install dependencies | |
| run: composer install --no-ansi --no-interaction --no-progress --prefer-dist | |
| - name: Run PHPCS | |
| run: composer phpcs | |
| static-analysis: | |
| name: Static analysis | |
| runs-on: ubuntu-latest | |
| needs: composer | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| - name: Setup PHP with Composer cache | |
| uses: ./.github/actions/php-setup | |
| with: | |
| cache-key: ${{ runner.os }}-phpstan-php8.3-composer-${{ hashFiles('composer.lock') }} | |
| cache-restore-keys: ${{ runner.os }}-phpstan-php8.3-composer- | |
| - name: Install dependencies | |
| run: composer install --no-ansi --no-interaction --no-progress --prefer-dist | |
| - name: Run PHPStan | |
| run: composer phpstan -- --no-progress | |
| dependency-compatibility: | |
| name: PHP ${{ matrix.php }} / ${{ matrix.dependencies }} runtime dependencies | |
| runs-on: ubuntu-latest | |
| needs: composer | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| php: | |
| - "7.4" | |
| - "8.0" | |
| - "8.1" | |
| - "8.2" | |
| - "8.3" | |
| - "8.4" | |
| dependencies: | |
| - highest | |
| include: | |
| - php: "7.4" | |
| dependencies: lowest | |
| - php: "8.3" | |
| dependencies: locked | |
| - php: "8.4" | |
| dependencies: locked | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| - name: Setup PHP with Composer cache | |
| uses: ./.github/actions/php-setup | |
| with: | |
| php-version: ${{ matrix.php }} | |
| cache-key: ${{ runner.os }}-dependencies-php${{ matrix.php }}-${{ matrix.dependencies }}-${{ hashFiles('composer.json', 'composer.lock') }} | |
| cache-restore-keys: | | |
| ${{ runner.os }}-dependencies-php${{ matrix.php }}-${{ matrix.dependencies }}- | |
| ${{ runner.os }}-dependencies-php${{ matrix.php }}- | |
| - name: Prepare runtime-only Composer manifest | |
| run: jq 'del(."require-dev", ."autoload-dev", .scripts)' composer.json > composer.runtime.json | |
| - name: Install locked dependencies | |
| if: matrix.dependencies == 'locked' | |
| run: composer install --no-dev --no-ansi --no-interaction --no-progress --prefer-dist | |
| - name: Install highest dependencies | |
| if: matrix.dependencies == 'highest' | |
| run: COMPOSER=composer.runtime.json composer update --no-dev --no-ansi --no-interaction --no-progress --prefer-dist | |
| - name: Install lowest dependencies | |
| if: matrix.dependencies == 'lowest' | |
| run: COMPOSER=composer.runtime.json composer update --no-dev --prefer-lowest --prefer-stable --no-ansi --no-interaction --no-progress --prefer-dist | |
| - name: Validate Composer platform compatibility | |
| run: composer check-platform-reqs --no-dev | |
| - name: Lint PHP source | |
| run: find src -name '*.php' -print0 | xargs -0 -n 1 -P 4 php -l |