-
Notifications
You must be signed in to change notification settings - Fork 208
79 lines (71 loc) · 2.72 KB
/
ci-unix-shared-installed.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# 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]
permissions:
contents: read
jobs:
build-shared-installed:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-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/[email protected]
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: Install dependencies (Linux)
if: runner.os == 'Linux'
run: |
echo "deb http://azure.archive.ubuntu.com/ubuntu/ jammy main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list
sudo apt-get update
sudo apt-get install libaom-dev libdav1d-dev libyuv-dev imagemagick
- name: Install dependencies (macOS)
if: runner.os == 'macOS'
run: brew install aom dav1d imagemagick
- name: Print ImageMagick version
run: convert --version
# TODO(yguyon): Install libyuv (not available with brew).
# `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 -e 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
-DAVIF_ENABLE_WERROR=ON
- name: Build libavif (ninja)
working-directory: ./build
run: ninja
- name: Run AVIF Tests
working-directory: ./build
run: ctest -j $(getconf _NPROCESSORS_ONLN) --output-on-failure