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+
1522jobs :
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"
0 commit comments