8000 Deleting all images that have passed tests before upload by Impaler343 · Pull Request #27882 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Deleting all images that have passed tests before upload #27882

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,39 @@ jobs:
--maxfail=50 --timeout=300 --durations=25 \
--cov-report=xml --cov=lib --log-level=DEBUG --color=yes

- name: Cleanup non-failed image files
run: |
function remove_files() {
local extension=$1
find ./result_images -type f -name "*-expected*.$extension" | while read file; do
if [[ $file == *"-expected_pdf"* ]]; then
base=${file%-expected_pdf.$extension}_pdf
elif [[ $file == *"-expected_eps"* ]]; then
base=${file%-expected_eps.$extension}_eps
elif [[ $file == *"-expected_svg"* ]]; then
base=${file%-expected_svg.$extension}_svg
else
base=${file%-expected.$extension}
fi
if [[ ! -e "${base}-failed-diff.$extension" ]]; then
if [[ -e "$file" ]]; then
rm "$file"
echo "Removed $file"
fi
if [[ -e "${base}.$extension" ]]; then
rm "${base}.$extension"
echo " Removed ${base}.$extension"
fi
fi
done
}

remove_files "png"; remove_files "svg"; remove_files "pdf"; remove_files "eps";

if [ "$(find ./result_images -mindepth 1 -type d)" ]; then
find ./result_images/* -type d -empty -delete
fi

- name: Filter C coverage
run: |
if [[ "${{ runner.os }}" != 'macOS' ]]; then
Expand Down
0