@@ -23,16 +23,49 @@ runs:
2323 id : check-screenshot
2424 shell : bash
2525 run : |
26- SS_FILE="$HOME/output/screenshots/${{ inputs.platform }}-tests-completed.png"
26+ # First try the expected location with new naming
27+ SS_FILE="$HOME/output/screenshots/${{ inputs.platform }}-test-result.png"
28+
2729 if [ -f "$SS_FILE" ]; then
2830 echo "exists=true" >> $GITHUB_OUTPUT
2931 echo "file_path=$SS_FILE" >> $GITHUB_OUTPUT
3032 echo "Screenshot found at $SS_FILE"
3133 else
32- echo "exists=false" >> $GITHUB_OUTPUT
33- echo "Screenshot not found at $SS_FILE"
34- echo "Listing output directory contents:"
35- ls -lR $HOME/output/ || echo "Output directory does not exist"
34+ # If not found, look in the timestamped directories
35+ echo "Screenshot not found at expected location: $SS_FILE"
36+ echo "Searching for screenshots in timestamped directories..."
37+
38+ # Find the most recent timestamped directory
39+ LATEST_DIR=$(find $HOME/output -maxdepth 1 -type d -name "20*" 2>/dev/null | sort -r | head -1)
40+
41+ if [ -n "$LATEST_DIR" ]; then
42+ echo "Found timestamped directory: $LATEST_DIR"
43+
44+ # Look for screenshot matching our naming pattern (Maestro may add emojis/timestamps to the filename)
45+ # We use the name we specified: ${PLATFORM}-test-result
46+ SCREENSHOT=$(find "$LATEST_DIR" -name "*${{ inputs.platform }}-test-result*.png" 2>/dev/null | head -1)
47+
48+ if [ -z "$SCREENSHOT" ]; then
49+ # Fallback: look for any screenshot file
50+ echo "No platform-specific screenshot found, looking for any screenshot..."
51+ SCREENSHOT=$(find "$LATEST_DIR" -name "screenshot-*.png" 2>/dev/null | head -1)
52+ fi
53+
54+ if [ -n "$SCREENSHOT" ] && [ -f "$SCREENSHOT" ]; then
55+ echo "exists=true" >> $GITHUB_OUTPUT
56+ echo "file_path=$SCREENSHOT" >> $GITHUB_OUTPUT
57+ echo "Screenshot found at $SCREENSHOT"
58+ else
59+ echo "exists=false" >> $GITHUB_OUTPUT
60+ echo "No screenshots found in $LATEST_DIR"
61+ ls -la "$LATEST_DIR" || true
62+ fi
63+ else
64+ echo "exists=false" >> $GITHUB_OUTPUT
65+ echo "No timestamped directories found"
66+ echo "Listing output directory contents:"
67+ ls -lR $HOME/output/ || echo "Output directory does not exist"
68+ fi
3669 fi
3770
3871 - name : Upload screenshot to ImgBB
0 commit comments