Skip to content

Commit 938b158

Browse files
committed
ci: Preload existing test images from text-overhaul-figures branch
This allows checking that there are no _new_ failures, without committing the new figures to the repo until the branch is complete.
1 parent bb9aae4 commit 938b158

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

.github/workflows/tests.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,25 @@ jobs:
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 'nobody@matplotlib.org'
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 this 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+
98117
- name: Set up Python ${{ matrix.python-version }}
99118
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
100119
with:

0 commit comments

Comments
 (0)