forked from OpenVisualCloud/SVT-HEVC
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
201 lines (201 loc) · 7.72 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
language: c
cache: ccache
os:
- linux
- osx
dist: bionic
osx_image: xcode11
compiler:
- clang
- gcc
addons:
apt:
packages:
- cmake
- yasm
- valgrind
- libgstreamer-plugins-base1.0-dev
- libgstreamer1.0-dev
- llvm
- clang
homebrew:
packages:
- ccache
- yasm
notifications:
webhooks:
- https://coveralls.io/webhook
env:
global: build_type=release
matrix:
- CMAKE_EFLAGS="-DBUILD_SHARED_LIBS=ON"
- CMAKE_EFLAGS="-DBUILD_SHARED_LIBS=OFF"
stages:
- name: style
- name: test
- name: Coveralls And Valgrind
if: type != pull_request
before_install:
- |
if [ "$(uname -s)" == "Darwin" ]; then
sysctl -n machdep.cpu.brand_string
sysctl machdep.cpu.features
sysctl machdep.cpu.leaf7_features
elif [ -f "/proc/cpuinfo" ]; then
grep -Ei " sse*| ssse*| avx|model name" /proc/cpuinfo | sort -u
fi
- "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"
- 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
install:
- pip install --user cpp-coveralls
- export PATH=/Users/travis/Library/Python/2.7/bin:${PATH}
- if [ $TRAVIS_OS_NAME = osx ]; then ulimit -n 512; fi
#- if [ $TRAVIS_OS_NAME = osx ]; then brew install --HEAD valgrind; fi
script:
- &base_script |
cd $TRAVIS_BUILD_DIR/Build/linux/$build_type
cmake $TRAVIS_BUILD_DIR -G"Unix Makefiles" -DCMAKE_BUILD_TYPE=$build_type ${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
- SvtHevcEncApp -encMode 9 -i akiyo_cif.y4m -b test1.h265 $(if [ "$(uname -s)" == "Darwin" ]; then echo "-asm 0"; fi)
before_cache:
- "sudo chown -R travis: $HOME/.ccache"
matrix:
fast_finish: true
allow_failures:
- name: Style check
- name: Binary Identical?
- os: osx
- name: Valgrind
- env: COVERALLS_PARALLEL=true build_type=debug CMAKE_EFLAGS="-DCOVERAGE=ON"
exclude:
- os: osx
compiler: gcc # gcc = clang in macOS, unecessary duplicate
include:
# valgrind --tool=memcheck --leak-check=yes --show-reachable=yes ./SvtHevcEncApp -help
# Coding style check
- name: Style check
stage: style
addons: skip
before_install: skip
install: skip
script:
- git grep -InP --heading "\t|\r| $" -- . && IS_FAIL=true || true
- git grep -I -l -z "" -- . | while IFS= read -r -d '' i; do
if [ -n "$(tail -c 1 "$i")" ]; then
echo "No newline at end of $i";
IS_FAIL=true;
fi;
done
- git remote rm upstream 2> /dev/null || true
- git remote add upstream https://github.com/OpenVisualCloud/SVT-HEVC.git
- git fetch -q upstream master
- 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 "$(echo "$msg" | awk "NR==2")" ]; then
echo "Malformed commit message in $i, second line must be empty";
IS_FAIL=true;
fi;
if echo "$msg" | head -1 | grep -q '\.$'; then
echo "Malformed commit message in $i, trailing period in subject line";
IS_FAIL=true;
fi;
done
- test -z "$IS_FAIL"
# FFmpeg interation build
- name: FFmpeg patch
stage: test
compiler: gcc
env: build_type=release
script:
# Build and install SVT-HEVC
- *base_script
# Apply SVT-HEVC plugin and enable libsvthevc to FFmpeg
- git clone https://github.com/FFmpeg/FFmpeg --branch release/4.2 --depth=1 ffmpeg && cd ffmpeg
- git am $TRAVIS_BUILD_DIR/ffmpeg_plugin/0001-lavc-svt_hevc-add-libsvt-hevc-encoder-wrapper.patch
# Patch 2 is doc only
#- git am $TRAVIS_BUILD_DIR/ffmpeg_plugin/0002-doc-Add-libsvt_hevc-encoder-docs.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"
- ./configure --enable-libsvthevc || tail ffbuild/config.log
- make --quiet -j$(nproc) && sudo make install
# GStreamer interation build
- name: GStreamer patch
stage: test
compiler: gcc
env: build_type=release
script:
# Build and install SVT-HEVC
- *base_script
# Build GST-SVT-HEVC plugin
- cd $TRAVIS_BUILD_DIR/gstreamer-plugin
- "sudo chown -R travis: $HOME/.ccache"
- cmake .
- make --quiet -j$(nproc)
- sudo make install
# Tests if .h265 files are identical on binary level
- name: Binary Identical?
stage: test
script:
- mv -t $HOME akiyo_cif.y4m
- *base_script
- cd $HOME
- travis_wait SvtHevcEncApp -encMode 9 -i akiyo_cif.y4m -n 120 -b test-pr-m9.h265
- travis_wait SvtHevcEncApp -encMode 0 -i akiyo_cif.y4m -n 3 -b test-pr-m0.h265
- rm -rf $TRAVIS_BUILD_DIR
- git clone --depth 1 https://github.com/OpenVisualCloud/SVT-HEVC.git $TRAVIS_BUILD_DIR && cd $TRAVIS_BUILD_DIR
- *base_script
- mkdir -p $TRAVIS_BUILD_DIR/Build/linux/$build_type
- cd $HOME
- travis_wait SvtHevcEncApp -encMode 9 -i akiyo_cif.y4m -n 120 -b test-master-m9.h265
- travis_wait SvtHevcEncApp -encMode 0 -i akiyo_cif.y4m -n 3 -b test-master-m0.h265
- diff test-pr-m9.h265 test-master-m9.h265
- diff test-pr-m0.h265 test-master-m0.h265
- name: Coveralls Linux+gcc
stage: Coveralls And Valgrind
os: linux
compiler: gcc
env: COVERALLS_PARALLEL=true build_type=debug CMAKE_EFLAGS="-DCOVERAGE=ON"
script:
- *base_script
- &coveralls_script |
travis_wait SvtHevcEncApp -encMode 9 -i akiyo_cif.y4m -b test1.h265
git clone https://github.com/FFmpeg/FFmpeg ffmpeg --depth=1 --branch release/4.2
cd ffmpeg
git am $TRAVIS_BUILD_DIR/ffmpeg_plugin/0001-lavc-svt_hevc-add-libsvt-hevc-encoder-wrapper.patch &&
git am $TRAVIS_BUILD_DIR/ffmpeg_plugin/0002-doc-Add-libsvt_hevc-encoder-docs.patch
sudo chown -R travis: $HOME/.ccache
./configure --enable-libsvthevc || cat ffbuild/config.log
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 -c:v libsvt_hevc test.h265
travis_wait SvtHevcEncApp -i stdin -w 352 -h 288 -fps 30 -n 150 -b test2.h265 < akiyo_cif.y4m
after_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 ".*CMakeFiles.*" -E ".*ffmpeg.*" --gcov $GCOV_FILE --gcov-options "$GCOV_OPTIONS"
- name: Coveralls osx+clang
stage: Coveralls And Valgrind
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
- name: Valgrind
stage: Coveralls And Valgrind
compiler: gcc
os: linux
env: build_type=debug
script:
- *base_script
- travis_wait valgrind -- SvtHevcEncApp -encMode 9 -i akiyo_cif.y4m -n 150 -b test1.h265