Skip to content

The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:

Upload only failing screenshots in the Loki report artifact (#85874)

John Swanson2768e035722c
diff --git a/.github/workflows/loki.yml b/.github/workflows/loki.yml
index a54e70d5827..085c302e594 100644
--- a/.github/workflows/loki.yml
+++ b/.github/workflows/loki.yml
@@ -105,6 +105,21 @@ jobs:
if: failure()
run: bun run test-visual:loki-report
+ # Keep the artifact small: drop screenshots of passing stories, keeping each failed story's
+ # current/reference/difference images, and current images of stories with no reference yet.
+ - name: Remove passing screenshots
+ if: failure()
+ working-directory: .loki
+ run: |
+ shopt -s nullglob
+ for f in current/*.png; do
+ name="${f#current/}"
+ if [ ! -e "difference/$name" ] && [ -e "reference/$name" ]; then rm "$f"; fi
+ done
+ for f in reference/*.png; do
+ [ -e "difference/${f#reference/}" ] || rm "$f"
+ done
+
- name: Upload Artifact
id: artifact-upload-step
if: failure()