Skip to content

Commit d3437fd

Browse files
committed
Post PHPUnit output as PR comment on failure for debugging
https://claude.ai/code/session_01F4RsGjVD4jny3Lder5wqbc
1 parent 99fc2e7 commit d3437fd

1 file changed

Lines changed: 12 additions & 4 deletions

File tree

.github/workflows/ci.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,20 @@ jobs:
108108
vendor/bin/phpunit --testdox 2>&1 | tee /tmp/phpunit-output.txt
109109
exit ${PIPESTATUS[0]}
110110
111-
- name: "Upload PHPUnit output"
111+
- name: "Post PHPUnit output on failure"
112112
if: failure()
113-
uses: actions/upload-artifact@v7
113+
uses: actions/github-script@v7
114114
with:
115-
name: "phpunit-${{ matrix.clickhouse-version }}-${{ matrix.php-version }}.output"
116-
path: "/tmp/phpunit-output.txt"
115+
script: |
116+
const fs = require('fs');
117+
const output = fs.readFileSync('/tmp/phpunit-output.txt', 'utf8');
118+
const body = `## PHPUnit failure: PHP ${{ matrix.php-version }}, ClickHouse ${{ matrix.clickhouse-version }}\n\`\`\`\n${output.slice(-3000)}\n\`\`\``;
119+
await github.rest.issues.createComment({
120+
owner: context.repo.owner,
121+
repo: context.repo.repo,
122+
issue_number: context.issue.number,
123+
body: body
124+
});
117125
118126
upload_coverage:
119127
name: "Upload coverage to Codecov"

0 commit comments

Comments
 (0)