Repository navigation
69 lines (61 loc) · 2.43 KB
/
Copy path_coverage_report.yml
File metadata and controls
69 lines (61 loc) · 2.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# *******************************************************************************
# Copyright (c) 2026 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Apache License Version 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0
#
# SPDX-License-Identifier: Apache-2.0
# *******************************************************************************
name: "Coverage Report"
on:
workflow_call:
inputs:
cache-mode:
description: "Cache mode override (empty = auto-compute from event context)."
type: string
default: ""
fetch-only:
description: "When true, runs --nobuild to fetch dependencies only."
type: string
default: "false"
secrets:
UBUNTU_SNAPSHOT_MIRROR_URL:
required: false
jobs:
coverage:
name: Build & Test
runs-on: ubuntu-24.04
permissions:
contents: read
actions: write
steps:
- uses: actions/checkout@v6.0.2
- uses: ./.github/actions/00_infrastructure/prepare_bazel_environment
with:
disk-cache: ${{ inputs.fetch-only != 'true' && 'coverage_report' || '' }}
cache-mode: ${{ inputs.cache-mode }}
ubuntu-snapshot-mirror-url: ${{ secrets.UBUNTU_SNAPSHOT_MIRROR_URL }}
- name: Fetch dependencies (--nobuild)
if: inputs.fetch-only == 'true'
run: bazel build --nobuild --config=ci //...
- name: Run coverage
if: inputs.fetch-only != 'true'
id: run-coverage
run: bazel coverage --config=ci //... --build_tests_only
- name: Generate coverage report
if: inputs.fetch-only != 'true' && steps.run-coverage.outcome == 'success'
id: generate-report
run: |
bazel run --config=ci //quality/coverage:generate_coverage_html -- \
--archive "${{ github.event.repository.name }}_coverage_report_${{ github.sha }}" \
cpp_coverage_linux
- name: Upload coverage artifacts
if: inputs.fetch-only != 'true' && steps.generate-report.outcome == 'success'
uses: actions/upload-artifact@v4
with:
name: ${{ github.event.repository.name }}_coverage_report_${{ github.sha }}
path: ${{ github.event.repository.name }}_coverage_report_${{ github.sha }}.zip