Skip to content

Commit bf6beec

Browse files
authored
Add docker test suite, include debian 12 to start (#122)
1 parent 704082f commit bf6beec

File tree

7 files changed

+65
-4
lines changed

7 files changed

+65
-4
lines changed

.github/workflows/checks.yml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,4 +85,24 @@ jobs:
8585
Write-Output $env:Path
8686
Get-ChildItem .\vips_w64\vips-dev-8.15
8787
.\gradlew.bat sample:clean sample:shadowJar
88-
java -jar sample/build/libs/sample-all.jar
88+
java -jar sample/build/libs/sample-all.jar
89+
90+
docker-checks:
91+
runs-on: ubuntu-24.04
92+
steps:
93+
- name: Checkout
94+
uses: actions/checkout@v4
95+
96+
- name: Setup Java
97+
uses: actions/setup-java@v4
98+
with:
99+
distribution: "temurin"
100+
java-version: 22
101+
102+
- name: Setup Gradle
103+
uses: gradle/actions/setup-gradle@v3
104+
with:
105+
gradle-version: 8.10.1
106+
107+
- name: Run checks
108+
run: ./run_docker_tests.sh

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@ hs_err*
1616
sample_run
1717
.kotlin
1818
sample_output*
19+
sample*.jar

README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ and [faster](https://github.com/lopcode/vips-ffm/issues/59#issuecomment-23676349
77

88
Supports a vast range of image formats, including HEIC, JXL, WebP, PNG, JPEG, and more. Pronounced "vips (like zips)
99
eff-eff-emm". The project is relatively new, but aims to be production ready. Tested on macOS 14, Windows 11, and Linux
10-
(Ubuntu 24.04). Should work on any architecture you can use libvips and Java on (arm64/amd64/etc).
10+
(Ubuntu 24.04, Debian 12.1). Should work on any architecture you can use libvips and Java on (arm64/amd64/etc).
1111

1212
Used the library? I'd love to hear from more users - let me know in [Discussions](https://github.com/lopcode/vips-ffm/discussions).
1313

@@ -153,6 +153,13 @@ memory: high-water mark 151.24 MB
153153
[main] INFO vipsffm.SampleRunner - all samples ran successfully 🎉
154154
```
155155

156+
### Docker checks
157+
158+
These samples are also run in Docker containers, to verify behaviour on specific Linux distributions. They're useful to
159+
look at if you're deploying `libvips` and `vips-ffm` workloads using containers.
160+
161+
You can find them in the [`docker_tests`](docker_tests) folder.
162+
156163
## Native library loading
157164

158165
This library requires the `libvips`, `glib`, and `gobject` native libraries to be present in your library path:

docker_tests/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*/sample/*
2+
*/sample/run_samples.sh

docker_tests/debian-12/Dockerfile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
FROM debian:12.1-slim
2+
ENV JAVA_HOME=/opt/java/openjdk
3+
COPY --from=eclipse-temurin:22 $JAVA_HOME $JAVA_HOME
4+
ENV PATH="${JAVA_HOME}/bin:${PATH}"
5+
6+
COPY sample /opt/sample
7+
COPY run_samples.sh /opt/run_samples.sh
8+
9+
RUN apt update && apt install libvips-dev -y
10+
11+
WORKDIR /opt
12+
CMD ./run_samples.sh

run_docker_tests.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/usr/bin/env bash
2+
set -eou pipefail
3+
4+
echo "building samples..."
5+
./gradlew sample:clean sample:shadowJar
6+
7+
echo "running docker tests..."
8+
WORKSPACE_DIR="$PWD"
9+
10+
pushd docker_tests/debian-12
11+
cp -r "$WORKSPACE_DIR"/sample .
12+
cp "$WORKSPACE_DIR"/run_samples.sh .
13+
docker build -t vips-ffm-debian-test .
14+
docker run vips-ffm-debian-test
15+
popd

run_samples.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
#!/usr/bin/env bash
22
set -eou pipefail
33

4-
echo "building samples..."
5-
./gradlew sample:clean sample:shadowJar
4+
if [ -f "gradlew" ]; then
5+
echo "building samples..."
6+
./gradlew sample:clean sample:shadowJar
7+
else
8+
echo "skipping sample build as no gradle present..."
9+
fi
610

711
export JAVA_PATH_OPTS=""
812
if [[ "$OSTYPE" == "darwin"* ]]; then

0 commit comments

Comments
 (0)