Export k6 HTML or txt report in Github Actions Artifact

Hello, I am having some difficulties to export a HTML or TXT report with Github Actions.

I am executing this in my Github Actions.


When I execute this code, exports a JSON file in the Artifacts.

This is the JSON file

But I am trying to get a HTML or TXT file instead of a JSON file. If i do it with Visual Studio Code, it creates this reports.

This is the HTML file.

This is the TXT file.

I just need to create HTML report or txt report (see examples above) as an artifact in GitHub actions.

May you provide any support on this?

Hi @Isaac,

If I understand correctly, you want to see the HTML/Text report after running the Github action. Since you’re generating HTML/Text outputs, you need to upload the generated files individually as you did with summary.json.

I hope this helps.

Hi @inanc thanks for your reply, I’m afraid that I don’t quite get you, could you provide with a code example how to do what you indicate?
is it something like this?

I got what you meant:
- name: Run k6 local test
uses: grafana/k6-action@v0.2.0
with:
filename: Report.js
flags: --out json=summary.json
- name: Upload performance test results
uses: actions/upload-artifact@v3
with:
name: k6-summary-report-json
path: summary.json
- name: Upload performance test results
uses: actions/upload-artifact@v3
with:
name: k6-summary-report-html
path: summary.html
- name: Upload performance test results
uses: actions/upload-artifact@v3
with:
name: k6-summary-report-text
path: stdout.txt

and results are uploaded:
image
Thanks a lot @inanc.

1 Like