Skip to content

Commit 4fd1763

Browse files
committed
[wip] add coverage tests in ci
Change-Id: Iffdf510d5cf714d6364e335fa494ea36ac4242b1 Signed-off-by: Yi-Hsuan Deng <yhdeng@google.com>
1 parent 51f0f49 commit 4fd1763

16 files changed

Lines changed: 2146 additions & 749 deletions

File tree

.github/actions/prepare-env/action.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,15 +94,15 @@ runs:
9494
# This needs access to secrets and thus doesn't work for pull request.
9595
- uses: google-github-actions/auth@v2
9696
id: google_auth
97-
if: github.event_name != 'pull_request' && inputs.service_account_json != ''
97+
if: inputs.service_account_json != ''
9898
with:
9999
credentials_json: '${{ inputs.service_account_json }}'
100100

101101
# The above action creates a credential file in workspace and it doesn't provide a way to configure
102102
# it. This influences with a few scripts that assume clean workspace, and introduce security risk
103103
# that it may be exposed when uploading to buckets.
104104
- name: Move Google credentials out from workspace
105-
if: github.event_name != 'pull_request' && inputs.service_account_json != ''
105+
if: inputs.service_account_json != ''
106106
run: |
107107
SOURCE=${{ steps.google_auth.outputs.credentials_file_path }}
108108
TARGET=${{ runner.temp }}/$(basename "$SOURCE")
@@ -113,7 +113,7 @@ runs:
113113
shell: bash
114114

115115
- uses: google-github-actions/setup-gcloud@v2
116-
if: github.event_name != 'pull_request' && inputs.service_account_json != ''
116+
if: inputs.service_account_json != ''
117117

118118
- name: Configure ~/.bazelrc
119119
if: inputs.configure-bazel == 'true'

.github/actions/publish-bazel-test-results/action.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,16 @@ runs:
5656
report_paths: ${{ inputs.merged-results }}
5757
annotate_only: true
5858
detailed_summary: true
59+
60+
- name: Collect coverage reports
61+
id: collect_coverage
62+
shell: bash
63+
run: ci/scripts/collect-coverage-report.sh /tmp/coverage_report
64+
65+
- name: Upload coverage report
66+
if: steps.collect_coverage.outputs.coverageReport == 'ok'
67+
uses: actions/upload-artifact@v4
68+
with:
69+
name: ${{ inputs.artifact-name }}-coverage
70+
path: /tmp/coverage_report
71+
overwrite: true

0 commit comments

Comments
 (0)