Skip to content

Commit 23581a8

Browse files
committed
chore(coverage): add additional coverage file formats for processing
Updated expected and critical files to include new coverage formats for better compatibility with various reporting tools.
1 parent d16f91e commit 23581a8

1 file changed

Lines changed: 21 additions & 4 deletions

File tree

.github/workflows/fortress-coverage.yml

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -797,7 +797,7 @@ jobs:
797797
# Verify outputs were created
798798
echo ""
799799
echo "🔍 Verifying generated outputs..."
800-
EXPECTED_FILES=("index.html" "coverage.html" "coverage.svg")
800+
EXPECTED_FILES=("index.html" "coverage.html" "coverage.svg" "coverage-flat.svg" "coverage-flat-square.svg" "coverage-for-the-badge.svg")
801801
802802
echo ""
803803
echo "📋 Checking main output files:"
@@ -1137,6 +1137,9 @@ jobs:
11371137
"index.html"
11381138
"coverage.html"
11391139
"coverage.svg"
1140+
"coverage-flat.svg"
1141+
"coverage-flat-square.svg"
1142+
"coverage-for-the-badge.svg"
11401143
)
11411144
11421145
# Selectively copy coverage files to avoid nested directory structures
@@ -1188,6 +1191,9 @@ jobs:
11881191
# Copy only essential coverage files, avoiding nested duplication
11891192
COVERAGE_ESSENTIAL_FILES=(
11901193
"coverage.svg"
1194+
"coverage-flat.svg"
1195+
"coverage-flat-square.svg"
1196+
"coverage-for-the-badge.svg"
11911197
"coverage.html"
11921198
"index.html"
11931199
"dashboard.html"
@@ -1407,7 +1413,7 @@ jobs:
14071413
echo ""
14081414
14091415
# Verify critical files exist with detailed reporting
1410-
CRITICAL_FILES=("index.html" "coverage.html" "coverage.svg" ".nojekyll")
1416+
CRITICAL_FILES=("index.html" "coverage.html" "coverage.svg" "coverage-flat.svg" "coverage-flat-square.svg" "coverage-for-the-badge.svg" ".nojekyll")
14111417
echo "🎯 Verifying critical files for GitHub Pages:"
14121418
14131419
ALL_EXIST=true
@@ -1640,13 +1646,24 @@ jobs:
16401646
mkdir -p "$TEMP_STAGING"
16411647
echo "📁 Created temporary staging area: $TEMP_STAGING"
16421648
1649+
# Update gh-pages .gitignore from latest build assets (ensures badge variants are allowed)
1650+
if [[ -f "$DEPLOY_DIR/assets/gh-pages.gitignore" ]]; then
1651+
echo "📋 Updating gh-pages .gitignore from build assets..."
1652+
cp "$DEPLOY_DIR/assets/gh-pages.gitignore" "$TEMP_PAGES_DIR/.gitignore"
1653+
GH_PAGES_GITIGNORE="$TEMP_PAGES_DIR/.gitignore"
1654+
echo "✅ Updated .gitignore with latest coverage file patterns"
1655+
else
1656+
echo "⚠️ No gh-pages.gitignore found in assets, using existing"
1657+
GH_PAGES_GITIGNORE="$TEMP_PAGES_DIR/.gitignore"
1658+
fi
1659+
16431660
# Update root files (main branch deployments) with filtering
16441661
source /tmp/branch_helpers.sh
16451662
if is_main_branch "$BRANCH_NAME"; then
16461663
echo "📋 Updating root coverage files for main branch (with filtering)..."
16471664
16481665
# Define allowed root files explicitly
1649-
ALLOWED_ROOT_FILES=("index.html" "coverage.html" "coverage.svg" ".nojekyll" "data" "assets")
1666+
ALLOWED_ROOT_FILES=("index.html" "coverage.html" "coverage.svg" "coverage-flat.svg" "coverage-flat-square.svg" "coverage-for-the-badge.svg" ".nojekyll" "data" "assets")
16501667
16511668
# Copy only allowed root files
16521669
for file in "${ALLOWED_ROOT_FILES[@]}"; do
@@ -1711,7 +1728,7 @@ jobs:
17111728
rm -rf "$TEMP_STAGING"/*
17121729
17131730
# Define allowed branch files
1714-
ALLOWED_BRANCH_FILES=("index.html" "coverage.html" "coverage.svg" "data" "assets")
1731+
ALLOWED_BRANCH_FILES=("index.html" "coverage.html" "coverage.svg" "coverage-flat.svg" "coverage-flat-square.svg" "coverage-for-the-badge.svg" "data" "assets")
17151732
17161733
# Copy branch-specific files from deployment directory to staging first
17171734
if [[ -d "$DEPLOY_DIR/coverage/branch/$BRANCH_NAME" ]]; then

0 commit comments

Comments
 (0)