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/workflows/pr-backend-coverage.yml

69 lines
2.0 KiB

name: Coverage
on:
workflow_dispatch:
push:
branches:
- main
paths-ignore:
- 'docs/**'
- '**/*.md'
permissions:
contents: read
id-token: write
env:
EDITION: 'oss'
WIRE_TAGS: 'oss'
jobs:
main:
name: Backend Unit Tests
runs-on: ubuntu-latest-8-cores
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential shared-mime-info
go install github.com/mfridman/tparse@c1754a1f484ac5cd422697b0fec635177ddc8507 # v0.17.0
- name: Generate Go code
run: make gen-go
- name: Run unit tests
run: COVER_OPTS="-coverprofile=be-unit.cov -coverpkg=github.com/grafana/grafana/..." GO_TEST_OUTPUT="/tmp/unit.log" make test-go-unit-cov
- name: Process and upload coverage
uses: ./.github/actions/test-coverage-processor
with:
test-type: 'be-unit'
# Needs to be named 'unit.cov' based on the Makefile command `make test-go-unit`
coverage-file: 'unit.cov'
codecov-token: ${{ secrets.CODECOV_TOKEN }}
codecov-flag: 'be-unit'
codecov-name: 'be-unit'
- name: Install Grafana Bench
# We can't allow forks here, as we need secret access.
if: ${{ github.event_name != 'pull_request' }}
uses: ./.github/actions/setup-grafana-bench
- name: Process output for Bench
if: ${{ github.event_name != 'pull_request' }}
run: |
grafana-bench report \
--trigger pr-backend-unit-tests-oss \
--report-input go \
--report-output log \
--grafana-version "$(git rev-parse HEAD)" \
--suite-name grafana-oss-unit-tests \
/tmp/unit.log || true
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false