-
Notifications
You must be signed in to change notification settings - Fork 132
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
Enable codecov and generate metadata file as artifact #1320
Merged
taylanisikdemir
merged 4 commits into
cadence-workflow:master
from
taylanisikdemir:taylan/coverage_metadata
Mar 15, 2024
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/sh | ||
|
||
set -ex | ||
|
||
# This script generates coverage metadata for the coverage report. | ||
# Output is used by SonarQube integration in Uber and not used by OS repo coverage tool itself. | ||
|
||
# Example output: | ||
# commit-sha: 6953daa563e8e44512bc349c9608484cfd4ec4ff | ||
# timestamp: 2024-03-04T19:29:16Z | ||
|
||
output_path="$1" | ||
|
||
echo "commit-sha: $(git rev-parse HEAD)" > "$output_path" | ||
echo "timestamp: $(date -u +%Y-%m-%dT%H:%M:%SZ)" >> "$output_path" | ||
|
||
echo "Coverage metadata written to $output_path" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Workflow for Codecov integration | ||
on: [push, pull_request] | ||
jobs: | ||
codecov: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: 1.22.x | ||
cache: false | ||
|
||
- name: Download dependencies | ||
run: go mod download | ||
|
||
- name: Test and generate coverage report | ||
run: make unit_test | ||
|
||
- name: Upload coverage reports to Codecov | ||
uses: codecov/codecov-action@v4.0.1 # https://github.com/codecov/codecov-action | ||
with: | ||
file: .build/cover.out | ||
exclude: ./ | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
slug: uber-go/cadence-client |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# Refs: | ||
# - https://docs.codecov.com/docs/common-recipe-list | ||
# - https://docs.codecov.com/docs/codecovyml-reference | ||
# | ||
# After making changes, run below command to validate | ||
# curl --data-binary @codecov.yml https://codecov.io/validate | ||
coverage: | ||
range: 80...100 | ||
round: down | ||
precision: 2 | ||
status: | ||
project: # measuring the overall project coverage | ||
default: # context, you can create multiple ones with custom titles | ||
informational: true | ||
target: 85% # specify the target coverage for each commit status | ||
# option: "auto" (compare against parent commit or pull request base) | ||
# option: "X%" a static target percentage to hit | ||
threshold: 0% # allow the coverage drop by x% before marking as failure | ||
if_ci_failed: ignore # require the CI to pass before setting the status | ||
patch: | ||
default: | ||
informational: true | ||
comment: | ||
layout: "header, files, footer" | ||
hide_project_coverage: false | ||
codecov: | ||
require_ci_to_pass: false | ||
ignore: | ||
- "**/*_generated.go" | ||
- "**/*_mock.go" | ||
- "**/testdata/**" | ||
- "**/*_test.go" | ||
- "**/*_testsuite.go" | ||
- "compatibility/**" | ||
- "idls/**" | ||
- "internal/compatibility/**" | ||
- "internal/tools/**" | ||
- "mocks/**" | ||
- "test/**" | ||
- "testsuite/**" |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
possibly switch to the condensed version from the beginning?