Add SHARED libavif CI using installed dependencies and dav1d
diff --git a/.github/workflows/ci-unix-shared-installed.yml b/.github/workflows/ci-unix-shared-installed.yml
new file mode 100644
index 0000000..20e5da7
--- /dev/null
+++ b/.github/workflows/ci-unix-shared-installed.yml
@@ -0,0 +1,67 @@
+# This is a copy of ci-unix-shared-local.yml for building shared libraries
+# with an additional build configuration (using installed deps and dav1d).
+
+name: CI
+on: [push, pull_request]
+jobs:
+ build-shared-installed:
+ runs-on: ${{ matrix.os }}
+ strategy:
+ fail-fast: false
+ matrix:
+ os: [ubuntu-latest]
+
+ steps:
+ - uses: actions/checkout@v3
+ - name: Set GCC & G++ 10 compiler (on Linux)
+ if: runner.os == 'Linux'
+ run: echo "CC=gcc-10" >> $GITHUB_ENV && echo "CXX=g++-10" >> $GITHUB_ENV
+
+ - name: Cache external dependencies
+ id: cache-ext
+ uses: actions/cache@v3
+ with:
+ path: ext
+ key: ${{ runner.os }}-shared-installed-${{ hashFiles('ext/*.cmd') }}
+ - name: Setup cmake
+ uses: jwlawson/actions-setup-cmake@v1.12
+ with:
+ cmake-version: '3.13.x'
+ - name: Print cmake version
+ run: cmake --version
+ - uses: seanmiddleditch/gha-setup-ninja@v3
+ - name: Set shared libs
+ if: steps.cache-ext.outputs.cache-hit != 'true'
+ working-directory: ./ext
+ run: sed -i'' -e 's/-DBUILD_SHARED_LIBS=OFF/-DBUILD_SHARED_LIBS=ON/' *.cmd
+ - name: Add recent repository for libyuv-dev
+ run: echo "deb http://azure.archive.ubuntu.com/ubuntu/ jammy main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list
+ - name: Update apt
+ run: sudo apt-get update
+ - name: Install dependencies
+ run: sudo apt-get install libaom-dev libdav1d-dev libyuv-dev
+ # `sudo apt-get install googletest libgtest-dev` leads to the following:
+ # "libgtest.a(gtest-all.cc.o): undefined reference to `std::__throw_bad_array_new_length()'"
+ # so build it locally instead.
+ - name: Build GoogleTest
+ if: steps.cache-ext.outputs.cache-hit != 'true'
+ working-directory: ./ext
+ run: bash googletest.cmd
+
+ - name: Prepare libavif (cmake)
+ run: >
+ mkdir build && cd build
+
+ cmake .. -G Ninja
+ -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON
+ -DAVIF_CODEC_AOM=ON
+ -DAVIF_CODEC_AOM_DECODE=OFF -DAVIF_CODEC_AOM_ENCODE=ON
+ -DAVIF_CODEC_DAV1D=ON
+ -DAVIF_BUILD_EXAMPLES=ON -DAVIF_BUILD_APPS=ON
+ -DAVIF_BUILD_TESTS=ON -DAVIF_ENABLE_GTEST=ON -DAVIF_LOCAL_GTEST=ON
+ - name: Build libavif (ninja)
+ working-directory: ./build
+ run: ninja
+ - name: Run AVIF Tests
+ working-directory: ./build
+ run: ctest -j $(getconf _NPROCESSORS_ONLN)
diff --git a/.github/workflows/ci-unix-shared.yml b/.github/workflows/ci-unix-shared-local.yml
similarity index 95%
rename from .github/workflows/ci-unix-shared.yml
rename to .github/workflows/ci-unix-shared-local.yml
index 9bb9c66..967ea5e 100644
--- a/.github/workflows/ci-unix-shared.yml
+++ b/.github/workflows/ci-unix-shared-local.yml
@@ -6,7 +6,7 @@
name: CI
on: [push, pull_request]
jobs:
- build-shared:
+ build-shared-local:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
@@ -27,7 +27,7 @@
uses: actions/cache@v3
with:
path: ext
- key: ${{ runner.os }}-shared-${{ hashFiles('ext/*.cmd') }}
+ key: ${{ runner.os }}-shared-local-${{ hashFiles('ext/*.cmd') }}
- name: Setup cmake
uses: jwlawson/actions-setup-cmake@v1.12
with: