Skip to content

Commit 218f055

Browse files
committed
Add github workflow/test-script
1 parent d5449d5 commit 218f055

File tree

2 files changed

+71
-0
lines changed

2 files changed

+71
-0
lines changed
+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Test Valgrind Memory Leaks
2+
3+
# like the Docker tests, but running valgrind only on *.c/*.h changes.
4+
5+
# this is very expensive. Only run on the pull request.
6+
on:
7+
# push:
8+
# branches:
9+
# - "**"
10+
# paths:
11+
# - ".github/workflows/test-valgrind.yml"
12+
# - "**.c"
13+
# - "**.h"
14+
pull_request:
15+
paths:
16+
- ".github/workflows/test-valgrind.yml"
17+
- "**.c"
18+
- "**.h"
19+
- "depends/docker-test-valgrind-memory.sh"
20+
workflow_dispatch:
21+
22+
permissions:
23+
contents: read
24+
25+
concurrency:
26+
group: ${{ github.workflow }}-${{ github.ref }}
27+
cancel-in-progress: true
28+
29+
jobs:
30+
build:
31+
32+
runs-on: ubuntu-latest
33+
strategy:
34+
fail-fast: false
35+
matrix:
36+
docker: [
37+
ubuntu-22.04-jammy-amd64-valgrind,
38+
]
39+
dockerTag: [main]
40+
41+
name: ${{ matrix.docker }}
42+
43+
steps:
44+
- uses: actions/checkout@v4
45+
with:
46+
persist-credentials: false
47+
48+
- name: Build system information
49+
run: python3 .github/workflows/system-info.py
50+
51+
- name: Docker pull
52+
run: |
53+
docker pull pythonpillow/${{ matrix.docker }}:${{ matrix.dockerTag }}
54+
55+
- name: Build and Run Valgrind
56+
run: |
57+
# The Pillow user in the docker container is UID 1001
58+
sudo chown -R 1001 $GITHUB_WORKSPACE
59+
docker run --name pillow_container -e "PILLOW_VALGRIND_TEST=true" -v $GITHUB_WORKSPACE:/Pillow pythonpillow/${{ matrix.docker }}:${{ matrix.dockerTag }} /Pillow/depends/docker-test-valgrind-memory.sh
60+
sudo chown -R runner $GITHUB_WORKSPACE
+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
3+
## Run this as the test script in the docker valgrind image.
4+
## Note -- can be included directly into the docker image,
5+
## but requires the currnet python.supp.
6+
7+
source /vpy3/bin/activate
8+
cd /Pillow
9+
make clean
10+
make install
11+
make valgrind-memory

0 commit comments

Comments
 (0)