@@ -192,13 +192,18 @@ jobs:
192192 # Step 11: Check memory footprint
193193 - name : Check memory footprint
194194 run : |
195- INITIAL_MEM=$(grep -oP '(?<=Initial: )[0-9.]+(?= MB)' reports/performance_py${{ matrix.python-version }}.txt || echo "N/A")
196- FINAL_MEM=$(grep -oP '(?<=Final: )[0-9.]+(?= MB)' reports/performance_py${{ matrix.python-version }}.txt || echo "N/A")
197- DELTA_MEM=$(grep -oP '(?<=Delta: )[0-9.]+(?= MB)' reports/performance_py${{ matrix.python-version }}.txt || echo "N/A")
198- echo "## Memory Usage (Py ${{ matrix.python-version }})" >> $GITHUB_STEP_SUMMARY
199- echo "- $INITIAL_MEM MB initial memory" >> $GITHUB_STEP_SUMMARY
200- echo "- $FINAL_MEM MB final memory" >> $GITHUB_STEP_SUMMARY
201- echo "- $DELTA_MEM MB memory increase" >> $GITHUB_STEP_SUMMARY
195+ if [[ "${{ matrix.python-version }}" == "3.10" ]]; then
196+ INITIAL_MEM=$(grep -oP '(?<=Initial: )[0-9.]+(?= MB)' reports/performance_py${{ matrix.python-version }}.txt || echo "N/A")
197+ FINAL_MEM=$(grep -oP '(?<=Final: )[0-9.]+(?= MB)' reports/performance_py${{ matrix.python-version }}.txt || echo "N/A")
198+ DELTA_MEM=$(grep -oP '(?<=Delta: )[0-9.]+(?= MB)' reports/performance_py${{ matrix.python-version }}.txt || echo "N/A")
199+ echo "## Memory Usage (Py ${{ matrix.python-version }})" >> $GITHUB_STEP_SUMMARY
200+ echo "- $INITIAL_MEM MB initial memory" >> $GITHUB_STEP_SUMMARY
201+ echo "- $FINAL_MEM MB final memory" >> $GITHUB_STEP_SUMMARY
202+ echo "- $DELTA_MEM MB memory increase" >> $GITHUB_STEP_SUMMARY
203+ else
204+ echo "## Memory Usage (Py ${{ matrix.python-version }})" >> $GITHUB_STEP_SUMMARY
205+ echo "- Memory metrics only available for Python 3.10" >> $GITHUB_STEP_SUMMARY
206+ fi
202207
203208 # Step 12: Test GitHub secrets integration
204209 - name : Test with GitHub Secrets Environment
@@ -308,16 +313,9 @@ jobs:
308313 </table>
309314 </div>
310315
311- <div class="card">
312- <h2>Performance Metrics</h2>
313- <div class="metrics">
314- <pre>$(cat ../performance_py${{ matrix.python-version }}.txt | head -n 30 || echo "Performance metrics not available")</pre>
315- </div>
316- </div>
317-
318316 <div class="card">
319317 <h2>Coverage Report</h2>
320- <p><a href="../../ htmlcov/index.html">HTML Coverage Report</a></p>
318+ <p><a href="../htmlcov/index.html">HTML Coverage Report</a></p>
321319 </div>
322320
323321 <p class="timestamp">Generated: $(date -u "+%Y-%m-%d %H:%M:%S UTC")</p>
@@ -460,6 +458,38 @@ jobs:
460458 fi
461459 echo "Report copied on $(date)" > site/htmlcov/timestamp.txt
462460
461+ # Prepare performance metrics for reports
462+ - name : Prepare performance metrics for reports
463+ run : |
464+ # Create directory for extracted metrics
465+ mkdir -p site/extracted_metrics
466+
467+ # Extract performance metrics from each version's artifacts
468+ for version in "3.8" "3.10" "3.11"; do
469+ echo "Processing metrics for Python $version..."
470+
471+ # Look for performance metrics file
472+ PERF_FILE=""
473+ if [ -f "site/reports/html/$version/reports/performance_py$version.txt" ]; then
474+ PERF_FILE="site/reports/html/$version/reports/performance_py$version.txt"
475+ elif [ -f "site/reports/html/$version/performance_py$version.txt" ]; then
476+ PERF_FILE="site/reports/html/$version/performance_py$version.txt"
477+ fi
478+
479+ # Extract the metrics or create placeholder
480+ if [ -n "$PERF_FILE" ]; then
481+ echo "Found performance metrics at $PERF_FILE"
482+ head -n 30 "$PERF_FILE" > "site/extracted_metrics/performance_py$version.txt"
483+ else
484+ echo "No performance metrics found for Python $version"
485+ if [ "$version" == "3.10" ]; then
486+ echo "Performance metrics not available for Python $version (expected for Python 3.10)" > "site/extracted_metrics/performance_py$version.txt"
487+ else
488+ echo "Performance metrics only collected for Python 3.10" > "site/extracted_metrics/performance_py$version.txt"
489+ fi
490+ fi
491+ done
492+
463493 # Create a consolidated index page that links to all version-specific reports
464494 - name : Create main index
465495 run : |
@@ -562,6 +592,12 @@ jobs:
562592 <h2>Test Results</h2>
563593 <p><a href="reports/html/pytest_report_$version.html">View Detailed Test Results</a></p>
564594 </div>
595+ <div class="card">
596+ <h2>Performance Metrics</h2>
597+ <div class="metrics">
598+ <pre>$(cat site/extracted_metrics/performance_py$version.txt)</pre>
599+ </div>
600+ </div>
565601 <p><a href="../../../index.html">Back to main page</a></p>
566602 </body>
567603 </html>
0 commit comments