Merge branch 'master' of github.com:eonx-com/easy-monorepo into featu… #4248
Workflow file for this run
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-CI | |
on: [push, pull_request] | |
env: | |
TERM: xterm-256color | |
jobs: | |
coding_standards: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
php: ['8.2'] | |
dependencies: ['latest', 'lowest'] | |
actions: | |
- {name: composer, run: make check-composer} | |
- {name: monorepo, run: make check-monorepo} | |
- {name: security, run: make check-security} | |
- {name: packages-architecture, run: make check-packages-architecture} | |
- {name: ecs, run: make check-ecs, cache: ecs} | |
- {name: rector, run: make check-rector, cache: rector} | |
- {name: phpstan, run: make check-phpstan, cache: phpstan} | |
name: ${{ matrix.actions.name }} (${{ matrix.php }}${{ matrix.dependencies == 'lowest' && ' - lowest dependencies' || '' }}) | |
env: | |
EONX_EASY_QUALITY_JOB_SIZE: 20 | |
EONX_EASY_QUALITY_MAX_NUMBER_OF_PROCESS: 32 | |
EONX_EASY_QUALITY_TIMEOUT_SECONDS: 120 | |
PHP_EXTENSIONS: pdo_sqlite, openswoole, pkcs11 | |
PHP_EXTENSIONS_CACHE_KEY: cache-extensions-pdo_sqlite-openswoole-pkcs11 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup cache environment | |
id: cache-extensions | |
uses: shivammathur/cache-extensions@v1 | |
with: | |
php-version: ${{ matrix.php }} | |
extensions: ${{ env.PHP_EXTENSIONS }} | |
key: ${{ env.PHP_EXTENSIONS_CACHE_KEY }} | |
- name: Cache extensions | |
uses: actions/cache@v4 | |
with: | |
path: ${{ steps.cache-extensions.outputs.dir }} | |
key: ${{ steps.cache-extensions.outputs.key }} | |
# TODO: Change the version of the action after 2.33 is released | |
- name: Setup PHP ${{ matrix.php }} | |
uses: shivammathur/setup-php@297b3cde3c3c3202e03cd5e9b679a74c06f72214 | |
with: | |
php-version: ${{ matrix.php }} | |
coverage: ${{ matrix.actions.coverage || 'none' }} | |
extensions: ${{ env.PHP_EXTENSIONS }} | |
- name: Install Composer dependencies | |
uses: ramsey/composer-install@v3 | |
with: | |
composer-options: ${{ matrix.dependencies == 'lowest' && '--prefer-lowest' || '' }} | |
- name: Install Composer dependencies for Quality Tools | |
uses: ramsey/composer-install@v3 | |
with: | |
working-directory: quality | |
- if: matrix.actions.cache | |
id: cache-quality-tools | |
uses: actions/cache@v4 | |
with: | |
path: quality/var/cache/${{ matrix.actions.cache }} | |
key: ${{ runner.os }}-${{ matrix.php }}-${{ matrix.dependencies }}-quality-${{ matrix.actions.name }}-${{ github.sha }} | |
restore-keys: ${{ runner.os }}-${{ matrix.php }}-${{ matrix.dependencies }}-quality-${{ matrix.actions.name }}- | |
- if: matrix.actions.cache && steps.cache-quality-tools.outputs.cache-hit == false | |
run: mkdir -p ${{ matrix.actions.cache }} | |
- name: '[CI] Check ${{ matrix.actions.name }} [CI]' | |
run: ${{ matrix.actions.run }} | |
shell: bash |