forked from OpenVisualCloud/SVT-VP9
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
192 lines (192 loc) · 7.52 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
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
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:
- export CMAKE_BUILD_PARALLEL_LEVEL=$(if [ $TRAVIS_OS_NAME = osx ]; then sysctl -n hw.ncpu; else nproc; 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"
- sudo ln -s /usr/local/clang-7.0.0/bin/clang /usr/lib/ccache/clang || true
- 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:-release}
cmake $TRAVIS_BUILD_DIR -G"Unix Makefiles" -DCMAKE_BUILD_TYPE=${build_type:-release} ${CMAKE_EFLAGS[@]}
sudo cmake --build . --target install
cd $TRAVIS_BUILD_DIR
- SvtVp9EncApp -i akiyo_cif.y4m -w 352 -h 288 -fps-num 30000 -fps-denom 1001 -b test1.ivf
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 SvtVp9EncApp -help
# Coding style check
- name: Style check
stage: style
addons: skip
before_install: skip
install: skip
script:
- git grep -InP --heading "\t" -- . && IS_FAIL=true || true
- git grep -InP --heading "\r" -- . && IS_FAIL=true || true
- git grep -InP --heading " $" -- . && IS_FAIL=true || true
- git grep -Ilz "" -- . | 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-VP9.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-VP9
- *base_script
# Apply SVT-VP9 plugin and enable libsvtvp9 to FFmpeg
- git clone https://github.com/FFmpeg/FFmpeg --branch release/4.2 --depth=1 ffmpeg && cd ffmpeg
- export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib
- export PKG_CONFIG_PATH=${PKG_CONFIG_PATH}:/usr/local/lib/pkgconfig
- "sudo chown -R travis: $HOME/.ccache"
- git am $TRAVIS_BUILD_DIR/ffmpeg_plugin/0001-Add-ability-for-ffmpeg-to-run-svt-vp9.patch
- ./configure --enable-libsvtvp9 || cat ffbuild/config.log
- sudo make -j$(nproc) install
# GStreamer interation build
- name: GStreamer patch
stage: test
compiler: gcc
env: build_type=release
script:
# Build and install SVT-VP9
- *base_script
# Build GST-SVT-VP9 plugin
- cd $TRAVIS_BUILD_DIR/gstreamer-plugin
- "sudo chown -R travis: $HOME/.ccache"
- cmake .
- sudo make -j$(nproc) install
# Tests if .ivf files are identical on binary level
- name: Binary Identical?
stage: test
compiler: gcc
script:
- mv -t $HOME akiyo_cif.y4m
- *base_script
- cd $HOME
- SvtVp9EncApp -enc-mode 9 -i akiyo_cif.y4m -w 352 -h 288 -fps-num 30000 -fps-denom 1001 -n 120 -b test-pr-m9.ivf
- SvtVp9EncApp -enc-mode 0 -i akiyo_cif.y4m -w 352 -h 288 -fps-num 30000 -fps-denom 1001 -n 3 -b test-pr-m0.ivf
- rm -rf $TRAVIS_BUILD_DIR
- git clone --depth 1 https://github.com/OpenVisualCloud/SVT-VP9.git $TRAVIS_BUILD_DIR && cd $TRAVIS_BUILD_DIR
- *base_script
- mkdir -p $TRAVIS_BUILD_DIR/Build/linux/$build_type
- cd $HOME
- SvtVp9EncApp -enc-mode 9 -i akiyo_cif.y4m -w 352 -h 288 -fps-num 30000 -fps-denom 1001 -n 120 -b test-master-m9.ivf
- SvtVp9EncApp -enc-mode 0 -i akiyo_cif.y4m -w 352 -h 288 -fps-num 30000 -fps-denom 1001 -n 3 -b test-master-m0.ivf
- diff test-pr-m9.ivf test-master-m9.ivf
- diff test-pr-m0.ivf test-master-m0.ivf
- 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 |
SvtVp9EncApp -enc-mode 9 -i akiyo_cif.y4m -w 352 -h 288 -fps-num 30000 -fps-denom 1001 -b test1.ivf
git clone https://github.com/FFmpeg/FFmpeg ffmpeg --depth=1 --branch release/4.2
cd ffmpeg
git am $TRAVIS_BUILD_DIR/ffmpeg_plugin/0001-Add-ability-for-ffmpeg-to-run-svt-vp9.patch
sudo chown -R travis: $HOME/.ccache
./configure --enable-libsvtvp9 || cat ffbuild/config.log
sudo make -sj$(if [ $TRAVIS_OS_NAME = osx ]; then sysctl -n hw.ncpu; else nproc; fi) install
cd $TRAVIS_BUILD_DIR
ffmpeg -i akiyo_cif.y4m -c:v libsvt_vp9 test.ivf
SvtVp9EncApp -i stdin -w 352 -h 288 -fps 30 -n 150 -b test2.ivf < 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
- valgrind -- SvtVp9EncApp -enc-mode 9 -i akiyo_cif.y4m -w 352 -h 288 -fps-num 30000 -fps-denom 1001 -n 150 -b test1.ivf