Skip to content

Commit 0016636

Browse files
committed
ci: fix workflows — use kcode.phar from official GitHub release
All 3 workflows now download kcode via: wget -q https://github.com/KaririCode-Framework/kariricode-devkit/releases/latest/download/kcode.phar chmod +x kcode.phar && sudo mv kcode.phar /usr/local/bin/kcode Changes: ci.yml — kcode init + kcode quality (validated locally: 4/4 passed) code-quality.yml — kcode analyse (phpstan + psalm in sequence, no --tool flag) release.yml — kcode quality gate before GitHub Release creation Tested locally: ✓ cs-fixer passed (0.26s) ✓ phpstan passed (3.10s) ✓ psalm passed (4.61s) ✓ phpunit passed (1.30s)
1 parent 5232502 commit 0016636

3 files changed

Lines changed: 63 additions & 57 deletions

File tree

.github/workflows/ci.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,16 @@ jobs:
2121
coverage: pcov
2222

2323
- name: Install dependencies
24-
run: composer install --no-interaction --prefer-dist --optimize-autoloader
24+
run: composer install --no-interaction --prefer-dist --no-progress --no-scripts
2525

26-
- name: Initialize kcode devkit
27-
run: vendor/bin/kcode init
28-
29-
- name: Code style check
30-
run: vendor/bin/kcode cs:fix --check
26+
- name: Install kcode
27+
run: |
28+
wget -q https://github.com/KaririCode-Framework/kariricode-devkit/releases/latest/download/kcode.phar
29+
chmod +x kcode.phar
30+
sudo mv kcode.phar /usr/local/bin/kcode
3131
32-
- name: Static analysis (PHPStan + Psalm)
33-
run: vendor/bin/kcode analyse
32+
- name: Initialize kcode devkit
33+
run: kcode init
3434

35-
- name: Tests with coverage
36-
run: vendor/bin/kcode test --coverage
35+
- name: Run full quality pipeline
36+
run: kcode quality

.github/workflows/code-quality.yml

Lines changed: 37 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@ on:
1212
- develop
1313
workflow_dispatch:
1414

15+
# Reusable step to install kcode from the official PHAR release
16+
# Usage in each job:
17+
# - name: Install kcode
18+
# run: |
19+
# wget -q https://github.com/KaririCode-Framework/kariricode-devkit/releases/latest/download/kcode.phar
20+
# chmod +x kcode.phar && sudo mv kcode.phar /usr/local/bin/kcode
21+
1522
jobs:
1623
# ============================================================================
1724
# DEPENDENCY VALIDATION
@@ -61,10 +68,10 @@ jobs:
6168
run: composer audit --format=plain
6269

6370
# ============================================================================
64-
# STATIC ANALYSIS — PHPStan (via kcode)
71+
# STATIC ANALYSIS — PHPStan + Psalm via kcode analyse
6572
# ============================================================================
66-
phpstan:
67-
name: PHPStan Static Analysis
73+
analyse:
74+
name: Static Analysis (PHPStan + Psalm)
6875
runs-on: ubuntu-latest
6976

7077
steps:
@@ -80,37 +87,17 @@ jobs:
8087
- name: Install dependencies
8188
run: composer install --prefer-dist --no-progress --no-scripts
8289

83-
- name: Initialize kcode devkit
84-
run: vendor/bin/kcode init
85-
86-
- name: Run PHPStan via kcode
87-
run: vendor/bin/kcode analyse --tool=phpstan
88-
89-
# ============================================================================
90-
# STATIC ANALYSIS — Psalm (via kcode)
91-
# ============================================================================
92-
psalm:
93-
name: Psalm Static Analysis
94-
runs-on: ubuntu-latest
95-
96-
steps:
97-
- uses: actions/checkout@v4
98-
99-
- uses: shivammathur/setup-php@v2
100-
with:
101-
php-version: '8.4'
102-
extensions: mbstring, xml, openssl
103-
coverage: none
104-
tools: composer:v2
105-
106-
- name: Install dependencies
107-
run: composer install --prefer-dist --no-progress --no-scripts
90+
- name: Install kcode
91+
run: |
92+
wget -q https://github.com/KaririCode-Framework/kariricode-devkit/releases/latest/download/kcode.phar
93+
chmod +x kcode.phar
94+
sudo mv kcode.phar /usr/local/bin/kcode
10895
10996
- name: Initialize kcode devkit
110-
run: vendor/bin/kcode init
97+
run: kcode init
11198

112-
- name: Run Psalm via kcode
113-
run: vendor/bin/kcode analyse --tool=psalm
99+
- name: Run PHPStan + Psalm via kcode
100+
run: kcode analyse
114101

115102
# ============================================================================
116103
# CODE STYLE (PHP CS Fixer via kcode)
@@ -132,11 +119,17 @@ jobs:
132119
- name: Install dependencies
133120
run: composer install --prefer-dist --no-progress --no-scripts
134121

122+
- name: Install kcode
123+
run: |
124+
wget -q https://github.com/KaririCode-Framework/kariricode-devkit/releases/latest/download/kcode.phar
125+
chmod +x kcode.phar
126+
sudo mv kcode.phar /usr/local/bin/kcode
127+
135128
- name: Initialize kcode devkit
136-
run: vendor/bin/kcode init
129+
run: kcode init
137130

