Skip to content

Commit

Permalink
include screenshots in summary
Browse files Browse the repository at this point in the history
  • Loading branch information
vpetersson committed Dec 7, 2024
1 parent 5ca88bc commit 87079f4
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,16 @@ jobs:
jq -r '"| \(.numTotalTests) | \(.numPassedTests) | \(.numFailedTests) | \(.numPendingTests) |"' visual-test-results.json >> $GITHUB_STEP_SUMMARY
fi
# Show screenshots in summary
echo "## Screenshots" >> $GITHUB_STEP_SUMMARY
for img in __image_snapshots__/*.png; do
name=$(basename "$img" | sed 's/ci-//' | sed 's/-1.png//')
echo "### $name" >> $GITHUB_STEP_SUMMARY
echo "<details><summary>View Screenshot</summary>" >> $GITHUB_STEP_SUMMARY
echo "<img src=\"data:image/png;base64,$(base64 -w 0 "$img")\" width=\"800\">" >> $GITHUB_STEP_SUMMARY
echo "</details>" >> $GITHUB_STEP_SUMMARY
done
# Create a flat directory for artifacts
mkdir -p artifacts
cp __image_snapshots__/*.png artifacts/
Expand Down

0 comments on commit 87079f4

Please sign in to comment.