2021-02-08 21:10:37 +01:00
|
|
|
name: CI
|
|
|
|
|
|
|
|
on: [ push, pull_request, workflow_dispatch ]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
CI:
|
|
|
|
name: ${{ matrix.name }}
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
include:
|
2021-09-07 12:14:45 +02:00
|
|
|
- name: "Linux x64 (Ubuntu 20.04) - GCC 10"
|
2021-02-08 21:10:37 +01:00
|
|
|
os: ubuntu-20.04
|
2021-09-07 12:14:45 +02:00
|
|
|
build: { cc: gcc, cxx: g++, linker: ld }
|
|
|
|
shell: bash
|
|
|
|
|
|
|
|
- name: "Linux x64 (Ubuntu 20.04) - Clang 12 with ASan and UBSan"
|
|
|
|
os: ubuntu-20.04
|
|
|
|
build: { cc: clang-12, cxx: clang++-12, linker: ld.lld-12, sanitize: true }
|
|
|
|
shell: bash
|
|
|
|
|
|
|
|
- name: "macOS (11.5) - Xcode 12.5.1"
|
|
|
|
os: macos-11
|
|
|
|
build: { cc: clang, cxx: clang++, linker: ld.lld }
|
|
|
|
shell: bash
|
|
|
|
|
|
|
|
# TODO: Re-enable self-hosted M1 runner provided by MacStadium
|
|
|
|
#- name: "macOS (10.15) - Xcode 12.4 - M1"
|
|
|
|
# os: macos-m1
|
|
|
|
# build: { cc: clang, cxx: clang++, linker: ld.lld }
|
|
|
|
# shell: "/usr/bin/arch -arch arm64e /bin/bash -l {0}"
|
2021-07-23 13:58:34 +02:00
|
|
|
|
|
|
|
defaults:
|
|
|
|
run:
|
2021-09-07 12:14:45 +02:00
|
|
|
shell: ${{ matrix.shell }}
|
|
|
|
|
|
|
|
env:
|
|
|
|
CC: ${{ matrix.build.cc }}
|
|
|
|
CXX: ${{ matrix.build.cxx }}
|
|
|
|
LD: ${{ matrix.build.linker }}
|
|
|
|
CPPFLAGS: -Wall
|
|
|
|
DEBIAN_FRONTEND: noninteractive
|
|
|
|
HOMEBREW_NO_AUTO_UPDATE: 1
|
2021-02-08 21:10:37 +01:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout code
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Update apt
|
2021-09-07 12:14:45 +02:00
|
|
|
if: runner.os == 'Linux'
|
2021-02-08 21:10:37 +01:00
|
|
|
run: sudo -E apt-get update -qq -o Acquire::Retries=3
|
|
|
|
|
2021-08-22 19:11:41 +02:00
|
|
|
- name: Add Ubuntu PPAs
|
2021-09-07 12:14:45 +02:00
|
|
|
if: runner.os == 'Linux'
|
2021-02-08 21:10:37 +01:00
|
|
|
run: |
|
|
|
|
sudo add-apt-repository ppa:strukturag/libde265
|
|
|
|
sudo add-apt-repository ppa:strukturag/libheif
|
2021-08-22 19:11:41 +02:00
|
|
|
sudo add-apt-repository ppa:lovell/cgif
|
2021-02-08 21:10:37 +01:00
|
|
|
|
|
|
|
- name: Install Ubuntu dependencies
|
2021-09-07 12:14:45 +02:00
|
|
|
if: runner.os == 'Linux'
|
2021-02-09 14:46:47 +01:00
|
|
|
run:
|
|
|
|
sudo -E apt-get install --fix-missing -qq -o Acquire::Retries=3
|
|
|
|
gtk-doc-tools gobject-introspection
|
|
|
|
python3-pip python3-setuptools python3-wheel
|
|
|
|
libfftw3-dev libexif-dev libjpeg-turbo8-dev
|
|
|
|
libpng-dev libwebp-dev libtiff5-dev
|
|
|
|
libheif-dev libexpat1-dev libcfitsio-dev
|
|
|
|
libmatio-dev libnifti-dev liborc-0.4-dev
|
|
|
|
liblcms2-dev libpoppler-glib-dev librsvg2-dev
|
|
|
|
libgif-dev libopenexr-dev libpango1.0-dev
|
2021-02-08 21:10:37 +01:00
|
|
|
libgsf-1-dev libopenslide-dev libffi-dev
|
2021-08-22 19:11:41 +02:00
|
|
|
libopenjp2-7-dev libimagequant-dev libcgif-dev
|
2021-02-08 21:10:37 +01:00
|
|
|
|
|
|
|
- name: Install macOS dependencies
|
2021-09-07 12:14:45 +02:00
|
|
|
if: runner.os == 'macOS'
|
2021-04-12 17:55:01 +02:00
|
|
|
run: |
|
2021-04-18 14:28:54 +02:00
|
|
|
brew install autoconf automake libtool fftw fontconfig gtk-doc gobject-introspection glib libexif libgsf little-cms2 orc pango
|
2021-08-22 19:11:41 +02:00
|
|
|
brew install cfitsio libheif libimagequant libjpeg-turbo libmatio librsvg libspng libtiff openexr openjpeg openslide poppler webp
|
|
|
|
brew tap lovell/cgif-packaging https://github.com/lovell/cgif-packaging.git
|
|
|
|
brew install --build-bottle lovell/cgif-packaging/cgif
|
2021-02-08 21:10:37 +01:00
|
|
|
|
2021-09-07 12:14:45 +02:00
|
|
|
- name: Install Clang 12
|
|
|
|
if: runner.os == 'Linux' && matrix.build.cc == 'clang-12'
|
2021-02-09 14:46:47 +01:00
|
|
|
run:
|
|
|
|
sudo -E apt-get install --fix-missing -qq -o Acquire::Retries=3
|
2021-09-07 12:14:45 +02:00
|
|
|
clang-12 libomp-12-dev lld-12 llvm-12
|
2021-02-08 21:10:37 +01:00
|
|
|
|
|
|
|
- name: Prepare Ubuntu environment
|
2021-09-07 12:14:45 +02:00
|
|
|
if: runner.os == 'Linux'
|
2021-02-08 21:10:37 +01:00
|
|
|
run: echo "JOBS=$(nproc)" >> $GITHUB_ENV
|
|
|
|
|
|
|
|
- name: Prepare macOS environment
|
2021-09-07 12:14:45 +02:00
|
|
|
if: runner.os == 'macOS'
|
2021-02-08 21:10:37 +01:00
|
|
|
run: |
|
|
|
|
echo "JOBS=$(sysctl -n hw.logicalcpu)" >> $GITHUB_ENV
|
2021-09-07 12:14:45 +02:00
|
|
|
echo "PKG_CONFIG_PATH=$(brew --prefix jpeg-turbo)/lib/pkgconfig:$(brew --prefix libxml2)/lib/pkgconfig:$PKG_CONFIG_PATH" >> $GITHUB_ENV
|
2021-02-08 21:10:37 +01:00
|
|
|
|
|
|
|
- name: Prepare sanitizers
|
2021-09-07 12:14:45 +02:00
|
|
|
if: matrix.build.sanitize
|
2021-02-08 21:10:37 +01:00
|
|
|
env:
|
2021-09-07 12:14:45 +02:00
|
|
|
LLVM_PREFIX: /usr/lib/llvm-12
|
2021-02-08 21:10:37 +01:00
|
|
|
run: |
|
|
|
|
ASAN_DSO=`$CC -print-file-name=libclang_rt.asan-x86_64.so`
|
|
|
|
echo "LDSHARED=$CC -shared" >> $GITHUB_ENV
|
|
|
|
echo "CPPFLAGS=-g -fsanitize=address,undefined -fno-omit-frame-pointer -fopenmp -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION" >> $GITHUB_ENV
|
|
|
|
echo "LDFLAGS=-g -fsanitize=address,undefined -shared-libasan -fopenmp=libomp" >> $GITHUB_ENV
|
|
|
|
echo "ASAN_DSO=$ASAN_DSO" >> $GITHUB_ENV
|
|
|
|
echo "ASAN_OPTIONS=suppressions=${{ github.workspace }}/suppressions/asan.supp" >> $GITHUB_ENV
|
|
|
|
echo "LSAN_OPTIONS=suppressions=${{ github.workspace }}/suppressions/lsan.supp" >> $GITHUB_ENV
|
2020-04-24 11:45:44 +02:00
|
|
|
echo "TSAN_OPTIONS=suppressions=${{ github.workspace }}/suppressions/tsan.supp" >> $GITHUB_ENV
|
2021-09-12 14:14:24 +02:00
|
|
|
echo "UBSAN_OPTIONS=suppressions=${{ github.workspace }}/suppressions/ubsan.supp:halt_on_error=1:abort_on_error=1" >> $GITHUB_ENV
|
2021-02-08 21:10:37 +01:00
|
|
|
echo "LD_LIBRARY_PATH=$LLVM_PREFIX/lib:`dirname $ASAN_DSO`" >> $GITHUB_ENV
|
|
|
|
echo "$LLVM_PREFIX/bin" >> $GITHUB_PATH
|
|
|
|
# workaround for https://github.com/google/sanitizers/issues/89
|
|
|
|
# otherwise libIlmImf-2_3.so ends up as <unknown module>
|
|
|
|
echo "DLCLOSE_PRELOAD=${{ github.workspace }}/dlclose.so" >> $GITHUB_ENV
|
|
|
|
echo -e '#include <stdio.h>\nint dlclose(void*handle){return 0;}' | $CC -shared -xc -odlclose.so -
|
|
|
|
|
|
|
|
- name: Configure libvips
|
2021-02-09 14:46:47 +01:00
|
|
|
run:
|
|
|
|
./autogen.sh
|
|
|
|
--disable-dependency-tracking
|
2021-02-08 21:10:37 +01:00
|
|
|
--disable-deprecated || (cat config.log && exit 1)
|
|
|
|
|
|
|
|
- name: Build libvips
|
|
|
|
run: make V=0 -j$JOBS
|
|
|
|
|
|
|
|
- name: Check libvips
|
2021-09-12 14:14:24 +02:00
|
|
|
run: make V=0 VERBOSE=1 check
|
2021-02-08 21:10:37 +01:00
|
|
|
|
|
|
|
- name: Install libvips
|
2021-07-23 19:35:14 +02:00
|
|
|
run: sudo make V=0 install
|
2021-02-08 21:10:37 +01:00
|
|
|
|
|
|
|
- name: Rebuild the shared library cache
|
2021-09-07 12:14:45 +02:00
|
|
|
if: runner.os == 'Linux'
|
2021-02-08 21:10:37 +01:00
|
|
|
run: sudo ldconfig
|
|
|
|
|
|
|
|
- name: Install pyvips
|
|
|
|
run: pip3 install pyvips[test]
|
|
|
|
|
|
|
|
- name: Run test suite
|
|
|
|
env:
|
|
|
|
VIPS_LEAK: 1
|
|
|
|
LD_PRELOAD: ${{ env.ASAN_DSO }} ${{ env.DLCLOSE_PRELOAD }}
|
|
|
|
run: python3 -m pytest -sv --log-cli-level=WARNING test/test-suite
|