From 97d59690b2cb3da3b28235441c7a31b9d9708ba4 Mon Sep 17 00:00:00 2001 From: Nikita Elfimov Date: Sat, 24 Jan 2026 09:11:43 +0300 Subject: [PATCH 1/2] fix(php): working directory --- .github/actions/php/prepare/action.yaml | 10 +- .github/workflows/reusable-php-checks-v2.yaml | 190 +++++++++--------- 2 files changed, 96 insertions(+), 104 deletions(-) diff --git a/.github/actions/php/prepare/action.yaml b/.github/actions/php/prepare/action.yaml index 68477611..c70e4a34 100644 --- a/.github/actions/php/prepare/action.yaml +++ b/.github/actions/php/prepare/action.yaml @@ -10,13 +10,10 @@ inputs: description: 'PHP Extensions' required: false default: 'apcu, amqp, protobuf, intl, gmp, sockets, zip, opcache, pdo_pgsql' - work-directory: - description: 'Working Directory' - required: false - default: 'packages/core-v2' runs: using: composite + steps: - name: Setup PHP ${{ inputs.php }} uses: shivammathur/setup-php@v2 @@ -25,12 +22,10 @@ runs: php-version: ${{ inputs.php }} - name: Validate Composer - working-directory: ${{ inputs.work-directory }} shell: bash run: composer validate - name: Get Composer Cache Directory - working-directory: ${{ inputs.work-directory }} shell: bash id: composer-cache run: | @@ -40,7 +35,7 @@ runs: uses: actions/cache@v5 with: path: ${{ steps.composer-cache.outputs.dir }} - key: core-v2-composer-${{ hashFiles(format('{0}/composer.lock', inputs.work-directory)) }} + key: core-v2-composer-${{ hashFiles(format('{0}/composer.lock')) }} restore-keys: | ${{ runner.os }}-core-v2-composer- @@ -50,5 +45,4 @@ runs: timeout_minutes: 5 max_attempts: 3 command: | - cd ${{ inputs.work-directory }} composer install --prefer-dist --no-interaction --no-progress diff --git a/.github/workflows/reusable-php-checks-v2.yaml b/.github/workflows/reusable-php-checks-v2.yaml index f153b691..18cb13d8 100644 --- a/.github/workflows/reusable-php-checks-v2.yaml +++ b/.github/workflows/reusable-php-checks-v2.yaml @@ -32,104 +32,102 @@ jobs: - uses: rees46/workflow/.github/actions/php/prepare@master - name: Composer Audit - working-directory: ${{ inputs.working-directory }} run: composer audit - name: Security Advisories - working-directory: ${{ inputs.working-directory }} run: composer require --dev roave/security-advisories:dev-latest - phpstan: - name: Linter - runs-on: ubuntu-latest - defaults: - run: - shell: bash - working-directory: ${{ inputs.working-directory }} - steps: - - uses: actions/checkout@v5 - - - name: Set Git To Use LF - shell: bash - run: | - git config --global core.autocrlf false - git config --global core.eol lf - - - uses: rees46/workflow/.github/actions/php/prepare@master - - - name: Static Analysis - working-directory: ${{ inputs.working-directory }} - run: composer linter:check -- --error-format=github --ansi - - php-cs-fixer: - name: Code Style - runs-on: ubuntu-latest - defaults: - run: - shell: bash - working-directory: ${{ inputs.working-directory }} - steps: - - uses: actions/checkout@v5 - - - name: Set Git To Use LF - shell: bash - run: | - git config --global core.autocrlf false - git config --global core.eol lf - - - uses: rees46/workflow/.github/actions/php/prepare@master - - - name: Check Code Style - working-directory: ${{ inputs.working-directory }} - run: composer phpcs:check - - tests: - name: Tests - runs-on: ubuntu-latest - defaults: - run: - shell: bash - working-directory: ${{ inputs.working-directory }} - services: - rabbit: - image: rabbitmq:management-alpine - env: - RABBITMQ_DEFAULT_USER: guest - RABBITMQ_DEFAULT_PASS: guest - ports: - - 5672:5672 - - postgres: - image: ghcr.io/rees46/postgres-migrated:latest - ports: - - 5432:5432 - credentials: - password: ${{ secrets.GITHUB_TOKEN }} - username: ${{ github.repository_owner }} - - steps: - - uses: actions/checkout@v5 - - - name: Set Git To Use LF - shell: bash - run: | - git config --global core.autocrlf false - git config --global core.eol lf - - - uses: rees46/workflow/.github/actions/php/prepare@master - - - name: Symfony Container Tests - working-directory: ${{ inputs.working-directory }} - run: composer test:container - - - name: Unit Tests - working-directory: ${{ inputs.working-directory }} - run: composer test:unit - - - name: Integration Tests - working-directory: ${{ inputs.working-directory }} - run: composer test:integration - - - name: Functional Tests - working-directory: ${{ inputs.working-directory }} - run: composer test:feature + # phpstan: + # name: Linter + # runs-on: ubuntu-latest + # defaults: + # run: + # shell: bash + # working-directory: ${{ inputs.working-directory }} + # steps: + # - uses: actions/checkout@v5 + # + # - name: Set Git To Use LF + # shell: bash + # run: | + # git config --global core.autocrlf false + # git config --global core.eol lf + # + # - uses: rees46/workflow/.github/actions/php/prepare@master + # + # - name: Static Analysis + # working-directory: ${{ inputs.working-directory }} + # run: composer linter:check -- --error-format=github --ansi + # + # php-cs-fixer: + # name: Code Style + # runs-on: ubuntu-latest + # defaults: + # run: + # shell: bash + # working-directory: ${{ inputs.working-directory }} + # steps: + # - uses: actions/checkout@v5 + # + # - name: Set Git To Use LF + # shell: bash + # run: | + # git config --global core.autocrlf false + # git config --global core.eol lf + # + # - uses: rees46/workflow/.github/actions/php/prepare@master + # + # - name: Check Code Style + # working-directory: ${{ inputs.working-directory }} + # run: composer phpcs:check + # + # tests: + # name: Tests + # runs-on: ubuntu-latest + # defaults: + # run: + # shell: bash + # working-directory: ${{ inputs.working-directory }} + # services: + # rabbit: + # image: rabbitmq:management-alpine + # env: + # RABBITMQ_DEFAULT_USER: guest + # RABBITMQ_DEFAULT_PASS: guest + # ports: + # - 5672:5672 + # + # postgres: + # image: ghcr.io/rees46/postgres-migrated:latest + # ports: + # - 5432:5432 + # credentials: + # password: ${{ secrets.GITHUB_TOKEN }} + # username: ${{ github.repository_owner }} + # + # steps: + # - uses: actions/checkout@v5 + # + # - name: Set Git To Use LF + # shell: bash + # run: | + # git config --global core.autocrlf false + # git config --global core.eol lf + # + # - uses: rees46/workflow/.github/actions/php/prepare@master + # + # - name: Symfony Container Tests + # working-directory: ${{ inputs.working-directory }} + # run: composer test:container + # + # - name: Unit Tests + # working-directory: ${{ inputs.working-directory }} + # run: composer test:unit + # + # - name: Integration Tests + # working-directory: ${{ inputs.working-directory }} + # run: composer test:integration + # + # - name: Functional Tests + # working-directory: ${{ inputs.working-directory }} + # run: composer test:feature From d707c2e7080116683908173c3862391664a4c649 Mon Sep 17 00:00:00 2001 From: Nikita Elfimov Date: Sat, 24 Jan 2026 09:15:47 +0300 Subject: [PATCH 2/2] fix(php): working directory --- .github/actions/php/prepare/action.yaml | 4 +- .github/workflows/reusable-php-checks-v2.yaml | 182 +++++++++--------- 2 files changed, 90 insertions(+), 96 deletions(-) diff --git a/.github/actions/php/prepare/action.yaml b/.github/actions/php/prepare/action.yaml index c70e4a34..238267fb 100644 --- a/.github/actions/php/prepare/action.yaml +++ b/.github/actions/php/prepare/action.yaml @@ -35,9 +35,9 @@ runs: uses: actions/cache@v5 with: path: ${{ steps.composer-cache.outputs.dir }} - key: core-v2-composer-${{ hashFiles(format('{0}/composer.lock')) }} + key: core-v2-composer-${{ hashFiles('composer.lock')) }} restore-keys: | - ${{ runner.os }}-core-v2-composer- + core-v2-composer- - name: Install Dependencies uses: nick-invision/retry@v2 diff --git a/.github/workflows/reusable-php-checks-v2.yaml b/.github/workflows/reusable-php-checks-v2.yaml index 18cb13d8..406ed63c 100644 --- a/.github/workflows/reusable-php-checks-v2.yaml +++ b/.github/workflows/reusable-php-checks-v2.yaml @@ -37,97 +37,91 @@ jobs: - name: Security Advisories run: composer require --dev roave/security-advisories:dev-latest - # phpstan: - # name: Linter - # runs-on: ubuntu-latest - # defaults: - # run: - # shell: bash - # working-directory: ${{ inputs.working-directory }} - # steps: - # - uses: actions/checkout@v5 - # - # - name: Set Git To Use LF - # shell: bash - # run: | - # git config --global core.autocrlf false - # git config --global core.eol lf - # - # - uses: rees46/workflow/.github/actions/php/prepare@master - # - # - name: Static Analysis - # working-directory: ${{ inputs.working-directory }} - # run: composer linter:check -- --error-format=github --ansi - # - # php-cs-fixer: - # name: Code Style - # runs-on: ubuntu-latest - # defaults: - # run: - # shell: bash - # working-directory: ${{ inputs.working-directory }} - # steps: - # - uses: actions/checkout@v5 - # - # - name: Set Git To Use LF - # shell: bash - # run: | - # git config --global core.autocrlf false - # git config --global core.eol lf - # - # - uses: rees46/workflow/.github/actions/php/prepare@master - # - # - name: Check Code Style - # working-directory: ${{ inputs.working-directory }} - # run: composer phpcs:check - # - # tests: - # name: Tests - # runs-on: ubuntu-latest - # defaults: - # run: - # shell: bash - # working-directory: ${{ inputs.working-directory }} - # services: - # rabbit: - # image: rabbitmq:management-alpine - # env: - # RABBITMQ_DEFAULT_USER: guest - # RABBITMQ_DEFAULT_PASS: guest - # ports: - # - 5672:5672 - # - # postgres: - # image: ghcr.io/rees46/postgres-migrated:latest - # ports: - # - 5432:5432 - # credentials: - # password: ${{ secrets.GITHUB_TOKEN }} - # username: ${{ github.repository_owner }} - # - # steps: - # - uses: actions/checkout@v5 - # - # - name: Set Git To Use LF - # shell: bash - # run: | - # git config --global core.autocrlf false - # git config --global core.eol lf - # - # - uses: rees46/workflow/.github/actions/php/prepare@master - # - # - name: Symfony Container Tests - # working-directory: ${{ inputs.working-directory }} - # run: composer test:container - # - # - name: Unit Tests - # working-directory: ${{ inputs.working-directory }} - # run: composer test:unit - # - # - name: Integration Tests - # working-directory: ${{ inputs.working-directory }} - # run: composer test:integration - # - # - name: Functional Tests - # working-directory: ${{ inputs.working-directory }} - # run: composer test:feature + phpstan: + name: Linter + runs-on: ubuntu-latest + defaults: + run: + shell: bash + working-directory: ${{ inputs.working-directory }} + steps: + - uses: actions/checkout@v5 + + - name: Set Git To Use LF + shell: bash + run: | + git config --global core.autocrlf false + git config --global core.eol lf + + - uses: rees46/workflow/.github/actions/php/prepare@master + + - name: Static Analysis + run: composer linter:check -- --error-format=github --ansi + + php-cs-fixer: + name: Code Style + runs-on: ubuntu-latest + defaults: + run: + shell: bash + working-directory: ${{ inputs.working-directory }} + steps: + - uses: actions/checkout@v5 + + - name: Set Git To Use LF + shell: bash + run: | + git config --global core.autocrlf false + git config --global core.eol lf + + - uses: rees46/workflow/.github/actions/php/prepare@master + + - name: Check Code Style + run: composer phpcs:check + + tests: + name: Tests + runs-on: ubuntu-latest + defaults: + run: + shell: bash + working-directory: ${{ inputs.working-directory }} + services: + rabbit: + image: rabbitmq:management-alpine + env: + RABBITMQ_DEFAULT_USER: guest + RABBITMQ_DEFAULT_PASS: guest + ports: + - 5672:5672 + + postgres: + image: ghcr.io/rees46/postgres-migrated:latest + ports: + - 5432:5432 + credentials: + password: ${{ secrets.GITHUB_TOKEN }} + username: ${{ github.repository_owner }} + + steps: + - uses: actions/checkout@v5 + + - name: Set Git To Use LF + shell: bash + run: | + git config --global core.autocrlf false + git config --global core.eol lf + + - uses: rees46/workflow/.github/actions/php/prepare@master + + - name: Symfony Container Tests + run: composer test:container + + - name: Unit Tests + run: composer test:unit + + - name: Integration Tests + run: composer test:integration + + - name: Functional Tests + run: composer test:feature