simpleinfra
simpleinfra copied to clipboard
feat: add upload-metrics-artifact GitHub Action ✨
@jdno
Please take a look and let me know if there's anything missing.
On second thought, I think we can also make this action more generic with the following action.yml definition.
name: Collect CI metrics
description: Collect CI metrics and upload them to GitHub Artifacts
inputs:
collect-metrics:
description: Whether to collect metrics or not
required: false
default: "1"
metrics-filepath:
description: Comma or space separated list of metrics files to be uploaded to GitHub artifact
required: true
default: build/cpu-usage.csv
upload-artifacts:
description: Whether to upload artifacts or not
required: false
default: "1"
runs:
using: node20
pre-if: inputs.collect-metrics == "1"
pre: collect.js
main: index.js
post-if: inputs.upload-artifacts == "1"
post: upload.js
Please let me know if this is a better approach.
Which, then, requires only one step in a job definition instead of two if we go with the first draft of this PR.