Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .github/workflows/gen_coverage_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Generate Coverage Report
on:
workflow_dispatch:
schedule:
- cron: "0 6 * * 1"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: write

jobs:
gen-coverage-report:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
steps:
- uses: actions/checkout@v5
with:
token: ${{ secrets.GH_CQ_BOT }}
- name: Set up Go 1.x
uses: actions/setup-go@v6
with:
go-version: "1.25"
cache: false
- name: Generate Coverage Report
run: make coverage

- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
with:
# required so the PR triggers workflow runs
token: ${{ secrets.GH_CQ_BOT }}
branch: chore/update_coverage_report
base: main
title: "chore: Update coverage report"
commit-message: "chore: Update coverage report"
body: This PR was created by a scheduled workflow to update the coverage report
author: cq-bot <[email protected]>
labels: automerge
4 changes: 2 additions & 2 deletions .github/workflows/lint_markdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: Vale
uses: errata-ai/vale-action@dcded780f1ff68e2558e802a165a484a4a3e2fb8
with:
vale_flags: "--glob=!{docs/testdata/*,CHANGELOG.md,.github/styles/proselint/README.md,examples/simple_plugin/docs/*.md}"
vale_flags: "--glob=!{docs/testdata/*,CHANGELOG.md,.github/styles/proselint/README.md,examples/simple_plugin/docs/*.md,coverage.md}"
filter_mode: nofilter
version: '3.0.3'
env:
Expand All @@ -39,4 +39,4 @@ jobs:
with:
files: .
config_file: .markdownlint.yaml
ignore_files: "{docs/testdata/*,CHANGELOG.md,examples/simple_plugin/docs/*.md}"
ignore_files: "{docs/testdata/*,CHANGELOG.md,examples/simple_plugin/docs/*.md,coverage.md}"
15 changes: 15 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,18 @@ benchmark-ci:
go install go.bobheadxi.dev/[email protected]
go test -bench . -benchmem ./... -run="^$$" | grep -v 'BenchmarkWriterMemory/' | gobenchdata --json bench.json
rm -rf .delta.* && go run scripts/benchmark-delta/main.go bench.json

.PHONY: coverage
coverage:
go test -timeout 15m -coverprofile=coverage.out.tmp ./...
cat coverage.out.tmp | grep -vE "MockGen|codegen|mocks" > coverage.out
rm coverage.out.tmp
echo "| File | Function | Coverage |" > coverage.md
echo "| --- | --- | --- |" >> coverage.md
go tool cover -func=coverage.out | tail -n +2 | while read line; do \
file=$$(echo $$line | awk '{print $$1}'); \
func=$$(echo $$line | awk '{print $$2}'); \
cov=$$(echo $$line | awk '{print $$3}'); \
printf "| %s | %s | %s |\\n" "$$file" "$$func" "$$cov" >> coverage.md; \
done
rm coverage.out
Loading