forked from XiaoMi/mace
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
47 lines (45 loc) · 2.84 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
language: cpp
os: linux
dist: xenial
sudo: required
before_install:
- sudo pip install pycodestyle
- export BAZEL_VERSION=0.13.1
- wget https://github.com/bazelbuild/bazel/releases/download/$BAZEL_VERSION/bazel-$BAZEL_VERSION-installer-linux-x86_64.sh
- chmod +x bazel-*.sh
- sudo ./bazel-$BAZEL_VERSION-installer-linux-x86_64.sh
- rm -f bazel-$BAZEL_VERSION-installer-linux-x86_64.sh
- pushd /opt/
- sudo wget -q https://dl.google.com/android/repository/android-ndk-r15c-linux-x86_64.zip
- sudo unzip -q android-ndk-r15c-linux-x86_64.zip
- sudo rm -f android-ndk-r15c-linux-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
- sudo apt-get update
- sudo apt-get install -y --no-install-recommends android-tools-adb
- sudo pip install setuptools
- sudo pip install -I tensorflow==1.8.0 "numpy>=1.14.0" scipy jinja2 pyyaml sh==1.12.14 pycodestyle==2.4.0 filelock
script:
- >
echo "MACE_TEST 0: Check cpp 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;
echo "MACE_TEST 1: Check python code style";
pycodestyle $(find -name "*.py") || exit 1;
echo "MACE_TEST 2: Platform compatible test";
mkdir -p mace/codegen/version && bash mace/tools/git/gen_version_source.sh mace/codegen/version/version.cc || exit 1;
mkdir -p mace/codegen/tuning && python mace/python/tools/binary_codegen.py --output_path=mace/codegen/tuning/tuning_params.cc || exit 1;
bazel build mace/core:core || exit 1;
echo "MACE_TEST 3: Ops test";
python tools/bazel_adb_run.py --target="//mace/ops:ops_test" --run_target=False --target_abis=armeabi-v7a,arm64-v8a || exit 1;
python tools/bazel_adb_run.py --target="//mace/ops:ops_test" --run_target=False --target_abis=armeabi-v7a,arm64-v8a --enable_neon=false || exit 1;
echo "MACE_TEST 4: Api test";
python tools/bazel_adb_run.py --target="//mace/test:mace_api_test" --run_target=False --target_abis=armeabi-v7a,arm64-v8a || exit 1;
python tools/bazel_adb_run.py --target="//mace/test:mace_api_mt_test" --run_target=False --target_abis=armeabi-v7a,arm64-v8a || exit 1;
echo "MACE_TEST 5: Ops benchmark";
python tools/bazel_adb_run.py --target="//mace/ops:ops_benchmark" --run_target=False --target_abis=armeabi-v7a,arm64-v8a || exit 1;
echo "MACE_TEST 6: Extra test";
python tools/bazel_adb_run.py --target="//mace/kernels:kernels_test" --run_target=False --target_abis=armeabi-v7a,arm64-v8a || exit 1;
python tools/bazel_adb_run.py --target="//mace/utils:tuner_test" --run_target=False --target_abis=armeabi-v7a,arm64-v8a || exit 1;