-
Notifications
You must be signed in to change notification settings - Fork 819
/
.travis.yml
129 lines (127 loc) · 6.31 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
language: cpp
before_install:
- echo "Start to test on $TRAVIS_OS_NAME";
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export PIP=pip2; else export PIP=pip; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export OS=darwin; else export OS=linux; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export PYTHONPATH="/usr/local/lib/python2.7/site-packages:$PYTHONPATH"; fi
- sudo $PIP install pycodestyle
- export BAZEL_VERSION=0.16.0
- wget https://github.com/bazelbuild/bazel/releases/download/$BAZEL_VERSION/bazel-$BAZEL_VERSION-installer-$OS-x86_64.sh
- chmod +x bazel-*.sh
- sudo ./bazel-$BAZEL_VERSION-installer-$OS-x86_64.sh
- rm -f bazel-$BAZEL_VERSION-installer-$OS-x86_64.sh
- pushd /opt/
- sudo wget -q https://dl.google.com/android/repository/android-ndk-r15c-$OS-x86_64.zip
- sudo unzip -q android-ndk-r15c-$OS-x86_64.zip
- sudo rm -f android-ndk-r15c-$OS-x86_64.zip
- export ANDROID_NDK_VERSION=r15c
- export ANDROID_NDK=/opt/android-ndk-${ANDROID_NDK_VERSION}
- export ANDROID_NDK_HOME=${ANDROID_NDK}
- export PATH=${PATH}:${ANDROID_NDK_HOME}
- popd
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; brew cask install android-platform-tools; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get update; sudo apt-get install -y --no-install-recommends android-tools-adb; fi
- sudo $PIP install setuptools
- sudo $PIP install -I "tensorflow==1.8.0" "numpy==1.15.4" "sh==1.12.14" "pycodestyle==2.4.0" "pyyaml==3.13" "jinja2==2.10" "filelock==3.0.10" "scipy==1.2.0" "PTable==0.9.2"
jobs:
include:
- stage: Check Code Style
script:
- echo 'Check Code Style'
- curl -o cpplint.py https://raw.githubusercontent.com/google/styleguide/gh-pages/cpplint/cpplint.py && python cpplint.py --linelength=80 --counting=detailed $(find mace -name "*.h" -or -name "*.cc") && rm -f cpplint.py || exit 1;
- pycodestyle $(find . -name "*.py") || exit 1;
env: TYPE=Check-Code-Stype
os: linux
dist: xenial
sudo: required
- stage: Check Code Style
script:
- echo 'Check Code Style'
- curl -o cpplint.py https://raw.githubusercontent.com/google/styleguide/gh-pages/cpplint/cpplint.py && python cpplint.py --linelength=80 --counting=detailed $(find mace -name "*.h" -or -name "*.cc") && rm -f cpplint.py || exit 1;
- pycodestyle $(find . -name "*.py") || exit 1;
env: TYPE=Check-Code-Stype
os: osx
osx_image: xcode7.2
- stage: Unit Test
script:
- echo "Ops Test"
- python tools/bazel_adb_run.py --target="//test/ccunit:mace_cc_test" --run_target=False --target_abis=armeabi-v7a,arm64-v8a,arm64 || exit 1;
env: TYPE=Ops-Test
os: linux
dist: xenial
sudo: required
- stage: Unit Test
script:
- echo "Ops Test"
- python tools/bazel_adb_run.py --target="//test/ccunit:mace_cc_test" --run_target=False --target_abis=armeabi-v7a,arm64-v8a,arm64 || exit 1;
env: TYPE=Ops-Test
os: osx
osx_image: xcode7.2
- stage: Unit Test
script:
- echo "Ops Test On Darwin"
- python tools/bazel_adb_run.py --target="//test/ccunit:mace_cc_test" --run_target=False --target_abis=host || exit 1;
- bazel build "//test/ccunit:mace_cc_test" --config=ios --config=optimization_darwin --define quantize=true --define neon=true --config symbol_hidden || exit 1;
env: TYPE=Ops-Test
os: osx
osx_image: xcode7.2
- stage: Unit Test
script:
- echo "Ops Test Without NEON"
- python tools/bazel_adb_run.py --target="//test/ccunit:mace_cc_test" --run_target=False --target_abis=armeabi-v7a,arm64-v8a,arm64 --enable_neon=false --enable_quantize=false || exit 1
env: TYPE=Ops-Test-Without-NEON
os: linux
dist: xenial
sudo: required
- stage: Unit Test
script:
- python tools/bazel_adb_run.py --target="//test/ccbenchmark:mace_cc_benchmark" --run_target=False --target_abis=armeabi-v7a,arm64-v8a,arm64 || exit 1;
env: TYPE=Ops-Benchmark
os: linux
dist: xenial
sudo: required
- stage: Unit Test
script:
- python tools/bazel_adb_run.py --target="//test/ccbenchmark:mace_cc_benchmark" --run_target=False --target_abis=armeabi-v7a,arm64-v8a,arm64 || exit 1;
env: TYPE=Ops-Benchmark
os: osx
osx_image: xcode7.2
- stage: Unit Test
script:
- python tools/bazel_adb_run.py --target="//test/ccbenchmark:mace_cc_benchmark" --run_target=False --target_abis=host || exit 1;
- bazel build "//test/ccbenchmark:mace_cc_benchmark" --config=ios --config=optimization_darwin --define quantize=true --define neon=true --config symbol_hidden || exit 1;
env: TYPE=Ops-Benchmark
os: osx
osx_image: xcode7.2
- stage: Extra Test
script:
- sh tools/cmake-build-android-armeabi-v7a-full.sh
- LIBMACE32_FULL_SIZE=`stat -c%s cmake-build/android-armeabi-v7a-full/install/lib/libmace.so`
- if (( LIBMACE32_FULL_SIZE > 2200000 )) ; then echo "The libmace.so size too large"; exit 1; fi
env: TYPE=Build-Library
os: linux
dist: xenial
sudo: required
- stage: Extra Test
script:
- sh tools/cmake-build-android-arm64-v8a-full.sh
- LIBMACE64_FULL_SIZE=`stat -c%s cmake-build/android-arm64-v8a-full/install/lib/libmace.so`
- if (( LIBMACE64_FULL_SIZE > 3100000 )) ; then echo "The libmace.so size too large"; exit 1; fi
env: TYPE=Build-Library
os: linux
dist: xenial
sudo: required
- stage: Extra Test
script:
- bazel build "//mace/libmace:libmace_static" --config=darwin --config=optimization_darwin --define quantize=true --config symbol_hidden || exit 1;
- bazel build "//mace/libmace:libmace_dynamic" --config=darwin --config=optimization_darwin --define quantize=true --config symbol_hidden || exit 1;
env: TYPE=Build-Library
os: osx
osx_image: xcode7.2
- stage: Extra Test
script:
- bazel build "//mace/libmace:libmace_static" --config=ios --config=optimization_darwin --define quantize=true --define neon=true --config symbol_hidden || exit 1;
- bazel build "//mace/libmace:libmace_dynamic" --config=ios --config=optimization_darwin --define quantize=true --define neon=true --config symbol_hidden || exit 1;
env: TYPE=Build-Library
os: osx
osx_image: xcode7.2