mirror of
https://github.com/microsoft/playwright.git
synced 2024-10-27 13:50:25 +03:00
chore: publish markdown report as a comment (#23825)
This commit is contained in:
parent
700a925565
commit
8fbcffa43e
20
.github/workflows/create_test_report.yml
vendored
20
.github/workflows/create_test_report.yml
vendored
@ -44,9 +44,9 @@ jobs:
|
||||
output_dir: 'blob-report'
|
||||
connection_string: '${{ secrets.AZURE_CONNECTION_STRING_FOR_BLOB_REPORT }}'
|
||||
|
||||
- name: Merge into HTML Report
|
||||
- name: Merge reports
|
||||
run: |
|
||||
npx playwright merge-reports --reporter html --attachments missing blob-report
|
||||
npx playwright merge-reports --reporter markdown,html --attachments missing blob-report
|
||||
|
||||
- name: Upload HTML report to Azure
|
||||
run: |
|
||||
@ -92,10 +92,16 @@ jobs:
|
||||
const reportDir = 'run-${{ github.event.workflow_run.id }}-${{ github.event.workflow_run.run_attempt }}-${{ github.sha }}';
|
||||
const reportUrl = `https://mspwblobreport.z1.web.core.windows.net/${reportDir}/index.html`;
|
||||
core.notice('Report url: ' + reportUrl);
|
||||
const reportMd = await fs.promises.readFile('report.md', 'utf8');
|
||||
const { data: response } = await github.rest.issues.createComment({
|
||||
...context.repo,
|
||||
issue_number: prNumber,
|
||||
body: `"${{ github.event.workflow_run.name }}" [report](${reportUrl}).`,
|
||||
body: [
|
||||
`### Test results for "${{ github.event.workflow_run.name }}"`,
|
||||
reportMd,
|
||||
'---',
|
||||
`Full [html report](${reportUrl}).`
|
||||
].join('\n'),
|
||||
});
|
||||
core.info('Posted comment: ' + response.html_url);
|
||||
|
||||
@ -108,7 +114,11 @@ jobs:
|
||||
conclusion: 'success',
|
||||
details_url: reportUrl,
|
||||
output: {
|
||||
title: 'Merged test results (${{ github.event.workflow_run.name }})',
|
||||
summary: `Created [report](${reportUrl}). Merge [workflow run](${mergeWorkflowUrl}).`,
|
||||
title: 'Test results for "${{ github.event.workflow_run.name }}"',
|
||||
summary: [
|
||||
reportMd,
|
||||
'---',
|
||||
`Full [html report](${reportUrl}). Merge [workflow run](${mergeWorkflowUrl}).`
|
||||
].join('\n'),
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user