Enable true streaming with a buffer-based fallback #85
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
# Only trigger this workflow for the 5.x branch | |
push: | |
branches: | |
- 5.x | |
tags: | |
- v* | |
pull_request: | |
branches: | |
- 5.x | |
jobs: | |
CI: | |
runs-on: ${{ matrix.os }} | |
continue-on-error: ${{ matrix.libvips-version == 'master' }} | |
strategy: | |
fail-fast: true | |
matrix: | |
include: | |
- os: ubuntu-24.04 | |
libvips-version: 8.15.2 | |
coverage: true | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Cache libvips | |
if: matrix.libvips-version != 'master' | |
id: cache-libvips | |
uses: actions/cache@v4 | |
with: | |
path: ~/vips | |
key: ${{ matrix.libvips-version }} | |
- name: Install dependencies | |
run: | | |
# for Test::Nginx | |
curl -fsSL https://openresty.org/package/pubkey.gpg | sudo gpg --dearmor -o /usr/share/keyrings/openresty.gpg | |
echo "deb [signed-by=/usr/share/keyrings/openresty.gpg] https://openresty.org/package/ubuntu $(lsb_release -sc) main" | \ | |
sudo tee /etc/apt/sources.list.d/openresty.list > /dev/null | |
# install dependencies | |
sudo apt-get update | |
sudo apt-get install \ | |
meson \ | |
libtest-nginx-perl \ | |
libcgif-dev libexif-dev libexpat1-dev \ | |
libheif-dev libheif-plugin-aomenc libheif-plugin-x265 \ | |
libhwy-dev libimagequant-dev libjxl-dev \ | |
liblcms2-dev libmagickcore-dev libopenjp2-7-dev \ | |
libpango1.0-dev libpoppler-glib-dev librsvg2-dev \ | |
libspng-dev libtiff5-dev libwebp-dev | |
- name: Install libvips | |
if: steps.cache-libvips.outputs.cache-hit != 'true' | |
env: | |
VIPS_VERSION: ${{ matrix.libvips-version }} | |
VIPS_PRE_VERSION: ${{ matrix.libvips-pre-version }} | |
run: .ci/install-vips.sh -Ddeprecated=false -Dintrospection=disabled | |
- name: Prepare environment | |
run: | | |
echo "$HOME/vips/bin" >> $GITHUB_PATH | |
echo "$HOME/nginx/sbin" >> $GITHUB_PATH | |
echo "LD_LIBRARY_PATH=$HOME/vips/lib" >> $GITHUB_ENV | |
echo "PKG_CONFIG_PATH=$HOME/vips/lib/pkgconfig" >> $GITHUB_ENV | |
mkdir -p build | |
- name: Build | |
working-directory: build | |
run: | | |
cmake .. \ | |
-DCMAKE_BUILD_TYPE=Debug \ | |
-DCUSTOM_NGX_FLAGS="--prefix=$HOME/nginx" \ | |
-DENABLE_COVERAGE=$([ "${{ matrix.coverage }}" = true ] && echo "ON" || echo "OFF") \ | |
-DBUILD_TESTS=ON | |
cmake --build . -- -j$(nproc) | |
- name: Run unit tests | |
env: | |
VIPS_WARNING: 0 | |
working-directory: build | |
run: ctest -j $(nproc) --output-on-failure | |
- name: Run integration tests | |
env: | |
TEST_NGINX_SERVROOT: ${{ github.workspace }}/servroot | |
run: prove -r test/nginx | |
- name: Upload coverage to Codecov | |
if: matrix.coverage | |
uses: codecov/codecov-action@v4 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
docker-publish: | |
needs: CI | |
runs-on: ubuntu-24.04 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Docker meta | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: ghcr.io/${{ github.repository }} | |
# Add git branch, tag and short SHA as Docker tag | |
tags: | | |
type=ref,event=branch | |
type=semver,pattern={{version}} | |
type=semver,pattern={{major}}.{{minor}} | |
type=sha | |
# Disable latest tag convention on push tag event | |
flavor: | | |
latest=false | |
# Overwrite some generated OCI labels | |
labels: | | |
[email protected] | |
org.opencontainers.image.documentation=https://github.com/weserv/images/tree/5.x/docker | |
org.opencontainers.image.description=weserv/images | |
org.opencontainers.image.vendor=wsrv.nl | |
- name: Login to GitHub Container Registry | |
if: github.event_name != 'pull_request' | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ secrets.CR_USER }} | |
password: ${{ secrets.CR_PAT }} | |
- name: Build and push | |
uses: docker/build-push-action@v6 | |
with: | |
context: . | |
file: ./docker/Dockerfile | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} |