The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
grafana/.github/actions/test-coverage-processor/action.yml

50 lines
1.6 KiB

name: 'Go Coverage Processor'
description: 'Process Go test coverage files and generate reports'
inputs:
test-type:
description: 'Type of test (e.g., be-unit, be-integration)'
required: true
type: string
coverage-file:
description: 'Path to the Go coverage file (.cov)'
required: true
type: string
codecov-token:
description: 'Token for CodeCov (required for CodeCov reporting)'
required: false
default: ''
codecov-flag:
description: 'Flag to categorize the upload to CodeCov'
required: false
default: ''
codecov-name:
description: 'Custom name for the upload to CodeCov'
required: false
default: ''
runs:
using: 'composite'
steps:
- name: Process Go coverage output
shell: bash
env:
COVERAGE_FILE: ${{ inputs.coverage-file }}
run: |
# Ensure valid coverage file even if empty
if [ ! -s "$COVERAGE_FILE" ]; then
echo "Coverage file is empty, creating a minimal valid file"
echo "mode: set" > "$COVERAGE_FILE"
fi
- name: Report coverage to CodeCov
uses: codecov/codecov-action@ad3126e916f78f00edff4ed0317cf185271ccc2d # v5
if: inputs.codecov-token != ''
with:
files: ${{ inputs.coverage-file }}
flags: ${{ inputs.codecov-flag || inputs.test-type }}
name: ${{ inputs.codecov-name || inputs.test-type }}
slug: grafana/grafana
# This URL doesn't use the Google auth, but is much more locked down. As such, it requires OIDC or a CodeCov-provided token to do anything.
url: https://codecov-webhook.grafana-dev.net
token: ${{ inputs.codecov-token }}