This commit is contained in:
parent
9baabc205a
commit
a4accf4070
@ -53,23 +53,38 @@ jobs:
|
||||
- name: Generate coverage badges
|
||||
run: |
|
||||
COMMIT_HASH=$(git rev-parse --short HEAD)
|
||||
echo "Generating badges for commit: ${COMMIT_HASH}"
|
||||
|
||||
# Generate test coverage badge or error badge
|
||||
if [ "${{ steps.pytest.outcome }}" == "success" ] && [ -f coverage.json ]; then
|
||||
echo "Generating successful test coverage badge..."
|
||||
coverage-badge -o coverage-${COMMIT_HASH}.svg
|
||||
echo "Test coverage badge created: coverage-${COMMIT_HASH}.svg"
|
||||
else
|
||||
# Create error badge for test coverage
|
||||
echo "Generating error badge for test coverage (pytest outcome: ${{ steps.pytest.outcome }})"
|
||||
curl -o coverage-${COMMIT_HASH}.svg "https://img.shields.io/badge/coverage-error-red.svg"
|
||||
echo "Error test coverage badge created: coverage-${COMMIT_HASH}.svg"
|
||||
fi
|
||||
|
||||
# Generate docs coverage badge or error badge
|
||||
if [ "${{ steps.docs.outcome }}" == "success" ]; then
|
||||
echo "Generating successful docs coverage badge..."
|
||||
interrogate --generate-badge coverage-docs-${COMMIT_HASH}.svg pyWebLayout/
|
||||
echo "Docs coverage badge created: coverage-docs-${COMMIT_HASH}.svg"
|
||||
else
|
||||
# Create error badge for docs coverage
|
||||
echo "Generating error badge for docs coverage (docs outcome: ${{ steps.docs.outcome }})"
|
||||
curl -o coverage-docs-${COMMIT_HASH}.svg "https://img.shields.io/badge/docs-error-red.svg"
|
||||
echo "Error docs coverage badge created: coverage-docs-${COMMIT_HASH}.svg"
|
||||
fi
|
||||
|
||||
# List all SVG files created
|
||||
echo "SVG files in directory:"
|
||||
ls -la *.svg || echo "No SVG files found"
|
||||
echo "Current working directory:"
|
||||
pwd
|
||||
echo "All files in current directory:"
|
||||
ls -la
|
||||
|
||||
- name: Generate coverage reports
|
||||
if: steps.pytest.outcome == 'success'
|
||||
run: |
|
||||
@ -90,6 +105,17 @@ jobs:
|
||||
print('No coverage data found')
|
||||
"
|
||||
|
||||
- name: Debug artifacts before upload
|
||||
run: |
|
||||
echo "Files matching coverage patterns:"
|
||||
ls -la coverage-*.svg || echo "No coverage-*.svg files found"
|
||||
ls -la coverage-docs-*.svg || echo "No coverage-docs-*.svg files found"
|
||||
ls -la coverage.json || echo "No coverage.json found"
|
||||
ls -la coverage-summary.txt || echo "No coverage-summary.txt found"
|
||||
ls -la htmlcov/ || echo "No htmlcov directory found"
|
||||
echo "All files in current directory:"
|
||||
ls -la
|
||||
|
||||
- name: Upload coverage artifacts
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
|
||||
@ -4,8 +4,8 @@
|
||||
|
||||
| Badge | Description |
|
||||
|-------|-------------|
|
||||
|  | **Test Coverage** - Percentage of code covered by unit tests |
|
||||
|  | **Documentation Coverage** - Percentage of code with docstrings |
|
||||
|  | **Test Coverage** - Percentage of code covered by unit tests |
|
||||
|  | **Documentation Coverage** - Percentage of code with docstrings |
|
||||
|  | **Build Status** - Current CI/CD pipeline status |
|
||||
|  | **License** - Project licensing information |
|
||||
A Python library for HTML-like layout and rendering.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user