CI/CD Improvements: - Added Swagger Docs caching with actions/cache@v5 - Dependency-based cache invalidation - GNU tar compatibility for Gitea runners - Template-based Dockerfile generation - Automated coverage badge updates - Version bump automation Workflow Features: - Multi-stage build with caching - BDD and unit test coverage tracking - Separate badges for BDD vs unit tests - Cross-platform compatibility - Automatic badge updates on main branch Files Modified: - .gitea/workflows/ci-cd.yaml - Main workflow with caching - scripts/ci-update-coverage-badge.sh - Badge automation - scripts/ci-version-bump.sh - Version management - scripts/update-all-badges.sh - Comprehensive badge updates Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
62 lines
1.7 KiB
Bash
Executable File
62 lines
1.7 KiB
Bash
Executable File
#!/bin/bash
|
||
# Simple script to update coverage badges in README.md
|
||
# Usage: ./scripts/update-all-badges.sh [bdd_coverage] [unit_coverage]
|
||
# Both parameters are optional - only updates what's provided
|
||
|
||
set -e
|
||
|
||
BDD_COVERAGE=""
|
||
UNIT_COVERAGE=""
|
||
|
||
# Parse arguments (both optional)
|
||
if [ -n "$1" ]; then
|
||
BDD_COVERAGE=$1
|
||
fi
|
||
|
||
if [ -n "$2" ]; then
|
||
UNIT_COVERAGE=$2
|
||
fi
|
||
|
||
echo "🎯 Updating coverage badges..."
|
||
if [ -n "$BDD_COVERAGE" ]; then
|
||
echo " BDD: ${BDD_COVERAGE}%"
|
||
fi
|
||
if [ -n "$UNIT_COVERAGE" ]; then
|
||
echo " Unit: ${UNIT_COVERAGE}%"
|
||
fi
|
||
|
||
# Cross-platform sed command
|
||
# Detect if we're on macOS (BSD sed) or Linux (GNU sed)
|
||
SED_CMD=""
|
||
if [[ "$(uname)" == "Darwin" ]]; then
|
||
# macOS - requires empty string after -i
|
||
SED_CMD="sed -i ''"
|
||
else
|
||
# Linux - standard GNU sed
|
||
SED_CMD="sed -i"
|
||
fi
|
||
|
||
# Update BDD coverage badge if provided
|
||
if [ -n "$BDD_COVERAGE" ] && grep -q "BDD_Coverage" README.md; then
|
||
$SED_CMD "s/BDD_Coverage-[0-9.]\+-%/BDD_Coverage-${BDD_COVERAGE}-%/g" README.md
|
||
echo "✅ BDD coverage badge updated to ${BDD_COVERAGE}%"
|
||
fi
|
||
|
||
# Update Unit coverage badge if provided
|
||
if [ -n "$UNIT_COVERAGE" ] && grep -q "Unit_Coverage" README.md; then
|
||
$SED_CMD "s/Unit_Coverage-[0-9.]\+-%/Unit_Coverage-${UNIT_COVERAGE}-%/g" README.md
|
||
echo "✅ Unit coverage badge updated to ${UNIT_COVERAGE}%"
|
||
fi
|
||
|
||
# Update main coverage badge if BDD coverage provided
|
||
if [ -n "$BDD_COVERAGE" ] && grep -q "coverage-[0-9.]\+-%" README.md; then
|
||
$SED_CMD "s/coverage-[0-9.]\+-%/coverage-${BDD_COVERAGE}-%/g" README.md
|
||
echo "✅ Main coverage badge updated to ${BDD_COVERAGE}%"
|
||
fi
|
||
|
||
if [ -z "$BDD_COVERAGE" ] && [ -z "$UNIT_COVERAGE" ]; then
|
||
echo "ℹ️ No coverage values provided - nothing to update"
|
||
fi
|
||
|
||
echo "🎉 Badge update process completed!"
|