File tree Expand file tree Collapse file tree 4 files changed +93
-1
lines changed Expand file tree Collapse file tree 4 files changed +93
-1
lines changed Original file line number Diff line number Diff line change 4
4
queue : " init"
5
5
docker : " *"
6
6
command : " .buildkite/scripts/fossa.sh"
7
+
7
8
- label : " :golang: unit-test"
8
9
agents :
9
10
queue : " workers"
10
11
docker : " *"
11
- command : " make unit_test"
12
+ commands :
13
+ - " make unit_test"
14
+ - " .buildkite/scripts/gen_coverage_metadata.sh .build/metadata.txt"
12
15
artifact_paths :
13
16
- " .build/*/coverage/*.out"
17
+ - " .build/cover.out"
18
+ - " .build/metadata.txt"
14
19
plugins :
15
20
- docker-compose#v3.0.0:
16
21
run : unit-test
Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+
3
+ set -ex
4
+
5
+ # This script generates coverage metadata for the coverage report.
6
+ # Output is used by SonarQube integration in Uber and not used by OS repo coverage tool itself.
7
+
8
+ # Example output:
9
+ # commit-sha: 6953daa563e8e44512bc349c9608484cfd4ec4ff
10
+ # timestamp: 2024-03-04T19:29:16Z
11
+
12
+ output_path=" $1 "
13
+
14
+ echo " commit-sha: $( git rev-parse HEAD) " > " $output_path "
15
+ echo " timestamp: $( date -u +%Y-%m-%dT%H:%M:%SZ) " >> " $output_path "
16
+
17
+ echo " Coverage metadata written to $output_path "
Original file line number Diff line number Diff line change
1
+ name : Workflow for Codecov integration
2
+ on : [push, pull_request]
3
+ jobs :
4
+ codecov :
5
+ runs-on : ubuntu-latest
6
+ steps :
7
+ - name : Checkout
8
+ uses : actions/checkout@v4
9
+ with :
10
+ fetch-depth : 0
11
+
12
+ - name : Set up Go
13
+ uses : actions/setup-go@v4
14
+ with :
15
+ go-version : 1.22.x
16
+ cache : false
17
+
18
+ - name : Download dependencies
19
+ run : go mod download
20
+
21
+ - name : Test and generate coverage report
22
+ run : make unit_test
23
+
24
+ - name : Upload coverage reports to Codecov
25
+ uses :
codecov/[email protected] # https://github.com/codecov/codecov-action
26
+ with :
27
+ file : .build/cover.out
28
+ exclude : ./
29
+ token : ${{ secrets.CODECOV_TOKEN }}
30
+ slug : uber-go/cadence-client
Original file line number Diff line number Diff line change
1
+ # Refs:
2
+ # - https://docs.codecov.com/docs/common-recipe-list
3
+ # - https://docs.codecov.com/docs/codecovyml-reference
4
+ #
5
+ # After making changes, run below command to validate
6
+ # curl --data-binary @codecov.yml https://codecov.io/validate
7
+ coverage :
8
+ range : 80...100
9
+ round : down
10
+ precision : 2
11
+ status :
12
+ project : # measuring the overall project coverage
13
+ default : # context, you can create multiple ones with custom titles
14
+ informational : true
15
+ target : 85% # specify the target coverage for each commit status
16
+ # option: "auto" (compare against parent commit or pull request base)
17
+ # option: "X%" a static target percentage to hit
18
+ threshold : 0% # allow the coverage drop by x% before marking as failure
19
+ if_ci_failed : ignore # require the CI to pass before setting the status
20
+ patch :
21
+ default :
22
+ informational : true
23
+ comment :
24
+ layout : " header, files, footer"
25
+ hide_project_coverage : false
26
+ codecov :
27
+ require_ci_to_pass : false
28
+ ignore :
29
+ - " **/*_generated.go"
30
+ - " **/*_mock.go"
31
+ - " **/testdata/**"
32
+ - " **/*_test.go"
33
+ - " **/*_testsuite.go"
34
+ - " compatibility/**"
35
+ - " idls/**"
36
+ - " internal/compatibility/**"
37
+ - " internal/tools/**"
38
+ - " mocks/**"
39
+ - " test/**"
40
+ - " testsuite/**"
You can’t perform that action at this time.
0 commit comments