@@ -67,14 +67,15 @@ jobs:
6767 sudo apt-get install -y python3-pip
6868
6969 # Use --break-system-packages on newer Ubuntu versions (24.04)
70- # The package is documented as candig-katsu in some places, but let's try both or the correct one.
71- if pip install --break-system-packages candig-katsu; then
72- echo "candig-katsu installed successfully"
70+ # Reverting to 'katsu' as 'candig-katsu' was not found on PyPI.
71+ # We add || true to allow the step to continue so the summary calculation can run.
72+ if pip install --break-system-packages katsu; then
73+ echo "katsu installed successfully"
7374 echo "install_status=success" >> $GITHUB_OUTPUT
7475 else
75- echo "candig- katsu installation failed"
76+ echo "katsu installation failed"
7677 echo "install_status=failed" >> $GITHUB_OUTPUT
77- exit 1
78+ # We do NOT exit 1 here to allow the summary step to run and report the failure properly
7879 fi
7980
8081 # ============================================================
8384 - name : Get Katsu version
8485 id : version
8586 run : |
86- VERSION=$(pip show candig- katsu | grep Version | awk '{print $2}' || echo "unknown")
87+ VERSION=$(pip show katsu | grep Version | awk '{print $2}' || echo "unknown")
8788 echo "version=$VERSION" >> $GITHUB_OUTPUT
8889 echo "Detected Katsu version: $VERSION"
8990
@@ -93,11 +94,11 @@ jobs:
9394 run : |
9495 START_TIME=$(date +%s)
9596
96- if pip show candig- katsu &> /dev/null; then
97- echo "✓ candig- katsu package found"
97+ if pip show katsu &> /dev/null; then
98+ echo "✓ katsu package found"
9899 echo "status=passed" >> $GITHUB_OUTPUT
99100 else
100- echo "✗ candig- katsu package not found"
101+ echo "✗ katsu package not found"
101102 echo "status=failed" >> $GITHUB_OUTPUT
102103 exit 1
103104 fi
@@ -195,62 +196,77 @@ jobs:
195196 if : always()
196197 id : summary
197198 run : |
199+ set +e # Disable exit on error for this step
198200 PASSED=0
199201 FAILED=0
200202 TOTAL_DURATION=0
203+
204+ # Helper function to add duration safely
205+ add_duration() {
206+ local val=$1
207+ if [[ "$val" =~ ^[0-9]+$ ]]; then
208+ TOTAL_DURATION=$((TOTAL_DURATION + val))
209+ fi
210+ }
201211
202- # Check katsu binary exists
212+ # Iterate through possible steps to check status
213+ # We check explicit passed status, everything else is failure if not skipped (but simplification: if not passed, and supposed to run, it failed)
214+
215+ # Check Test 1
203216 if [ "${{ steps.test1.outputs.status }}" == "passed" ]; then
204217 PASSED=$((PASSED + 1))
205- else
206- FAILED=$((FAILED + 1))
218+ elif [ "${{ steps.test1.conclusion }}" == "failure" ] || [ "${{ steps.test1.outcome }}" == "failure" ]; then
219+ FAILED=$((FAILED + 1))
207220 fi
208- TOTAL_DURATION=$((TOTAL_DURATION + ${{ steps.test1.outputs.duration || 0 }}))
221+ add_duration " ${{ steps.test1.outputs.duration }}"
209222
210- # Check katsu version command
223+ # Check Test 2
211224 if [ "${{ steps.test2.outputs.status }}" == "passed" ]; then
212225 PASSED=$((PASSED + 1))
213- else
214- FAILED=$((FAILED + 1))
226+ elif [ "${{ steps.test2.conclusion }}" == "failure" ] || [ "${{ steps.test2.outcome }}" == "failure" ]; then
227+ FAILED=$((FAILED + 1))
215228 fi
216- TOTAL_DURATION=$((TOTAL_DURATION + ${{ steps.test2.outputs.duration || 0 }}))
229+ add_duration " ${{ steps.test2.outputs.duration }}"
217230
218- # Check katsu help output
231+ # Check Test 3
219232 if [ "${{ steps.test3.outputs.status }}" == "passed" ]; then
220233 PASSED=$((PASSED + 1))
221- else
222- FAILED=$((FAILED + 1))
234+ elif [ "${{ steps.test3.conclusion }}" == "failure" ] || [ "${{ steps.test3.outcome }}" == "failure" ]; then
235+ FAILED=$((FAILED + 1))
223236 fi
224- TOTAL_DURATION=$((TOTAL_DURATION + ${{ steps.test3.outputs.duration || 0 }}))
237+ add_duration " ${{ steps.test3.outputs.duration }}"
225238
226- # Architecture Verification
239+ # Check Test 4 - Architecture
227240 if [ "${{ steps.test4.outputs.status }}" == "passed" ]; then
228241 PASSED=$((PASSED + 1))
229- else
230- FAILED=$((FAILED + 1))
242+ elif [ "${{ steps.test4.conclusion }}" == "failure" ] || [ "${{ steps.test4.outcome }}" == "failure" ]; then
243+ FAILED=$((FAILED + 1))
231244 fi
232- TOTAL_DURATION=$((TOTAL_DURATION + ${{ steps.test4.outputs.duration || 0 }}))
245+ add_duration " ${{ steps.test4.outputs.duration }}"
233246
234- # Functional Validation
247+ # Check Test 5 - Functional
235248 if [ "${{ steps.test5.outputs.status }}" == "passed" ]; then
236249 PASSED=$((PASSED + 1))
237- else
238- FAILED=$((FAILED + 1))
250+ elif [ "${{ steps.test5.conclusion }}" == "failure" ] || [ "${{ steps.test5.outcome }}" == "failure" ]; then
251+ FAILED=$((FAILED + 1))
239252 fi
240- TOTAL_DURATION=$((TOTAL_DURATION + ${{ steps.test5.outputs.duration || 0 }}))
253+ add_duration " ${{ steps.test5.outputs.duration }}"
241254
242255 echo "passed=$PASSED" >> $GITHUB_OUTPUT
243256 echo "failed=$FAILED" >> $GITHUB_OUTPUT
244257 echo "duration=$TOTAL_DURATION" >> $GITHUB_OUTPUT
245-
246- if [ $FAILED -eq 0 ]; then
258+
259+ # Determine overall status
260+ if [ $FAILED -eq 0 ] && [ $PASSED -gt 0 ]; then
247261 echo "overall_status=success" >> $GITHUB_OUTPUT
248262 echo "badge_status=passing" >> $GITHUB_OUTPUT
249263 else
250264 echo "overall_status=failure" >> $GITHUB_OUTPUT
251265 echo "badge_status=failing" >> $GITHUB_OUTPUT
266+ # Only exit 1 if we want to fail the job when tests fail
252267 exit 1
253268 fi
269+
254270 - name : Generate test results JSON
255271 if : always()
256272 run : |
0 commit comments