diff --git a/.gitea/workflows/ci-cd.yaml b/.gitea/workflows/ci-cd.yaml index 225fe76..bd2a559 100644 --- a/.gitea/workflows/ci-cd.yaml +++ b/.gitea/workflows/ci-cd.yaml @@ -196,12 +196,22 @@ jobs: export DLC_DATABASE_SSL_MODE=disable ./scripts/run-bdd-tests.sh - # Generate BDD coverage report - go tool cover -func=coverage.out > bdd_coverage.txt + # Debug: Check if coverage file exists + ls -la coverage.out || echo "ERROR: coverage.out not found" - # Extract BDD coverage percentage - BDD_COVERAGE=$(grep "total:" bdd_coverage.txt | grep -oP '\d+\.\d+' | head -1) - echo "BDD Coverage: ${BDD_COVERAGE}%" + # Generate BDD coverage report + if [ -f "coverage.out" ]; then + go tool cover -func=coverage.out > bdd_coverage.txt + + # Extract BDD coverage percentage + BDD_COVERAGE=$(grep "total:" bdd_coverage.txt | grep -oP '\d+\.\d+' | head -1) + echo "BDD Coverage: ${BDD_COVERAGE}%" + else + echo "ERROR: coverage.out file not found after BDD tests" + # Try to find any coverage files + find . -name "*.out" -o -name "coverage*" | head -10 + exit 1 + fi # Update BDD coverage badge export PACKAGES_TOKEN="${{ secrets.PACKAGES_TOKEN }}"