Update .gitea/workflows/test-skins.yml
All checks were successful
Generate Skin previews, OSK files and per skin documentation / Full CI/CD Pipeline (push) Successful in 10s

This commit is contained in:
2025-11-23 14:06:28 +01:00
parent 1cd586bd78
commit a21a4c958e

View File

@@ -160,7 +160,7 @@ jobs:
current_skin="${BASH_REMATCH[1]}"
fi
# Check for internal markdown links
if [[ "$line" =~ \]\((/[^)]+\.md)\) ]]; then
if [[ "$line" =~ \]\((/[^)]+\.md) ]]; then
link="${BASH_REMATCH[1]}"
echo "$current_skin|$link" >> internal_links_with_context.txt
fi
@@ -172,24 +172,31 @@ jobs:
echo ""
# Group by skin and check
declare -A skin_all_files
declare -A skin_missing_files
checked_count=0
total_missing=0
while IFS='|' read -r skin link; do
checked_count=$((checked_count + 1))
# Decode URL-encoded characters
decoded_link=$(echo "$link" | sed 's/%20/ /g' | sed 's/%23/#/g' | sed 's/%28/(/g' | sed 's/%29/)/g' | sed 's/%E2%80%A2/•/g' | sed 's/%E1%9A%96/ᚖ/g' | sed 's/%E3%80%8A/《/g' | sed 's/%E3%80%8B/》/g' | sed 's/%E3%80%8E/『/g' | sed 's/%E3%80%8F/』/g' | sed 's/%E2%9B%94/⛔/g' | sed 's/%E2%9C%A8/✨/g' | sed 's/%7B/{/g' | sed 's/%7D/}//g' | sed 's/%2B/+/g' | sed 's/%E3%83%86/テ/g' | sed 's/%E3%83%B3/ン/g' | sed 's/%E3%83%8D/ネ/g' | sed 's/%E3%82%B9/ス/g' | sed 's/%E3%82%A4/イ/g' | sed 's/%E3%83%BB/・/g' | sed 's/%E3%83%95/フ/g' | sed 's/%E3%83%AA/リ/g' | sed 's/%E3%83%BC/ー/g' | sed 's/%E3%83%8A/ナ/g' | sed 's/%5B/[/g' | sed 's/%5D/]/g')
decoded_link=$(echo "$link" | sed 's/%20/ /g' | sed 's/%23/#/g' | sed 's/%28/(/g' | sed 's/%29/)/g' | sed 's/%E2%80%A2/•/g' | sed 's/%E1%9A%96/ᚖ/g' | sed 's/%E3%80%8A/《/g' | sed 's/%E3%80%8B/》/g' | sed 's/%E3%80%8E/『/g' | sed 's/%E3%80%8F/』/g' | sed 's/%E2%9B%94/⛔/g' | sed 's/%E2%9C%A8/✨/g' | sed 's/%7B/{/g' | sed 's/%7D/}/g' | sed 's/%2B/+/g' | sed 's/%E3%83%86/テ/g' | sed 's/%E3%83%B3/ン/g' | sed 's/%E3%83%8D/ネ/g' | sed 's/%E3%82%B9/ス/g' | sed 's/%E3%82%A4/イ/g' | sed 's/%E3%83%BB/・/g' | sed 's/%E3%83%95/フ/g' | sed 's/%E3%83%AA/リ/g' | sed 's/%E3%83%BC/ー/g' | sed 's/%E3%83%8A/ナ/g' | sed 's/%5B/[/g' | sed 's/%5D/]/g')
# Remove leading slash to make it relative
file_path="${decoded_link#/}"
if [ -z "$skin" ]; then
skin="General"
fi
# Check if file exists
if [ ! -f "$file_path" ]; then
if [ -z "$skin" ]; then
skin="General"
fi
if [ -f "$file_path" ]; then
skin_all_files["$skin"]+="✅ $file_path"$'\n'
else
skin_all_files["$skin"]+="❌ $file_path"$'\n'
skin_missing_files["$skin"]+="$file_path"$'\n'
total_missing=$((total_missing + 1))
fi
done < internal_links_with_context.txt
@@ -197,28 +204,26 @@ jobs:
echo ""
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
if [ ${#skin_missing_files[@]} -gt 0 ]; then
total_missing=0
for skin in "${!skin_missing_files[@]}"; do
count=$(echo "${skin_missing_files[$skin]}" | grep -c . || true)
total_missing=$((total_missing + count))
done
echo "❌ RESULT: $total_missing of $total_count internal markdown files are MISSING"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo ""
for skin in "${!skin_missing_files[@]}"; do
echo "📄 $skin:"
echo "${skin_missing_files[$skin]}" | while IFS= read -r file; do
[ -n "$file" ] && echo " ❌ $file"
done
echo ""
done
exit 1
if [ $total_missing -gt 0 ]; then
echo "⚠️ RESULT: $total_missing of $total_count internal markdown files are MISSING"
else
echo "✅ RESULT: All $total_count internal markdown files exist!"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
fi
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo ""
# Display all links grouped by skin
for skin in "${!skin_all_files[@]}"; do
echo "📄 $skin:"
echo "${skin_all_files[$skin]}" | while IFS= read -r line; do
[ -n "$line" ] && echo " $line"
done
echo ""
done
# Exit with error if files are missing
if [ $total_missing -gt 0 ]; then
exit 1
fi
- name: Check for broken image references
@@ -257,8 +262,10 @@ jobs:
echo ""
# Group by skin and check
declare -A skin_all_images
declare -A skin_missing_images
checked_count=0
total_missing=0
while IFS='|' read -r skin link; do
checked_count=$((checked_count + 1))
@@ -271,12 +278,17 @@ jobs:
decoded_link="${decoded_link#/}"
fi
if [ -z "$skin" ]; then
skin="General"
fi
# Check if file exists
if [ ! -f "$decoded_link" ]; then
if [ -z "$skin" ]; then
skin="General"
fi
if [ -f "$decoded_link" ]; then
skin_all_images["$skin"]+="✅ $decoded_link"$'\n'
else
skin_all_images["$skin"]+="❌ $decoded_link"$'\n'
skin_missing_images["$skin"]+="$decoded_link"$'\n'
total_missing=$((total_missing + 1))
fi
done < image_links_with_context.txt
@@ -284,27 +296,22 @@ jobs:
echo ""
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
if [ ${#skin_missing_images[@]} -gt 0 ]; then
total_missing=0
for skin in "${!skin_missing_images[@]}"; do
count=$(echo "${skin_missing_images[$skin]}" | grep -c . || true)
total_missing=$((total_missing + count))
done
if [ $total_missing -gt 0 ]; then
echo "⚠️ RESULT: $total_missing of $total_count image files are MISSING (non-blocking)"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo ""
for skin in "${!skin_missing_images[@]}"; do
echo "🖼️ $skin:"
echo "${skin_missing_images[$skin]}" | while IFS= read -r file; do
[ -n "$file" ] && echo " ❌ $file"
done
echo ""
done
# Don't fail the workflow for missing images, just warn
exit 0
else
echo "✅ RESULT: All $total_count image files exist!"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
fi
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo ""
# Display all images grouped by skin
for skin in "${!skin_all_images[@]}"; do
echo "🖼️ $skin:"
echo "${skin_all_images[$skin]}" | while IFS= read -r line; do
[ -n "$line" ] && echo " $line"
done
echo ""
done
# Don't fail the workflow for missing images, just warn
exit 0