feat(scripts): add automatic gcovr code coverage analysis (#9227)

Signed-off-by: pengyiqiang <pengyiqiang@xiaomi.com>
Co-authored-by: pengyiqiang <pengyiqiang@xiaomi.com>
This commit is contained in:
VIFEX
2025-11-12 09:26:43 +08:00
committed by GitHub
parent 4016f35235
commit c47a21b708
3 changed files with 261 additions and 0 deletions
+10
View File
@@ -135,6 +135,16 @@ jobs:
run: echo "NON_AMD64_BUILD=1" >> $GITHUB_ENV
- name: Run tests
run: python tests/main.py --report --update-image test --auto-clean
- name: Code coverage analysis
run: |
if [ "${{ github.event_name }}" = "pull_request" ]; then
git fetch --no-tags --prune origin ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }}
MB=$(git merge-base ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }})
echo "Merge-base: $MB"
python scripts/check_gcov_coverage.py --commit="${MB}...${{ github.event.pull_request.head.sha }}"
else
python scripts/check_gcov_coverage.py --commit=HEAD
fi
- name: Archive screenshot errors
if: failure()
uses: actions/upload-artifact@v5