Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add coverage calculation and badge #127

Merged
merged 9 commits into from
Jan 25, 2025
Merged
Show file tree
Hide file tree
Changes from 6 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
22 changes: 22 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
codecov:
notify:
require_ci_to_pass: yes
strict_yaml_branch: main # only use the latest copy on the main branch

ignore:
- "model/v1/model.pb.go"
yurishkuro marked this conversation as resolved.
Show resolved Hide resolved
- "proto-gen/*/*"

coverage:
precision: 2
round: down
range: "95...100"
status:
project:
default:
enabled: yes
target: 95%
patch:
default:
enabled: yes
target: 95%
34 changes: 34 additions & 0 deletions .github/actions/upload-codecov/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Copyright (c) 2023 The Jaeger Authors.
# SPDX-License-Identifier: Apache-2.0

# Codecov upload often fails on rate limits if used without a token.
# See https://github.com/codecov/codecov-action/issues/837
# This action embeds a token directly.
# We cannot define it as "secret" as we need it accessible from forks.

name: 'Upload coverage to codecov'
description: 'Uploads coverage to codecov with retries'
inputs:
files:
description: 'Coverage files to upload'
required: true
flags:
description: 'Flags for codecov'
required: true
runs:
using: 'composite'
steps:
- name: Retry upload
uses: Wandalen/[email protected]
yurishkuro marked this conversation as resolved.
Show resolved Hide resolved
with:
attempt_limit: 6
# sleep 10 seconds between retries
attempt_delay: 10000
action: codecov/codecov-action@v5
with: |
slug: jaegertracing/jaeger-idl
files: ${{ inputs.files }}
flags: ${{ inputs.flags }}
verbose: true
fail_ci_if_error: true
token: 95fab3d9-8038-40ba-ac56-0d8bd91390a4
10 changes: 4 additions & 6 deletions .github/workflows/ci-unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,11 @@ jobs:
- name: Run unit tests
run: make test-ci

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
- name: upload code coverage
uses: ./.github/actions/upload-codecov
yurishkuro marked this conversation as resolved.
Show resolved Hide resolved
with:
slug: jaegertracing/jaeger-idl
verbose: true
fail_ci_if_error: true
token: 95fab3d9-8038-40ba-ac56-0d8bd91390a4
files: coverage.txt
flags: unittests

test-code-gen:
runs-on: ubuntu-latest
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.idea/
gen-*/
.proto-gen-polyglot/
coverage.txt
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ swagger-validate:
clean:
rm -rf *gen-* || true
rm -rf .*gen-* || true
rm -rf coverage.txt
yurishkuro marked this conversation as resolved.
Show resolved Hide resolved

.PHONY: thrift
thrift: thrift-image clean $(THRIFT_FILES)
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# jaeger-idl [![Build Status][ci-img]][ci]
[![Coverage Status][cov-img]][cov]

A set of shared Thrift and Protobuf data model definitions used by the Jaeger components.

Expand Down Expand Up @@ -35,3 +36,5 @@ See [CONTRIBUTING](./CONTRIBUTING.md).

[ci-img]: https://github.com/jaegertracing/jaeger-idl/actions/workflows/ci-unit-tests.yml/badge.svg
[ci]: https://github.com/jaegertracing/jaeger-idl/actions/workflows/ci-unit-tests.yml
[cov-img]: https://codecov.io/gh/jaegertracing/jaeger-idl/branch/main/graph/badge.svg
[cov]: https://codecov.io/gh/jaegertracing/jaeger-idl/branch/main/
Loading