Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions .github/workflows/release_verification.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,55 @@ jobs:
bazel test --config bl-x86_64-linux //score/... -- \
-//score/language/safecpp/aborts_upon_exception:abortsuponexception_toolchain_test \
-//score/containers:dynamic_array_test
- name: Install lcov
run: |
sudo apt-get update
sudo apt-get install -y lcov
- name: Bazel coverage baselibs targets
run: |
# Run every test target
for target in $(bazel query 'tests(attr(name, "unit_test_suite_host", //...:*))'); do
# Replace leading // with bazel-bin path, and ':' with '/'
out="$(bazel info bazel-bin)/${target#//}"
out="${out/://}"
"$out"
done
# Collect coverage data
lcov --capture \
--directory="$(bazel info bazel-bin)/score/" \
--output-file=cpp_coverage.info \
--gcov-tool="$(bazel info execution_root)/external/score_toolchains_gcc++gcc+gcc_toolchain_gcc/bin/x86_64-unknown-linux-gnu-gcov" \
--base-directory="$(bazel info workspace)" \
--branch-coverage \
--ignore-errors=mismatch \
--exclude="*/external/*" \
--ignore-errors gcov
# Generate HTML report
genhtml cpp_coverage.info \
-o=cpp_coverage \
--show-details \
--legend \
--function-coverage \
--branch-coverage
shell: bash
- name: Create archive of test report
run: |
mkdir -p artifacts
find bazel-testlogs/score/ -name 'test.xml' -print0 | xargs -0 -I{} cp --parents {} artifacts/
cp -r cpp_coverage artifacts/
zip -r ${{ github.event.repository.name }}_coverage_report.zip artifacts/
shell: bash
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ github.event.repository.name }}_coverage_report.zip
path: ${{ github.event.repository.name }}_coverage_report.zip
- name: Upload release asset (attach ZIP to GitHub Release)
uses: softprops/[email protected]
with:
files: ${{ github.event.repository.name }}_coverage_report.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
release_verification:
runs-on: ubuntu-latest
needs: [build_host, build_target, test_host]
Expand Down
2 changes: 1 addition & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ bazel_dep(name = "download_utils", version = "1.0.1")
## Custom Module Loading

bazel_dep(name = "score_docs_as_code", version = "2.2.0")
bazel_dep(name = "score_process", version = "1.4.0")
bazel_dep(name = "score_process", version = "1.4.0", dev_dependency = True)
bazel_dep(name = "score_tooling", version = "1.0.4")

## Configure the python toolchain
Expand Down
Loading