Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ jobs:
include_passed: true
detailed_summary: true
summary: '<table><thead><tr><th> Application (src/applications) </th></tr></thead><tbody><tr><td> test </td></tr></tbody></table>'
job_summary_text: |
# Test Header for Example Junit Test Report

This is some custom body to show in the summary.
check_title_template: '{{SUITE_NAME}} | {{TEST_NAME}}'
annotate_only: ${{ github.event_name == 'workflow_dispatch' }}

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ jobs:
| `annotate_only` | Optional. Will only annotate the results on the files, won't create a check run. Defaults to `false`. |
| `transformers` | Optional. Array of `Transformer`s offering the ability to adjust the fileName. Defaults to: `[{"searchValue":"::","replaceValue":"/"}]` |
| `job_summary` | Optional. Enables the publishing of the job summary for the results. Defaults to `true`. May be required to disable [Enterprise Server](https://github.com/mikepenz/action-junit-report/issues/637) |
| `job_summary_text` | Optional. Additional text to include in the job summary prior to the tables. Defaults to empty string. |
| `detailed_summary` | Optional. Include table with all test results in the summary (Also applies to comment). Defaults to `false`. |
| `flaky_summary` | Optional. Include table with all flaky results in the summary (Also applies to comment). Defaults to `false`. |
| `verbose_summary` | Optional. Detail table will note if there were no test annotations for a test suite (Also applies to comment). Defaults to `true`. |
Expand Down
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ inputs:
description: 'Enables the publishing of a JOB_SUMMARY with the report.'
required: false
default: 'true'
job_summary_text:
description: 'Additional text to include in the job summary prior to the tables'
required: false
default: ''
detailed_summary:
description: 'Include table with all test results in summary'
required: false
Expand Down
17 changes: 11 additions & 6 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

16 changes: 11 additions & 5 deletions src/annotator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,16 +146,22 @@ export async function attachSummary(
table: SummaryTableRow[],
detailsTable: SummaryTableRow[],
flakySummary: SummaryTableRow[],
checkInfos: CheckInfo[] = []
checkInfos: CheckInfo[] = [],
summaryText?: string
): Promise<void> {
// Add summary text if provided
if (summaryText) {
core.summary.addRaw(summaryText)
}

if (table.length > 0) {
await core.summary.addTable(table).write()
core.summary.addTable(table)
}
if (detailsTable.length > 1) {
await core.summary.addTable(detailsTable).write()
core.summary.addTable(detailsTable)
}
if (flakySummary.length > 1) {
await core.summary.addTable(flakySummary).write()
core.summary.addTable(flakySummary)
}

// Add check links to the job summary if any checks were created
Expand All @@ -166,7 +172,7 @@ export async function attachSummary(
core.summary.addList(links)
}
core.summary.addSeparator()
core.summary.write()
await core.summary.write()
}

export function buildCommentIdentifier(checkName: string[]): string {
Expand Down
3 changes: 2 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export async function run(): Promise<void> {
const checkRetries = core.getInput('check_retries') === 'true'
const annotateNotice = core.getInput('annotate_notice') === 'true'
const jobSummary = core.getInput('job_summary') === 'true'
const jobSummaryText = core.getInput('job_summary_text')
const detailedSummary = core.getInput('detailed_summary') === 'true'
const flakySummary = core.getInput('flaky_summary') === 'true'
const verboseSummary = core.getInput('verbose_summary') === 'true'
Expand Down Expand Up @@ -197,7 +198,7 @@ export async function run(): Promise<void> {
)
if (jobSummary && supportsJobSummary) {
try {
await attachSummary(table, detailTable, flakyTable, checkInfos)
await attachSummary(table, detailTable, flakyTable, checkInfos, jobSummaryText)
} catch (error) {
core.error(`❌ Failed to set the summary using the provided token. (${error})`)
}
Expand Down
Loading