Skip to content

Commit 6746bef

Browse files
author
Houdi
committed
chore(ci): emit test failure tail in workflow
1 parent c6e7e4e commit 6746bef

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

.github/workflows/ci.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,13 @@ jobs:
2626
cache: "npm"
2727
- run: npm ci
2828
- run: npm run build
29-
- run: npm run test
29+
- name: Run tests (with debug tail on failure)
30+
run: |
31+
set -o pipefail
32+
node --test dist/**/*.test.js > ci-test.log 2>&1 || {
33+
echo "---- tail(ci-test.log) ----"
34+
tail -n 200 ci-test.log || true
35+
details=$(tail -n 60 ci-test.log | sed -e 's/%/%25/g' -e 's/\r/%0D/g' -e ':a;N;$!ba;s/\n/%0A/g')
36+
echo "::error title=Node test failed::$details"
37+
exit 1
38+
}

0 commit comments

Comments
 (0)