Skip to content

Commit 8a60e5b

Browse files
alanhcclaude
andcommitted
CI: surface the exact test command per suite
- google_dsa Makefile echoes each suite's command ($ ./bin, $ (cd dir && uv run python ...)) so expanding a log group shows it. - Workflow echoes the top-level `make -C dir target` per group. - Job summary gains an expandable "本機重現指令" block. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 5469e7c commit 8a60e5b

2 files changed

Lines changed: 20 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,10 @@ jobs:
4949
else target=build; fi
5050
echo "::group::$dir ($target)"
5151
if [ "$target" = build ]; then
52+
echo "$ make -C $dir"
5253
out=$(make -C "$dir" 2>&1); rc=$?
5354
else
55+
echo "$ make -C $dir $target"
5456
out=$(make -C "$dir" "$target" 2>&1); rc=$?
5557
fi
5658
echo "$out"
@@ -87,6 +89,22 @@ jobs:
8789
else
8890
echo "**Total: $total_tests tests across $total_suites suites — ❌ failures above**"
8991
fi
92+
echo ""
93+
echo "<details><summary>▶ 本機重現指令</summary>"
94+
echo ""
95+
echo '```bash'
96+
echo "make -C 1_Array_String test # two pointers C++"
97+
echo "make -C dsa/linked_list run # linked list demo (smoke)"
98+
echo "make -C google_dsa test # 全部 24 套件 (C++ + Python)"
99+
echo "make -C google_dsa test-cpp # 只 C++"
100+
echo "make -C google_dsa test-py # 只 Python"
101+
echo "# 單一套件範例:"
102+
echo "g++ -std=c++17 -Wall -Wextra -o google_dsa/09_heap/k_largest google_dsa/09_heap/k_largest.cpp && ./google_dsa/09_heap/k_largest"
103+
echo "( cd google_dsa/09_heap && uv run python test_k_largest.py )"
104+
echo '```'
105+
echo ""
106+
echo "> 展開任一 job step 的 log group(依資料夾折疊),每個套件上方的 \`\$ …\` 就是實際執行的指令。"
107+
echo "</details>"
90108
} >> "$summary"
91109
if [ "$found" -eq 0 ]; then echo "No Makefile found" >&2; exit 1; fi
92110
exit $overall

google_dsa/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ test: test-cpp test-py
1919
test-cpp: $(CPP_BINS)
2020
@for bin in $(CPP_BINS); do \
2121
echo "=== [C++] $$bin ==="; \
22+
echo "$$ ./$$bin"; \
2223
./$$bin || exit 1; \
2324
done
2425

@@ -29,6 +30,7 @@ test-cpp: $(CPP_BINS)
2930
test-py:
3031
@for t in $(PY_TESTS); do \
3132
echo "=== [Py] $$t ==="; \
33+
echo "$$ ( cd $$(dirname $$t) && uv run python $$(basename $$t) )"; \
3234
( cd $$(dirname $$t) && uv run python $$(basename $$t) ) || exit 1; \
3335
done
3436

0 commit comments

Comments
 (0)