forked from Kagami/SVT-AV1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
231 lines (225 loc) · 9.66 KB
/
.travis.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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
# Environment variables
language: c
cache:
ccache: true
pip: true
dist: bionic
osx_image: xcode11.2
env: build_type=release
addons:
apt:
sources:
packages: cmake yasm valgrind libgstreamer-plugins-base1.0-dev libgstreamer1.0-dev
homebrew:
packages:
- yasm
- ccache
notifications:
webhooks: https://coveralls.io/webhook
# Pipeline stages
stages:
- name: style
- name: test
- name: unittest
- name: coveralls
if: type != pull_request
- name: valgrind
if: type != pull_request
# Default scripts
before_install:
- "sudo chown -R travis: $HOME/.ccache"
- export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib PKG_CONFIG_PATH=${PKG_CONFIG_PATH}:/usr/local/lib/pkgconfig PATH="/usr/local/opt/ccache/libexec:$PATH"
- cd $TRAVIS_BUILD_DIR
- wget -nc https://raw.githubusercontent.com/OpenVisualCloud/SVT-AV1-Resources/master/video.tar.gz || wget -nc http://randomderp.com/video.tar.gz
- tar xf video.tar.gz
- mkdir -p $TRAVIS_BUILD_DIR/Build/linux/${build_type:-Release}
- if [ $CC = "/usr/bin/gcc-8" ]; then sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y; sudo apt-get install -qq gcc-8 g++-8; fi
- if [ $CC = "/usr/bin/gcc-9" ]; then sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y; sudo apt-get install -qq gcc-9 g++-9; fi
- if [ "$CC" != "clang" -a "$CC" != "gcc" ]; then sudo ln -s /usr/bin/ccache /usr/lib/ccache/${CC##*/} || true; fi
- if [ "$CXX" != "clang++" -a "$CXX" != "g++" ]; then sudo ln -s /usr/bin/ccache /usr/lib/ccache/${CXX##*/} || true; fi
install:
- pip install --user cpp-coveralls
- export PATH=/Users/travis/Library/Python/2.7/bin:${PATH}
- |
if [ "$TRAVIS_OS_NAME" != "osx" ]; then
export CFLAGS="-Werror"
if [ "$CC" = "clang" ]; then export CFLAGS+=" -Wno-error=array-bounds"; fi
fi
#- if [ $TRAVIS_OS_NAME = osx ]; then brew install --HEAD valgrind; fi
base_script: &base_script |
cd $TRAVIS_BUILD_DIR/Build/linux/${build_type:-Release}
cmake $TRAVIS_BUILD_DIR -G"${generator:-Unix Makefiles}" -DCMAKE_BUILD_TYPE=${build_type:-Release} ${CMAKE_EFLAGS[@]}
cmake -j $(if [ $TRAVIS_OS_NAME = osx ]; then sysctl -n hw.ncpu; else nproc; fi) --build . &&
sudo cmake --build . --target install && cd $TRAVIS_BUILD_DIR
coveralls_script: &coveralls_script |
SvtAv1EncApp -enc-mode 8 -w 720 -h 486 -fps 60 -i akiyo_cif.y4m -n 150 -b test1.ivf
git clone https://github.com/FFmpeg/FFmpeg ffmpeg --depth=1 --branch release/4.2 && cd ffmpeg &&
git apply $TRAVIS_BUILD_DIR/ffmpeg_plugin/0001-Add-ability-for-ffmpeg-to-run-svt-av1.patch &&
ffmpegconfig=(--disable-everything --enable-{libsvtav1,encoder={libaom_av1,libsvt_av1,rawvideo},decoder={h264,rawvideo,yuv4,libaom_av1},muxer={fifo,matroska,ivf,mp4,rawvideo,webm,yuv4mpegpipe},demuxer={h264,ivf,matroska,mpegts,rawvideo,yuv4mpegpipe},parser={av1,h264,mpeg4video},bsf={av1_metadata,h264_metadata},protocol={data,file,pipe,unix},filter={fifo,fps,libvmaf,psnr,ssim,vmafmotion}})
sudo chown -R travis: $HOME/.ccache
CFLAGS=""
if ! ./configure ${ffmpegconfig[@]}; then cat ffbuild/config.log; fi &&
make -s -j$(if [ $TRAVIS_OS_NAME = osx ]; then sysctl -n hw.ncpu; else nproc; fi) >/dev/null &&
sudo make install && cd $TRAVIS_BUILD_DIR &&
ffmpeg -i akiyo_cif.y4m -vframes 150 -c:v libsvt_av1 test.mp4 &&
ffmpeg -i bus_cif.y4m -nostdin -f rawvideo -pix_fmt yuv420p - | SvtAv1EncApp -i stdin -w 352 -h 288 -fps 30 -n 150 -b test2.ivf
after_coveralls_script: &after_coveralls_script |
if [ $CC = "clang" ] && [ $TRAVIS_OS_NAME = linux ]; then
GCOV_FILE=llvm-cov GCOV_OPTIONS='gcov -pl'
else
GCOV_FILE=gcov GCOV_OPTIONS='\-lp'
fi
coveralls --root $TRAVIS_BUILD_DIR -i Source -E ".*gtest.*" -E ".*CMakeFiles.*" -E ".*third_party.*" -E ".*test/FilmGrainTest.cc" -E ".*ffmpeg.*" --gcov $GCOV_FILE --gcov-options "$GCOV_OPTIONS"
script:
- *base_script
- SvtAv1EncApp -enc-mode 8 -w 720 -h 486 -fps 60 -i akiyo_cif.y4m -n 150 -b test1.ivf
before_cache:
- "sudo chown -R travis: $HOME/.ccache"
# Build matrix
matrix:
fast_finish: true
allow_failures:
- name: Binary Identical?
- name: Valgrind
- env: COVERALLS_PARALLEL=true build_type=debug CMAKE_EFLAGS="-DCOVERAGE=ON"
- name: Unit Tests Linux+gcc
- name: Unit Tests osx+clang
# Exclude these because if the encoder can run with a release build, the commit is probably fine. Also required for fast_finish.
include:
# Coding style check
- name: Style check
stage: style
addons: skip
before_install: skip
install: skip
script:
- git remote rm upstream 2> /dev/null || true
- git remote add upstream https://github.com/OpenVisualCloud/SVT-AV1.git
- git fetch -q upstream master
- git grep -InP --heading "\t" -- . ':!third_party/**/*' && false || true
- git grep -InP --heading "\r" -- . ':!third_party/**/*' && false || true
- git grep -InP --heading " $" -- . ':!third_party/**/*' && false || true
- |
for file in $(git ls-tree --name-only -r HEAD |
grep -vE "third_party/|test/e2e_test/test_vector_list.txt|test/vectors/smoking_test.cfg|test/vectors/video_src.cfg|.png"); do
if [ -n "$(tail -c1 "$file")" ]; then
echo "No newline at end of $file"
false
fi
done
for i in $(git rev-list HEAD ^upstream/master); do
echo "Checking commit message of $i"
msg="$(git log --format=%B -n 1 $i)"
if [ -n "$(sed -n 2p <<<"$msg")" ]; then
echo "Malformed commit message in $i, second line must be empty"
false
fi
if head -1 <<<"$msg" | grep -q '\.$'; then
echo "Malformed commit message in $i, trailing period in subject line"
false
fi
done
# GCC & Clang builds
- name: Linux GCC 7 build
stage: test
- name: Linux GCC 8 build
env: build_type=release CC=/usr/bin/gcc-8 CXX=/usr/bin/g++-8
- name: Linux GCC 9 build
env: build_type=release CC=/usr/bin/gcc-9 CXX=/usr/bin/g++-9
- name: Linux Clang build
compiler: clang
- name: macOS Clang build
os: osx
compiler: clang
# FFmpeg interation build
- name: FFmpeg patch
env: build_type=release
script:
# Build and install SVT-AV1
- *base_script
# Apply SVT-AV1 plugin and enable libsvtav1 to FFmpeg
- git clone https://github.com/FFmpeg/FFmpeg --branch release/4.2 --depth=1 ffmpeg && cd ffmpeg
- git apply $TRAVIS_BUILD_DIR/ffmpeg_plugin/0001-Add-ability-for-ffmpeg-to-run-svt-av1.patch
- export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib PKG_CONFIG_PATH=${PKG_CONFIG_PATH}:/usr/local/lib/pkgconfig
- "sudo chown -R travis: $HOME/.ccache"
- export CFLAGS=""
- ./configure --enable-libsvtav1 || less ffbuild/config.log
- make --quiet -j$(nproc) && sudo make install
# GStreamer interation build
- name: GStreamer patch
env: build_type=release
script:
# Build and install SVT-AV1
- *base_script
# Build GST-SVT-AV1 plugin
- cd $TRAVIS_BUILD_DIR/gstreamer-plugin
- "sudo chown -R travis: $HOME/.ccache"
- CFLAGS=""
- cmake .
- make --quiet -j$(nproc)
- sudo make install
# Tests if .ivf files are identical on binary level
- name: Binary Identical?
script:
- mv -t $HOME akiyo_cif.y4m
- *base_script
- cd $HOME
- SvtAv1EncApp -enc-mode 8 -i akiyo_cif.y4m -n 120 -b test-pr-m8.ivf
- SvtAv1EncApp -enc-mode 0 -i akiyo_cif.y4m -n 3 -b test-pr-m0.ivf
- rm -rf $TRAVIS_BUILD_DIR
- git clone --depth 1 https://github.com/OpenVisualCloud/SVT-AV1.git $TRAVIS_BUILD_DIR
- cd $TRAVIS_BUILD_DIR
- mkdir -p $TRAVIS_BUILD_DIR/Build/linux/${build_type:-Release}
- *base_script
- cd $HOME
- SvtAv1EncApp -enc-mode 8 -i akiyo_cif.y4m -n 120 -b test-master-m8.ivf
- SvtAv1EncApp -enc-mode 0 -i akiyo_cif.y4m -n 3 -b test-master-m0.ivf
- diff test-pr-m8.ivf test-master-m8.ivf
- diff test-pr-m0.ivf test-master-m0.ivf
# Coveralls on Linux and macOS
- name: Coveralls Linux+gcc
stage: Coveralls
env: COVERALLS_PARALLEL=true build_type=debug CMAKE_EFLAGS="-DCOVERAGE=ON"
script:
- *base_script
- *coveralls_script
after_script: *after_coveralls_script
- name: Coveralls osx+clang
os: osx
compiler: clang
env: COVERALLS_PARALLEL=true build_type=debug CMAKE_EFLAGS="-DCOVERAGE=ON"
script:
- *base_script
- *coveralls_script
after_script: *after_coveralls_script
# Valgrind on Linux and macOS
- name: Valgrind
stage: valgrind
env: build_type=debug
script:
- *base_script
- valgrind -- SvtAv1EncApp -enc-mode 2 -w 720 -h 486 -fps 60 -i akiyo_cif.y4m -n 20 -b test1.ivf
# Unittests on Linux and macOS
- name: Unit Tests Linux+gcc
stage: unittest
env: build_type=release CMAKE_EFLAGS="-DBUILD_TESTING=ON" SVT_AV1_TEST_VECTOR_PATH=$TRAVIS_BUILD_DIR/test/vectors/
script:
- *base_script
- cd $TRAVIS_BUILD_DIR/Build/linux/${build_type:-Release}
- make TestVectors
- cd $TRAVIS_BUILD_DIR
- SvtAv1UnitTests
- SvtAv1ApiTests
- SvtAv1E2ETests
- name: Unit Tests osx+clang
os: osx
compiler: clang
env: build_type=release CMAKE_EFLAGS="-DBUILD_TESTING=ON" SVT_AV1_TEST_VECTOR_PATH=$TRAVIS_BUILD_DIR/test/vectors/
script:
- *base_script
- cd $TRAVIS_BUILD_DIR/Build/linux/${build_type:-Release}
- make TestVectors
- cd $TRAVIS_BUILD_DIR
- SvtAv1UnitTests
- SvtAv1ApiTests
- SvtAv1E2ETests