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