From 2ee8a4c84b26b1821ecb9a04f3db44df9775482d Mon Sep 17 00:00:00 2001 From: Liu Yiqun Date: Mon, 4 Sep 2017 19:08:33 +0800 Subject: [PATCH] Add build_ios task in travis, and move the installing of glide into check_style.sh. --- .travis.yml | 11 +++++++---- paddle/scripts/travis/build_ios.sh | 17 +++++++++++++++++ paddle/scripts/travis/check_style.sh | 6 ++++++ 3 files changed, 30 insertions(+), 4 deletions(-) create mode 100755 paddle/scripts/travis/build_ios.sh diff --git a/.travis.yml b/.travis.yml index b4b83fcdbc8..d8f3c0be9bf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,6 +5,7 @@ cache: - $HOME/.cache/pip - $TRAVIS_BUILD_DIR/build/third_party - $TRAVIS_BUILD_DIR/build_android/third_party + - $TRAVIS_BUILD_DIR/build_ios/third_party sudo: required dist: trusty os: @@ -13,6 +14,12 @@ env: - JOB=build_doc - JOB=check_style - JOB=build_android +matrix: + include: + - env: JOB=build_ios + os: osx + osx_image: xcode8.3 + compiler: clang addons: apt: packages: @@ -39,10 +46,6 @@ before_install: # protobuf version. - pip install -r $TRAVIS_BUILD_DIR/python/requirements.txt - pip install wheel sphinx==1.5.6 recommonmark sphinx-rtd-theme==0.1.9 virtualenv pre-commit LinkChecker - - curl https://glide.sh/get | bash - - eval "$(GIMME_GO_VERSION=1.8.3 gimme)" - - go get -u github.com/alecthomas/gometalinter - - gometalinter --install - | function timeout() { perl -e 'alarm shift; exec @ARGV' "$@"; } script: diff --git a/paddle/scripts/travis/build_ios.sh b/paddle/scripts/travis/build_ios.sh new file mode 100755 index 00000000000..d303804252f --- /dev/null +++ b/paddle/scripts/travis/build_ios.sh @@ -0,0 +1,17 @@ +#!/bin/bash +set -e + +# Create the build directory for CMake. +mkdir -p $TRAVIS_BUILD_DIR/build_ios +cd $TRAVIS_BUILD_DIR/build_ios + +# Compile paddle binaries +cmake -DCMAKE_SYSTEM_NAME=iOS \ + -DIOS_PLATFORM=OS \ + -DWITH_C_API=ON \ + -DWITH_TESTING=OFF \ + -DWITH_SWIG_PY=OFF \ + -DWITH_STYLE_CHECK=OFF \ + .. + +make -j `nproc` diff --git a/paddle/scripts/travis/check_style.sh b/paddle/scripts/travis/check_style.sh index ec499a839ac..cb483b0ffc0 100755 --- a/paddle/scripts/travis/check_style.sh +++ b/paddle/scripts/travis/check_style.sh @@ -8,6 +8,12 @@ function abort(){ trap 'abort' 0 set -e +# install glide +curl https://glide.sh/get | bash +eval "$(GIMME_GO_VERSION=1.8.3 gimme)" +go get -u github.com/alecthomas/gometalinter +gometalinter --install + cd $TRAVIS_BUILD_DIR export PATH=/usr/bin:$PATH pre-commit install -- GitLab