Skip to content

Commit 7efda4e

Browse files
committed
Add couldbuild build config file for code coverage
1 parent fe7d3fe commit 7efda4e

File tree

2 files changed

+57
-0
lines changed

2 files changed

+57
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
steps:
2+
- name: gcr.io/cloud-builders/git
3+
args:
4+
- submodule
5+
- update
6+
- "--init"
7+
- "--recursive"
8+
id: Submodules
9+
10+
- name: "connectedhomeip/chip-build-vscode:0.6.06"
11+
env:
12+
- PW_ENVIRONMENT_ROOT=/pwenv
13+
args:
14+
- "-c"
15+
- source ./scripts/bootstrap.sh
16+
id: Bootstrap
17+
waitFor:
18+
- Submodules
19+
entrypoint: /usr/bin/bash
20+
volumes:
21+
- name: pwenv
22+
path: /pwenv
23+
timeout: 900s
24+
25+
- name: "connectedhomeip/chip-build-vscode:0.6.06"
26+
env:
27+
- PW_ENVIRONMENT_ROOT=/pwenv
28+
args:
29+
- "-c"
30+
- ./scripts/build_coverage.sh
31+
id: BuildCoverage
32+
waitFor:
33+
- Bootstrap
34+
entrypoint: /usr/bin/bash
35+
volumes:
36+
- name: pwenv
37+
path: /pwenv
38+
timeout: 900s
39+
40+
logsBucket: matter-build-automation-build-logs
41+
42+
# Global timeout for all steps
43+
timeout: 21600s
44+
queueTtl: 21600s
45+
46+
artifacts:
47+
objects:
48+
location: "gs://matter-build-automation-artifacts/$PROJECT_ID/$COMMIT_SHA/"
49+
paths: ["/out/coverage/coverage/coverage_html.tar.gz"]
50+
51+
# Using higher CPU machines generally speeds up builds, except bootstrap is always
52+
# slow.
53+
options:
54+
machineType: "E2_HIGHCPU_32"
55+
diskSizeGb: 500

scripts/build_coverage.sh

+2
Original file line numberDiff line numberDiff line change
@@ -168,3 +168,5 @@ lcov --initial --capture --directory "$OUTPUT_ROOT/obj/src" --exclude="$PWD"/zzz
168168
lcov --capture --directory "$OUTPUT_ROOT/obj/src" --exclude="$PWD"/zzz_generated/* --exclude="$PWD"/third_party/* --exclude=/usr/include/* --output-file "$COVERAGE_ROOT/lcov_test.info"
169169
lcov --add-tracefile "$COVERAGE_ROOT/lcov_base.info" --add-tracefile "$COVERAGE_ROOT/lcov_test.info" --output-file "$COVERAGE_ROOT/lcov_final.info"
170170
genhtml "$COVERAGE_ROOT/lcov_final.info" --output-directory "$COVERAGE_ROOT/html"
171+
172+
tar czvf "$COVERAGE_ROOT/coverage_html.tar.gz" -C "$COVERAGE_ROOT/html" .

0 commit comments

Comments
 (0)