forked from eclipse-score/communication
-
Notifications
You must be signed in to change notification settings - Fork 0
101 lines (86 loc) · 3.37 KB
/
Copy pathcoverage_report.yml
File metadata and controls
101 lines (86 loc) · 3.37 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# *******************************************************************************
# Copyright (c) 2025 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:
outputs:
artifact-name:
description: 'Name of the coverage report artifact'
value: ${{ jobs.coverage_report.outputs.artifact-name }}
conclusion:
description: 'Job conclusion: success or failure'
value: ${{ jobs.coverage_report.outputs.conclusion }}
permissions:
contents: read
concurrency:
group: coverage_report-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: ${{ github.event_name == 'pull_request'}}
env:
ANDROID_HOME: ""
ANDROID_SDK_ROOT: ""
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
jobs:
coverage_report:
runs-on: ubuntu-24.04
outputs:
artifact-name: ${{ steps.set-artifact-name.outputs.artifact-name }}
conclusion: ${{ steps.set-conclusion.outputs.conclusion }}
steps:
- name: Checkout Repository
uses: actions/checkout@v6.0.2
- name: Free Disk Space (Ubuntu)
uses: eclipse-score/more-disk-space@v1
with:
level: 4
- name: Setup Bazel with shared caching
uses: castler/setup-bazel@cache-optimized
with:
bazelisk-cache: true
disk-cache: ${{ github.workflow }}
repository-cache: true
cache-optimized: true
cache-save: ${{ github.ref == 'refs/heads/main' }}
- name: Allow linux-sandbox
uses: ./actions/unblock_user_namespace_for_linux_sandbox
- name: Install Perl dependencies for genhtml
run: sudo apt-get install -y --no-install-recommends lcov
- name: Run Unit Test with Coverage for C++
id: run-coverage
run: |
bazel coverage //... --build_tests_only
- name: Generate HTML Coverage Report and Create Archive
if: steps.run-coverage.outcome == 'success'
run: |
bazel run //quality/coverage:generate_coverage_html -- \
--archive "${{ github.event.repository.name }}_coverage_report_${{ github.sha }}" \
cpp_coverage
- name: Set conclusion
id: set-conclusion
if: always()
run: |
if [[ "${{ steps.run-coverage.outcome }}" == "success" ]]; then
echo "conclusion=success" >> $GITHUB_OUTPUT
else
echo "conclusion=failure" >> $GITHUB_OUTPUT
fi
- name: Set artifact name
id: set-artifact-name
if: steps.run-coverage.outcome == 'success'
run: |
echo "artifact-name=${{ github.event.repository.name }}_coverage_report_${{ github.sha }}" >> $GITHUB_OUTPUT
- name: Upload coverage artifacts
if: steps.run-coverage.outcome == 'success'
uses: actions/upload-artifact@v4
with:
name: ${{ steps.set-artifact-name.outputs.artifact-name }}
path: ${{ github.event.repository.name }}_coverage_report_${{ github.sha }}.zip