forked from cppalliance/mrdocs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8d8a007
commit 543ec61
Showing
1 changed file
with
45 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,6 +41,7 @@ jobs: | |
standards: '20' | ||
latest-factors: | | ||
msvc Optimized-Debug | ||
gcc Coverage | ||
factors: '' | ||
runs-on: | | ||
apple-clang: macos-15 | ||
|
@@ -56,6 +57,7 @@ jobs: | |
msvc Optimized-Debug: /Ob1 /O2 /Zi | ||
install: | | ||
gcc: git build-essential pkg-config python3 curl openjdk-11-jdk pkg-config libncurses-dev libxml2-utils libxml2-dev | ||
gcc Coverage: git build-essential pkg-config python3 curl openjdk-11-jdk pkg-config libncurses-dev libxml2-utils libxml2-dev lcov | ||
clang: git build-essential pkg-config python3 curl openjdk-11-jdk pkg-config libncurses-dev libxml2-utils libxml2-dev | ||
msvc: '' | ||
extra-values: | | ||
|
@@ -404,13 +406,48 @@ jobs: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Codecov | ||
if: ${{ matrix.coverage }} | ||
uses: codecov/[email protected] | ||
with: | ||
directory: './build' | ||
fail_ci_if_error: true | ||
gcov: true | ||
verbose: true | ||
if: matrix.coverage | ||
env: | ||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | ||
run: | | ||
set -x | ||
if [ -z "$CODECOV_TOKEN" ]; then | ||
echo "CODECOV_TOKEN is not set. Skipping coverage report." | ||
exit 0 | ||
fi | ||
# Find gcov | ||
gcov_tool="gcov" | ||
for version in "${{steps.setup-cpp.outputs.version-major}}.${{steps.setup-cpp.outputs.version-minor}}" "${{steps.setup-cpp.outputs.version-major}}"; do | ||
if command -v "gcov-$version" &> /dev/null; then | ||
gcov_tool="gcov-$version" | ||
break | ||
fi | ||
done | ||
for dir in "./build"; do | ||
# Generate reports | ||
echo "Generate report: $dir" | ||
lcov --rc lcov_branch_coverage=0 --gcov-tool "$gcov_tool" --directory "$dir" --capture --output-file "$dir/all.info" | ||
lcov --rc lcov_branch_coverage=0 --list "$dir/all.info" | ||
# Upload to codecov | ||
echo "Upload to codecov: $dir" | ||
bash <(curl -s https://codecov.io/bash) -f "$dir/all.info" | ||
done | ||
# Summary | ||
echo "# Coverage" >> $GITHUB_STEP_SUMMARY | ||
echo "" >> $GITHUB_STEP_SUMMARY | ||
echo "[![codecov](https://codecov.io/github/$GITHUB_REPOSITORY/commit/$GITHUB_SHA/graphs/sunburst.svg)](https://codecov.io/github/$GITHUB_REPOSITORY/commit/$GITHUB_SHA)" >> $GITHUB_STEP_SUMMARY | ||
echo "" >> $GITHUB_STEP_SUMMARY | ||
echo "" >> $GITHUB_STEP_SUMMARY | ||
echo "Commit: [![codecov](https://codecov.io/github/$GITHUB_REPOSITORY/commit/$GITHUB_SHA/graph/badge.svg)](https://codecov.io/github/$GITHUB_REPOSITORY/commit/$GITHUB_SHA)" >> $GITHUB_STEP_SUMMARY | ||
echo "" >> $GITHUB_STEP_SUMMARY | ||
echo "Branch: [![codecov](https://codecov.io/github/$GITHUB_REPOSITORY/branch/$GITHUB_REF_NAME/graph/badge.svg)](https://codecov.io/github/$GITHUB_REPOSITORY/commit/$GITHUB_SHA)" >> $GITHUB_STEP_SUMMARY | ||
echo "" >> $GITHUB_STEP_SUMMARY | ||
releases: | ||
needs: [ cpp-matrix, build ] | ||
|
@@ -764,7 +801,7 @@ jobs: | |
uses: alandefreitas/cpp-actions/[email protected] | ||
id: package-install | ||
with: | ||
apt-get: build-essential asciidoctor cmake bzip2 git curl | ||
apt-get: ${{ matrix.install }} | ||
|
||
- name: Check website releases | ||
id: website-releases | ||
|