diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index eb65d37..dc64545 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -85,4 +85,24 @@ jobs: Write-Output $env:Path Get-ChildItem .\vips_w64\vips-dev-8.15 .\gradlew.bat sample:clean sample:shadowJar - java -jar sample/build/libs/sample-all.jar \ No newline at end of file + java -jar sample/build/libs/sample-all.jar + + docker-checks: + runs-on: ubuntu-24.04 + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Java + uses: actions/setup-java@v4 + with: + distribution: "temurin" + java-version: 22 + + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v3 + with: + gradle-version: 8.10.1 + + - name: Run checks + run: ./run_docker_tests.sh \ No newline at end of file diff --git a/.gitignore b/.gitignore index 64d9e17..97c6366 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,4 @@ hs_err* sample_run .kotlin sample_output* +sample*.jar diff --git a/README.md b/README.md index 860ec5a..a92f172 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ and [faster](https://github.com/lopcode/vips-ffm/issues/59#issuecomment-23676349 Supports a vast range of image formats, including HEIC, JXL, WebP, PNG, JPEG, and more. Pronounced "vips (like zips) eff-eff-emm". The project is relatively new, but aims to be production ready. Tested on macOS 14, Windows 11, and Linux -(Ubuntu 24.04). Should work on any architecture you can use libvips and Java on (arm64/amd64/etc). +(Ubuntu 24.04, Debian 12.1). Should work on any architecture you can use libvips and Java on (arm64/amd64/etc). Used the library? I'd love to hear from more users - let me know in [Discussions](https://github.com/lopcode/vips-ffm/discussions). @@ -153,6 +153,13 @@ memory: high-water mark 151.24 MB [main] INFO vipsffm.SampleRunner - all samples ran successfully 🎉 ``` +### Docker checks + +These samples are also run in Docker containers, to verify behaviour on specific Linux distributions. They're useful to +look at if you're deploying `libvips` and `vips-ffm` workloads using containers. + +You can find them in the [`docker_tests`](docker_tests) folder. + ## Native library loading This library requires the `libvips`, `glib`, and `gobject` native libraries to be present in your library path: diff --git a/docker_tests/.gitignore b/docker_tests/.gitignore new file mode 100644 index 0000000..21561dd --- /dev/null +++ b/docker_tests/.gitignore @@ -0,0 +1,2 @@ +*/sample/* +*/sample/run_samples.sh \ No newline at end of file diff --git a/docker_tests/debian-12/Dockerfile b/docker_tests/debian-12/Dockerfile new file mode 100644 index 0000000..67c43db --- /dev/null +++ b/docker_tests/debian-12/Dockerfile @@ -0,0 +1,12 @@ +FROM debian:12.1-slim +ENV JAVA_HOME=/opt/java/openjdk +COPY --from=eclipse-temurin:22 $JAVA_HOME $JAVA_HOME +ENV PATH="${JAVA_HOME}/bin:${PATH}" + +COPY sample /opt/sample +COPY run_samples.sh /opt/run_samples.sh + +RUN apt update && apt install libvips-dev -y + +WORKDIR /opt +CMD ./run_samples.sh \ No newline at end of file diff --git a/run_docker_tests.sh b/run_docker_tests.sh new file mode 100755 index 0000000..ffdb1c5 --- /dev/null +++ b/run_docker_tests.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash +set -eou pipefail + +echo "building samples..." +./gradlew sample:clean sample:shadowJar + +echo "running docker tests..." +WORKSPACE_DIR="$PWD" + +pushd docker_tests/debian-12 +cp -r "$WORKSPACE_DIR"/sample . +cp "$WORKSPACE_DIR"/run_samples.sh . +docker build -t vips-ffm-debian-test . +docker run vips-ffm-debian-test +popd \ No newline at end of file diff --git a/run_samples.sh b/run_samples.sh index 5438dd8..5df9e0e 100755 --- a/run_samples.sh +++ b/run_samples.sh @@ -1,8 +1,12 @@ #!/usr/bin/env bash set -eou pipefail -echo "building samples..." -./gradlew sample:clean sample:shadowJar +if [ -f "gradlew" ]; then + echo "building samples..." + ./gradlew sample:clean sample:shadowJar +else + echo "skipping sample build as no gradle present..." +fi export JAVA_PATH_OPTS="" if [[ "$OSTYPE" == "darwin"* ]]; then