8000 Merge pull request #27882 from Impaler343/fail-filter · matplotlib/matplotlib@7fbdbf3 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7fbdbf3

Browse files
authored
Merge pull request #27882 from Impaler343/fail-filter
Deleting all images that have passed tests before upload
2 parents d45dfbb + 8883d69 commit 7fbdbf3

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

.github/workflows/tests.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,39 @@ jobs:
314314
--maxfail=50 --timeout=300 --durations=25 \
315315
--cov-report=xml --cov=lib --log-level=DEBUG --color=yes
316316
317+
- name: Cleanup non-failed image files
318+
run: |
319+
function remove_files() {
320+
local extension=$1
321+
find ./result_images -type f -name "*-expected*.$extension" | while read file; do
322+
if [[ $file == *"-expected_pdf"* ]]; then
323+
base=${file%-expected_pdf.$extension}_pdf
324+
elif [[ $file == *"-expected_eps"* ]]; then
325+
base=${file%-expected_eps.$extension}_eps
326+
elif [[ $file == *"-expected_svg"* ]]; then
327+
base=${file%-expected_svg.$extension}_svg
328+
else
329+
base=${file%-expected.$extension}
330+
fi
331+
if [[ ! -e "${base}-failed-diff.$extension" ]]; then
332+
if [[ -e "$file" ]]; then
333+
rm "$file"
334+
echo "Removed $file"
335+
fi
336+
if [[ -e "${base}.$extension" ]]; then
337+
rm "${base}.$extension"
338+
echo " Removed ${base}.$extension"
339+
fi
340+
fi
341+
done
342+
}
343+
344+
remove_files "png"; remove_files "svg"; remove_files "pdf"; remove_files "eps";
345+
346+
if [ "$(find ./result_images -mindepth 1 -type d)" ]; then
347+
find ./result_images/* -type d -empty -delete
348+
fi
349+
317350
- name: Filter C coverage
318351
run: |
319352
if [[ "${{ runner.os }}" != 'macOS' ]]; then

0 commit comments

Comments
 (0)
0