9595          fetch-depth : 0 
9696          persist-credentials : false 
9797
98+       - name : Preload test images 
99+         run : | 
100+           git config --global user.name 'Matplotlib' 
101+           git config --global user.email '[email protected] ' 102+           git fetch https://github.com/QuLogic/matplotlib.git text-overhaul-figures:text-overhaul-figures 
103+           git merge --no-commit text-overhaul-figures || true  
104+           # If there are any conflicts in baseline images, then pick "ours", 
105+           # which should be the updated images in the PR. 
106+           conflicts=$(git diff --name-only --diff-filter=U \ 
107+                       lib/matplotlib/tests/baseline_images \ 
108+                       lib/mpl_toolkits/*/tests/baseline_images) 
109+           if [ -n "${conflicts}" ]; then 
110+             git checkout --ours -- ${conflicts} 
111+             git add -- ${conflicts} 
112+           fi 
113+           # If committing fails, there were conflicts other than the baseline images, 
114+           # which should not be allowed to happen, and should fail the build. 
115+           git commit -m 'Preload test images from branch text-overhaul-figures' 
116+ 
98117name : Set up Python ${{ matrix.python-version }} 
99118        uses : actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065   #  v5.6.0
100119        with :
@@ -346,13 +365,15 @@ jobs:
346365        run : | 
347366          function remove_files() { 
348367              local extension=$1 
349-               find ./result_images -type f - name "*-expected*.$extension" | while read file; do 
368+               find ./result_images -name "*-expected*.$extension" | while read file; do 
350369                  if [[ $file == *"-expected_pdf"* ]]; then 
351370                      base=${file%-expected_pdf.$extension}_pdf 
352371                  elif [[ $file == *"-expected_eps"* ]]; then 
353372                      base=${file%-expected_eps.$extension}_eps 
354373                  elif [[ $file == *"-expected_svg"* ]]; then 
355374                      base=${file%-expected_svg.$extension}_svg 
375+                   elif [[ $file == *"-expected_gif"* ]]; then 
376+                       base=${file%-expected_gif.$extension}_gif 
356377                  else 
357378                      base=${file%-expected.$extension} 
358379                  fi 
@@ -369,7 +390,7 @@ jobs:
369390              done 
370391          } 
371392
372-           remove_files "png"; remove_files "svg"; remove_files "pdf"; remove_files "eps"; 
393+           remove_files "png"; remove_files "svg"; remove_files "pdf"; remove_files "eps"; remove_files "gif";  
373394
374395          if [ "$(find ./result_images -mindepth 1 -type d)" ]; then 
375396              find ./result_images/* -type d -empty -delete 
0 commit comments