added doc and text coverage

This commit is contained in:
2025-06-07 15:39:18 +02:00
parent b424c2d831
commit 624f92b8f9
3 changed files with 239 additions and 2 deletions
+50 -2
View File
@@ -40,9 +40,57 @@ jobs:
- name: Run tests with pytest
run: |
# Run tests with coverage
python -m pytest tests/ -v --cov=pyWebLayout --cov-report=term-missing
python -m pytest tests/ -v --cov=pyWebLayout --cov-report=term-missing --cov-report=json --cov-report=html
- name: Generate test coverage badge
run: |
# Install coverage-badge for generating badges
pip install coverage-badge
# Generate coverage badge from coverage data
coverage-badge -o coverage.svg
- name: Check documentation coverage
run: |
# Install interrogate for documentation coverage
pip install interrogate
# Generate documentation coverage report and badge
interrogate -v --ignore-init-method --ignore-init-module --ignore-magic --ignore-private --ignore-property-decorators --ignore-semiprivate --fail-under=80 --generate-badge coverage-docs.svg pyWebLayout/
- name: Generate coverage reports
run: |
# Generate coverage summary for README
python -c "
import json
import os
# Read coverage data
if os.path.exists('coverage.json'):
with open('coverage.json', 'r') as f:
coverage_data = json.load(f)
total_coverage = round(coverage_data['totals']['percent_covered'], 1)
# Create coverage summary file
with open('coverage-summary.txt', 'w') as f:
f.write(f'{total_coverage}%')
print(f'Test Coverage: {total_coverage}%')
else:
print('No coverage data found')
"
- name: Upload coverage artifacts
uses: actions/upload-artifact@v3
with:
name: coverage-reports
path: |
coverage.svg
coverage-docs.svg
htmlcov/
coverage.json
coverage-summary.txt
- name: Test package installation
run: |
# Test that the package can be imported
python -c "import pyWebLayout; print('Package imported successfully')"
python -c "import pyWebLayout; print('Package imported successfully')"