From 0ce6e275d066245e8c857b42c60cfc61a0f67f3a Mon Sep 17 00:00:00 2001 From: Walmir Silva Date: Mon, 2 Mar 2026 10:14:14 -0300 Subject: [PATCH 1/2] ci: use php bin/kcode instead of vendor/bin/kcode Composer bin-linking only creates vendor/bin/ symlinks for packages installed as *dependencies* of a project. Within the devkit repository itself, kariricode/devkit is not its own dependency, so vendor/bin/kcode is never created. Fix: use 'php bin/kcode' directly in all workflow steps. Applies to: ci.yml (quality job) and code-quality.yml (phpstan, cs-fixer jobs). --- .github/workflows/ci.yml | 8 ++++---- .github/workflows/code-quality.yml | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ad36480..1cef5d2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,16 +23,16 @@ jobs: run: composer install --no-interaction --prefer-dist --optimize-autoloader - name: Initialize devkit - run: vendor/bin/kcode init + run: php bin/kcode init - name: Code style check - run: vendor/bin/kcode cs:fix --check + run: php bin/kcode cs:fix --check - name: Static analysis - run: vendor/bin/kcode analyse + run: php bin/kcode analyse - name: Tests - run: vendor/bin/kcode test --coverage + run: php bin/kcode test --coverage build-phar: name: PHAR Build Smoke Test diff --git a/.github/workflows/code-quality.yml b/.github/workflows/code-quality.yml index 8f81298..8fc56d4 100644 --- a/.github/workflows/code-quality.yml +++ b/.github/workflows/code-quality.yml @@ -113,10 +113,10 @@ jobs: run: composer install --prefer-dist --no-progress - name: Initialize devkit config - run: vendor/bin/kcode init + run: php bin/kcode init - name: Run PHPStan via kcode - run: vendor/bin/kcode analyse + run: php bin/kcode analyse # ============================================================================ # CODE STYLE (PHP CS Fixer via kcode) @@ -149,10 +149,10 @@ jobs: run: composer install --prefer-dist --no-progress - name: Initialize devkit config - run: vendor/bin/kcode init + run: php bin/kcode init - name: Check code style via kcode - run: vendor/bin/kcode cs:fix --check + run: php bin/kcode cs:fix --check # ============================================================================ # QUALITY SUMMARY From e119b54503d33fc88168aa91b583cdc9844d5546 Mon Sep 17 00:00:00 2001 From: Walmir Silva Date: Mon, 2 Mar 2026 10:21:13 -0300 Subject: [PATCH 2/2] =?UTF-8?q?ci(code-quality):=20fix=20all=20jobs=20?= =?UTF-8?q?=E2=80=94=20remove=20cache,=20unify=20install=20flags?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Root cause: without composer.lock, hashFiles('**/composer.lock') returns an empty string, so all jobs shared the same cache key 'Linux-composer-'. The security job installed with --no-dev and cached first; subsequent jobs restored that cache and ended up with a vendor/ missing dev packages. Fix: - Remove all Composer cache blocks (no lock file = no stable cache key; cold install on ubuntu-latest takes ~15s, not worth the risk) - Remove --no-dev from security job (composer audit works on installed packages — no need for a separate --no-dev install) - Add --no-scripts to all composer install steps - php bin/kcode in all kcode steps (vendor/bin/kcode is not created when running inside the devkit repo itself) --- .github/workflows/code-quality.yml | 52 +++--------------------------- 1 file changed, 4 insertions(+), 48 deletions(-) diff --git a/.github/workflows/code-quality.yml b/.github/workflows/code-quality.yml index 8fc56d4..1ca5b5d 100644 --- a/.github/workflows/code-quality.yml +++ b/.github/workflows/code-quality.yml @@ -32,17 +32,6 @@ jobs: - name: Validate composer.json run: composer validate --strict --no-check-lock - - name: Get Composer cache directory - id: composer-cache - run: echo "dir=$(composer config cache-files-dir)" >> "$GITHUB_OUTPUT" - - - name: Cache dependencies - uses: actions/cache@v4 - with: - path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} - restore-keys: ${{ runner.os }}-composer- - - name: Install dependencies run: composer install --prefer-dist --no-progress --no-scripts @@ -65,19 +54,8 @@ jobs: tools: composer:v2 coverage: none - - name: Get Composer cache directory - id: composer-cache - run: echo "dir=$(composer config cache-files-dir)" >> "$GITHUB_OUTPUT" - - - name: Cache dependencies - uses: actions/cache@v4 - with: - path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} - restore-keys: ${{ runner.os }}-composer- - - - name: Install dependencies (no-dev for audit) - run: composer install --no-dev --prefer-dist --no-progress + - name: Install dependencies + run: composer install --prefer-dist --no-progress --no-scripts - name: Run composer audit run: composer audit --format=plain @@ -98,19 +76,8 @@ jobs: coverage: none tools: composer:v2 - - name: Get Composer cache directory - id: composer-cache - run: echo "dir=$(composer config cache-files-dir)" >> "$GITHUB_OUTPUT" - - - name: Cache dependencies - uses: actions/cache@v4 - with: - path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} - restore-keys: ${{ runner.os }}-composer- - - name: Install dependencies - run: composer install --prefer-dist --no-progress + run: composer install --prefer-dist --no-progress --no-scripts - name: Initialize devkit config run: php bin/kcode init @@ -134,19 +101,8 @@ jobs: coverage: none tools: composer:v2 - - name: Get Composer cache directory - id: composer-cache - run: echo "dir=$(composer config cache-files-dir)" >> "$GITHUB_OUTPUT" - - - name: Cache dependencies - uses: actions/cache@v4 - with: - path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} - restore-keys: ${{ runner.os }}-composer- - - name: Install dependencies - run: composer install --prefer-dist --no-progress + run: composer install --prefer-dist --no-progress --no-scripts - name: Initialize devkit config run: php bin/kcode init