[CI] Add nightly ELD code coverage workflow with regression detection#1405
[CI] Add nightly ELD code coverage workflow with regression detection#1405Saharsh Burra (bsaharsh) wants to merge 1 commit into
Conversation
7ab5f2f to
5cb95b0
Compare
| git config user.name 'github-actions' | ||
| git config user.email 'github-actions@github.com' | ||
|
|
||
| git checkout --orphan coverage-update |
There was a problem hiding this comment.
can we have this branch as code-coverage-reports ?
There was a problem hiding this comment.
Updated the name
| jobs: | ||
| coverage: | ||
| if: github.repository == 'qualcomm/eld' | ||
| runs-on: self-hosted |
There was a problem hiding this comment.
Shankar Easwaran (@quic-seaswara) is it okay to run this workflow on self-hosted? self-hosted here will make adding this workflow easier because we would not need to install/setup the cross-toolchains and qemu.
| repository: ${{ github.repository }} | ||
| ref: ${{ github.ref_name }} | ||
| path: llvm-project/llvm/tools/eld | ||
| fetch-depth: 0 |
There was a problem hiding this comment.
We can likely remove fetch-depth: 0 from here.
There was a problem hiding this comment.
Updated
| ../llvm-project/llvm \ | ||
| -DCMAKE_BUILD_TYPE=Debug \ | ||
| -DCMAKE_DISABLE_PRECOMPILE_HEADERS=ON \ | ||
| -DLLVM_ENABLE_PROJECTS="llvm;clang;clang-tools-extra" \ |
There was a problem hiding this comment.
Would it be possible to use the clang and the other tools from the nightly eld toolchain and only build eld with code-coverage enabled?
There was a problem hiding this comment.
Updated, but need to test it as fork won't be having the self hosted, may be we can use the workflow dispatch.
5cb95b0 to
0149db3
Compare
531af9e to
60cec40
Compare
aa5537f to
eb451ab
Compare
eb451ab to
10b8ddc
Compare
49d7a22 to
4cd34c6
Compare
4cd34c6 to
8fcbdc7
Compare
85f166b to
445434e
Compare
Add nightly-eld-code-coverage.yml which runs daily after the nightly build. The workflow: - Builds LLVM+ELD with source-based coverage instrumentation (ELD_COVERAGE=ON) - Runs the full check-eld test suite under LLVM_PROFILE_FILE to collect per-process .profraw files - Downloads LLVM 22.1.8 from GitHub Releases and uses its llvm-profdata and llvm-cov tools to avoid profraw version mismatches with the built-in tools - Merges profiles with llvm-profdata and generates an HTML report with llvm-cov show - Extracts Line/Function/Region/Branch percentages from the TOTAL row of llvm-cov report - Compares each metric against a coverage-baseline.txt stored on the code-coverage-reports branch; fails the workflow if any metric regresses - On first run (no baseline present) records the baseline without failing - Force-pushes the HTML report and updated baseline to the code-coverage-reports orphan branch on every successful run Also updates CMakeLists.txt: ELD_COVERAGE option now sets llvm-cov source-based instrumentation flags (-fprofile-instr-generate -fcoverage-mapping) instead of gcov (--coverage). Signed-off-by: bsaharsh <bsaharsh@qti.qualcomm.com>
445434e to
f7bb343
Compare
Added a workflow which runs nightly and computes the code coverage, and when ran at first creates a baseline text file on orphan branch called code-coverage, and from the next time, it checks with the previous coverage numbers and if any metric goes down, it fails, and if no regression is detected then we push the html report and update the baseline text file.