Skip to content
Merged
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
33 changes: 28 additions & 5 deletions .github/workflows/coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: Coverage
permissions:
contents: write
pull-requests: write
pages: write
id-token: write
on:
push:
branches:
Expand All @@ -11,6 +13,9 @@ on:
- opened
- synchronize
- reopened
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
Linux:
strategy:
Expand Down Expand Up @@ -53,30 +58,48 @@ jobs:
- name: Merge coverages
run: |
LCOV_FILES=$(find coverage-artifacts -name "lcov.info" -type f)

if [ -z "$LCOV_FILES" ]; then
echo "No lcov.info files found in the artifacts!"
exit 1
fi

CMD="lcov"
for LCOV_FILE in $LCOV_FILES; do
echo "Adding coverage file: $LCOV_FILE"
CMD+=" -a $LCOV_FILE"
done
CMD+=" -o lcov.info"

echo "Executing: $CMD"
eval $CMD

if [ ! -f "lcov.info" ]; then
echo "Failed to generate merged lcov.info file!"
exit 1
fi

echo "Successfully merged $(echo $LCOV_FILES | wc -w) coverage files."
- name: Generate HTML report
run: |
genhtml lcov.info -o coverage
- name: Report coverage
uses: k1LoW/octocov-action@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
config: .github/octocov.yml
- name: Upload pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: coverage
Deploy:
needs: Coverage
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
Loading