138131
- name: Check code style via kcode
139-
run: vendor/bin/kcode cs:fix --check
132+
run: kcode cs:fix --check
140133

141134
# ============================================================================
142135
# TESTS WITH COVERAGE
@@ -158,19 +151,25 @@ jobs:
158151
- name: Install dependencies
159152
run: composer install --prefer-dist --no-progress --no-scripts
160153

154+
- name: Install kcode
155+
run: |
156+
wget -q https://github.com/KaririCode-Framework/kariricode-devkit/releases/latest/download/kcode.phar
157+
chmod +x kcode.phar
158+
sudo mv kcode.phar /usr/local/bin/kcode
159+
161160
- name: Initialize kcode devkit
162-
run: vendor/bin/kcode init
161+
run: kcode init
163162

164163
- name: Run tests with coverage
165-
run: vendor/bin/kcode test --coverage
164+
run: kcode test --coverage
166165

167166
# ============================================================================
168167
# QUALITY SUMMARY
169168
# ============================================================================
170169
quality-summary:
171170
name: Quality Summary
172171
runs-on: ubuntu-latest
173-
needs: [dependencies, security, phpstan, psalm, cs-fixer, tests]
172+
needs: [dependencies, security, analyse, cs-fixer, tests]
174173
if: always()
175174

176175
steps:
@@ -182,14 +181,12 @@ jobs:
182181
echo "|-------|--------|" >> "$GITHUB_STEP_SUMMARY"
183182
echo "| Dependencies | ${{ needs.dependencies.result }} |" >> "$GITHUB_STEP_SUMMARY"
184183
echo "| Security | ${{ needs.security.result }} |" >> "$GITHUB_STEP_SUMMARY"
185-
echo "| PHPStan | ${{ needs.phpstan.result }} |" >> "$GITHUB_STEP_SUMMARY"
186-
echo "| Psalm | ${{ needs.psalm.result }} |" >> "$GITHUB_STEP_SUMMARY"
184+
echo "| Static Analysis | ${{ needs.analyse.result }} |" >> "$GITHUB_STEP_SUMMARY"
187185
echo "| CS Fixer | ${{ needs.cs-fixer.result }} |" >> "$GITHUB_STEP_SUMMARY"
188186
echo "| Tests | ${{ needs.tests.result }} |" >> "$GITHUB_STEP_SUMMARY"
189187
190188
if [ "${{ needs.security.result }}" != "success" ] || \
191-
[ "${{ needs.phpstan.result }}" != "success" ] || \
192-
[ "${{ needs.psalm.result }}" != "success" ] || \
189+
[ "${{ needs.analyse.result }}" != "success" ] || \
193190
[ "${{ needs.cs-fixer.result }}" != "success" ] || \
194191
[ "${{ needs.tests.result }}" != "success" ]; then
195192
echo "" >> "$GITHUB_STEP_SUMMARY"

.github/workflows/release.yml

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,19 @@ jobs:
2424
tools: composer:v2
2525

2626
- name: Install dependencies
27-
run: composer install --no-interaction --prefer-dist --optimize-autoloader
27+
run: composer install --no-interaction --prefer-dist --no-progress --no-scripts
28+
29+
- name: Install kcode
30+
run: |
31+
wget -q https://github.com/KaririCode-Framework/kariricode-devkit/releases/latest/download/kcode.phar
32+
chmod +x kcode.phar
33+
sudo mv kcode.phar /usr/local/bin/kcode
2834
2935
- name: Initialize kcode devkit
30-
run: vendor/bin/kcode init
36+
run: kcode init
3137

32-
- name: Run full quality pipeline
33-
run: vendor/bin/kcode quality
38+
- name: Run full quality pipeline (gate before release)
39+
run: kcode quality
3440

3541
- name: Extract version from tag
3642
id: version
@@ -44,11 +50,11 @@ jobs:
4450
draft: false
4551
prerelease: false
4652
body: |
47-
## KaririCode\\Dotenv ${{ steps.version.outputs.tag }}
53+
## KaririCode\Dotenv ${{ steps.version.outputs.tag }}
4854
4955
The only PHP dotenv with auto type casting, AES-256-GCM encryption,
50-
OPcache caching, fluent validation DSL, environment-aware loading,
51-
and CLI tooling — zero dependencies, PHP 8.4+, ARFA 1.3.
56+
OPcache caching, fluent validation DSL, environment-aware loading — zero
57+
dependencies, PHP 8.4+, ARFA 1.3.
5258
5359
## Installation
5460
@@ -75,6 +81,9 @@ jobs:
7581
->isInteger('DB_PORT')->between(1, 65535)
7682
->allowedValues('APP_ENV', ['local', 'staging', 'production'])
7783
->assert();
84+
85+
// bootEnv() cascade: .env → .env.local → .env.{env}
86+
$dotenv->bootEnv();
7887
```
7988
8089
See [CHANGELOG.md](CHANGELOG.md) for details.

0 commit comments

Comments
 (0)