Chore: Backend unit test workflow (#101534)
* baldm0mma/ parallelize tests for reporting * baldm0mma/ update combining non-existant outputs * baldm0mma/ remove duplicate logic * baldm0mma/ rem any unnecessary logging * baldm0mma/ add workflow path for test coverage test * baldm0mma/ cache ent * baldm0mma/ update with crucial comments * baldm0mma/ generate go files * baldm0mma/ cache enterprise only once * baldm0mma/ adjust coverage threshholds * baldm0mma/ remove temp artifacts from storage to save $$$ * baldm0mma/ remove strict coverage for unit tests * baldm0mma/ pass coverage go opts * baldm0mma/ update run backend tests action to composite * baldm0mma/ separate make gen go into it's own composite step * baldm0mma/ move options to workflow * baldm0mma/ remove use of action * baldm0mma/ remove unsed action * baldm0mma/ update codeowners * baldm0mma/ add edition logic * baldm0mma/ set env vars in determine-edition action * baldm0mma/ make test * baldm0mma/ debug sequential * baldm0mma/ debugging by removing unit tests * baldm0mma/ TRY SOMETHING DIFFERENT!!! * baldm0mma/ uploading ent from within the workspace * baldm0mma/ revert run-backend-tests action * baldm0mma/ move edition to job level * baldm0mma/ update WIRE_TAGS * baldm0mma/ move the enterprise code to the correct location after extracting it * baldm0mma/ rem packaging/extracting of enterprise code * baldm0mma/ test makefile * baldm0mma/ add ent setup to coverage * baldm0mma/ rem backend test action * baldm0mma/ add wire and go steps to coverage job * baldm0mma/ remove make installation, as it is already present in the "ubuntu-latest" package * baldm0mma/ convert to matrix testing strategy * baldm0mma/ update separate test coverage to only a day * baldm0mma/ add setup-common-backend-testing-env action * baldm0mma/ add setup env * baldm0mma/ update naming * baldm0mma/ updade codeowners * baldm0mma/ rem ent * baldm0mma/ update naming * baldm0mma/ remove multiline syntax in report-coverage * baldm0mma/ make gen-go * baldm0mm/ remove integration tests * baldm0mma/ update coverage params * baldm0mma/ streamline workflow * baldm0mma/ update codeowners * baldm0mma/ update naming * baldm0mma/ simplify logic * baldm0mma/ remove uneeded trigger * baldm0mma/ remove conditional coverage step * baldm0mma/ debug coverage * baldm0mma/ update file name * baldm0mma/ remove artifact upload * baldm0mma/ update atrifact params in the workflow * baldm0mma/ simplify processing logic
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
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
|
||||
run: |
|
||||
# Ensure valid coverage file even if empty
|
||||
if [ ! -s ${{ inputs.coverage-file }} ]; then
|
||||
echo "Coverage file is empty, creating a minimal valid file"
|
||||
echo "mode: set" > ${{ inputs.coverage-file }}
|
||||
fi
|
||||
|
||||
- name: Report coverage to CodeCov
|
||||
uses: codecov/codecov-action@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 }}
|
||||
Reference in New Issue
Block a user