Skip to content

Commit 783ba76

Browse files
authored
Add Ubuntu 24.04 valgrind (#272)
2 parents e3ecdef + 17df2c5 commit 783ba76

19 files changed

Lines changed: 5508 additions & 3 deletions

File tree

.github/workflows/build.yml

Lines changed: 122 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ jobs:
3333
- "debian-13-trixie-amd64"
3434
- "fedora-44-amd64"
3535
- "gentoo"
36-
- "ubuntu-22.04-jammy-amd64-valgrind"
3736
- "ubuntu-24.04-noble-amd64"
3837
- "ubuntu-26.04-resolute-amd64"
3938
# has a dependency on the test image
@@ -118,8 +117,129 @@ jobs:
118117
if: always()
119118
run: sudo chown -R "$(id -u)" "$(pwd)"
120119

120+
# The valgrind suite is slow, so build its image once, test it across
121+
# parallel split jobs, and push only after every split has passed.
122+
build-valgrind:
123+
name: ubuntu-24.04-noble-amd64-valgrind build
124+
runs-on: ubuntu-latest
125+
steps:
126+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
127+
with:
128+
persist-credentials: false
129+
submodules: true
130+
131+
- name: Prepare build
132+
run: |
133+
git submodule update --remote Pillow
134+
cd Pillow && git checkout main
135+
136+
- name: Build image
137+
run: |
138+
cd ubuntu-24.04-noble-amd64-valgrind && make update
139+
if [[ -n "$DOCKER_USERNAME" ]]; then
140+
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
141+
fi
142+
make build BRANCH=main
143+
env:
144+
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
145+
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
146+
147+
- name: Save image
148+
run: make -C ubuntu-24.04-noble-amd64-valgrind save BRANCH=main
149+
150+
- name: Upload image
151+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
152+
with:
153+
name: ubuntu-24.04-noble-amd64-valgrind
154+
path: ubuntu-24.04-noble-amd64-valgrind/image.tar
155+
retention-days: 1
156+
157+
test-valgrind:
158+
name: ubuntu-24.04-noble-amd64-valgrind ${{ matrix.split }}
159+
needs: build-valgrind
160+
runs-on: ubuntu-latest
161+
strategy:
162+
fail-fast: false
163+
matrix:
164+
split: [1, 2, 3, 4]
165+
steps:
166+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
167+
with:
168+
persist-credentials: false
169+
submodules: true
170+
171+
- name: Download image
172+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
173+
with:
174+
name: ubuntu-24.04-noble-amd64-valgrind
175+
176+
- name: Prepare test
177+
run: |
178+
git submodule update --remote Pillow
179+
(cd Pillow && git checkout main)
180+
sudo chown -R 1001 "$(pwd)"
181+
182+
- name: Load image
183+
run: |
184+
if [[ -n "$DOCKER_USERNAME" ]]; then
185+
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
186+
fi
187+
docker load -i image.tar
188+
env:
189+
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
190+
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
191+
192+
- name: Test image
193+
run: |
194+
cd ubuntu-24.04-noble-amd64-valgrind
195+
make test BRANCH=main
196+
env:
197+
SPLIT_INDEX: ${{ matrix.split }}
198+
SPLIT_COUNT: ${{ strategy.job-total }}
199+
200+
- name: Post test
201+
if: always()
202+
run: sudo chown -R "$(id -u)" "$(pwd)"
203+
204+
push-valgrind:
205+
name: Push ubuntu-24.04-noble-amd64-valgrind
206+
needs: test-valgrind
207+
runs-on: ubuntu-latest
208+
steps:
209+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
210+
with:
211+
persist-credentials: false
212+
213+
- name: Download image
214+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
215+
with:
216+
name: ubuntu-24.04-noble-amd64-valgrind
217+
218+
- name: Load image
219+
id: build
220+
run: |
221+
if [[ -n "$DOCKER_USERNAME" ]]; then
222+
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin && echo "logged_in=true" >> "$GITHUB_OUTPUT"
223+
fi
224+
docker load -i image.tar
225+
env:
226+
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
227+
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
228+
229+
- name: Log image size
230+
run: |
231+
docker images
232+
233+
- name: Push image
234+
if: "steps.build.outputs.logged_in == 'true'
235+
&& github.event_name == 'push'
236+
&& github.ref == 'refs/heads/main'"
237+
run: make push-ubuntu-24.04-noble-amd64-valgrind BRANCH=main
238+
env:
239+
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
240+
121241
success:
122-
needs: build
242+
needs: [build, push-valgrind]
123243
runs-on: ubuntu-latest
124244
name: Build successful
125245
steps:

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ TARGETS = \
1212
manylinux_2_28-wheel-build \
1313
ubuntu-24.04-noble-amd64 \
1414
ubuntu-26.04-resolute-amd64 \
15-
ubuntu-22.04-jammy-amd64-valgrind \
15+
ubuntu-24.04-noble-amd64-valgrind \
1616
ubuntu-26.04-resolute-arm64v8 \
1717
ubuntu-26.04-resolute-ppc64le \
1818
ubuntu-26.04-resolute-s390x
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)