fix(ci): detect silent tool failures
This commit is contained in:
@@ -52,7 +52,10 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
# Run flutter analyze
|
# Run flutter analyze
|
||||||
# Fails on errors or warnings only (info messages are allowed)
|
# Fails on errors or warnings only (info messages are allowed)
|
||||||
flutter analyze 2>&1 | tee analyze_output.txt || true
|
set +e
|
||||||
|
flutter analyze 2>&1 | tee analyze_output.txt
|
||||||
|
analyze_status=${PIPESTATUS[0]}
|
||||||
|
set -e
|
||||||
|
|
||||||
# Check output for errors or warnings
|
# Check output for errors or warnings
|
||||||
if grep -q "error •" analyze_output.txt; then
|
if grep -q "error •" analyze_output.txt; then
|
||||||
@@ -61,6 +64,9 @@ jobs:
|
|||||||
elif grep -q "warning •" analyze_output.txt; then
|
elif grep -q "warning •" analyze_output.txt; then
|
||||||
echo "⚠️ Analysis completed with warnings"
|
echo "⚠️ Analysis completed with warnings"
|
||||||
exit 1
|
exit 1
|
||||||
|
elif [ "$analyze_status" -ne 0 ] && ! grep -q "info •" analyze_output.txt; then
|
||||||
|
echo "❌ Analyzer failed before producing diagnostics (exit $analyze_status)"
|
||||||
|
exit "$analyze_status"
|
||||||
else
|
else
|
||||||
echo "✅ Analysis passed!"
|
echo "✅ Analysis passed!"
|
||||||
exit 0
|
exit 0
|
||||||
|
|||||||
@@ -23,11 +23,20 @@ if ! command -v rsvg-convert &> /dev/null; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! command -v magick &> /dev/null && ! command -v convert &> /dev/null; then
|
if command -v magick &> /dev/null; then
|
||||||
|
IMAGEMAGICK=magick
|
||||||
|
elif command -v convert &> /dev/null; then
|
||||||
|
IMAGEMAGICK=convert
|
||||||
|
else
|
||||||
echo "Error: ImageMagick not found. Install with: brew install imagemagick"
|
echo "Error: ImageMagick not found. Install with: brew install imagemagick"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if ! command -v bc &> /dev/null; then
|
||||||
|
echo "Error: bc not found. Install with: brew install bc"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
# Create temp directory
|
# Create temp directory
|
||||||
mkdir -p "$TEMP_DIR"
|
mkdir -p "$TEMP_DIR"
|
||||||
|
|
||||||
@@ -49,7 +58,7 @@ generate_white_icon() {
|
|||||||
rsvg-convert --keep-aspect-ratio --background-color=transparent "$SVG_SOURCE" -o "$TEMP_DIR/temp_unpadded.png"
|
rsvg-convert --keep-aspect-ratio --background-color=transparent "$SVG_SOURCE" -o "$TEMP_DIR/temp_unpadded.png"
|
||||||
|
|
||||||
# Center the image in a square canvas with transparent padding
|
# Center the image in a square canvas with transparent padding
|
||||||
magick "$TEMP_DIR/temp_unpadded.png" \
|
"$IMAGEMAGICK" "$TEMP_DIR/temp_unpadded.png" \
|
||||||
-resize "${size}x${size}" \
|
-resize "${size}x${size}" \
|
||||||
-gravity center \
|
-gravity center \
|
||||||
-background transparent \
|
-background transparent \
|
||||||
@@ -61,11 +70,11 @@ generate_white_icon() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Convert to white silhouette: extract alpha, fill with white, apply alpha
|
# Convert to white silhouette: extract alpha, fill with white, apply alpha
|
||||||
magick "$TEMP_DIR/temp.png" \
|
"$IMAGEMAGICK" "$TEMP_DIR/temp.png" \
|
||||||
-alpha extract \
|
-alpha extract \
|
||||||
"$TEMP_DIR/alpha_mask.png"
|
"$TEMP_DIR/alpha_mask.png"
|
||||||
|
|
||||||
magick -size "${size}x${size}" xc:white \
|
"$IMAGEMAGICK" -size "${size}x${size}" xc:white \
|
||||||
"$TEMP_DIR/alpha_mask.png" \
|
"$TEMP_DIR/alpha_mask.png" \
|
||||||
-alpha off \
|
-alpha off \
|
||||||
-compose copy-opacity \
|
-compose copy-opacity \
|
||||||
|
|||||||
Reference in New Issue
Block a user