A GitHub Action attaching a Markdown summary to a bru cli run
execution parsed from a JSON result.
This can be a subsequent step to bruno-run-action to render a test run summary.
|
Supports JSON reports generated by bru cli v1.20.0 |
Examples of the final summary attached to the job can be found here:
The listed example clones a repository source, executes the bru run
command,
and finally attaches a markdown summary at the end from the previous run.
name: Bruno Test & Report
on:
workflow_dispatch:
jobs:
bruno-tests:
name: Bruno test collection
runs-on: ubuntu-latest
steps:
- name: Checkout # (1)
id: checkout
uses: actions/checkout@v4
- name: Bruno CLI runner # (2)
id: bru-cli
uses: krummbar/bruno-run-action@main
with:
path: bruno/api-it
output: bru-output.json # (3)
outputFormat: json
- name: Attach bru run summary # (4)
uses: krummbar/bruno-run-report@main
continue-on-error: true # (5)
with:
run-report-path: bru-output.json # (6)
-
Clone repository
-
Execute
bru run
with a collection located in folderbruno/api-it
-
Specify the report result summary in JSON format
-
Generates the Markdown summary and attaches it to
${GITHUB_SUMMARY}
-
Optional make report step succeed even though report step potentially fails, see documentation
-
Needs to match the path listed in callout 3`
run-report-path:
description: Path of the bru run execution summary.
required: true
output-path:
description: If provided the contents of the markdown report will be written to the given path.
required: false
include-footer:
description: En- or disable the report footer.
required: false
default: 'true'
include-report-sources:
description: If enabled, each suite includes the raw JSON details of the run result.
required: false
default: 'false'
only-failed:
description: Skips successful testsuites in the report if set true.
required: false
default: 'false'
report-title:
description: Set a custom title for the report.
required: false
default: Bruno Run
In order to execute the actual script the action’s input parameters must be set as environment variables,
and jq
needs to be available on the work station.
- Prerequisites
The required input parameters are listed in docs/examples/.env.sample.
IN_REPORT_TITLE="Bruno Run"
IN_INCLUDE_FOOTER=true
IN_INCLUDE_REPORT_SOURCES=false
IN_ONLY_FAILED=false
# IN_OUTPUT_PATH=docs/examples/report-result.md
IN_RUN_REPORT_PATH=.github/bru-run-results/bru-output.json
GITHUB_OUTPUT=out/github-out.log
GITHUB_STEP_SUMMARY=out/github-step-summary.md
If the environment variables are set according to your needs, the main script can simply be executed.
./entrypoint.sh
❗
|
If the above listed values are used, ensure the |
The markdown result is dumped to the configured path in GITHUB_STEP_SUMMARY
, and if set copied to IN_OUTPUT_PATH
The script uses jq
to read the JSON report of a bru run process and markdown templates for generic information as the optional footer.
The transform functions and templates are defined in the [src] folder.
The README.adoc
file is generated from the sources in the docs folder.
Any documentation changes must be applied to the files located in there.
- Prerequisites
In order to update the contents of the README.adoc
run the following command.
asciidoctor-reducer --preserve-conditionals -o README.adoc docs/index.adoc