1 # Linux Build Configuration for Travis
9 # Use Ubuntu 14.04 LTS (Trusty) as the Linux testing environment.
15 - secure: IoR/Xe9E+NnLAeI23WrmUsGQn5rocz+XRYUk+BbaoKiIRYm4q72GKyypRoOGLu7wImOXFSvnN/dpdnqIpx4W0NfsSvNdlXyhDy+wvT1kzTt77dJGnkGZTZ2SBOtC9AECLy4sqM9HG0rYRR6WfXcnP2GlrE5f2aF07aISQbOUsQMvyyhtCmVAzIigK1zIUto5I0pNenvo/Y+ur+mEvTh+FtaoDIGepCbZlCc+OxqRXwXNlI7mDXbzLPmTB1FWTGsrZdRX8czF9tN9Y+T79DQjB4Lcyyeow8yU9NBVlgzZJcp1xI0UIskRT8gVrXmBYL2dMeHnDQuhxjEg9n7jfr3ptA9rgwMaSsgdaLwuBXgtPuqVgUYDpE1cP8WI8q38MXX0I6psTs/WHu+z+5UwfjzpPOHmGdVt48o8ymFTapvD5Cf1+uJyk73QkyStnPIdBF1N9Yx5sD7HN28K6/Ro12sCCePHUZ9Uz1DdZI6XxkgCNKNwao0csAyvODxD6Ee43mkExtviB8BJY5jWLIMTdGhgEGH2sRqils8IDW0p8AOTPM4UC7iA7hdg3pA+XMvBHvP9ixsY7tuB+yR2AfnFaSw2DVbwI5GgFdFMNHXYuL+9V9Wuh3keBKYQT/Hy1YvxjQ/t9UouYHqEsyVFUl3R4lEAM9+qSRsRu+EKmcSO2QtCsWc=
17 # Each line is a set of environment variables set before a build.
18 # Thus each line represents a different build configuration.
19 - BUILD_TYPE=RelWithDebInfo
29 # Additional build using Android NDK with android-cmake
30 - env: BUILD_ANDROID_CMAKE=ON
31 # Additional build using Android NDK with Android.mk
32 - env: BUILD_ANDROID_MK=ON
33 # Additional check over format
34 - env: CHECK_FORMAT=ON
36 # Skip GCC builds on macOS.
51 - if [[ "$BUILD_ANDROID_CMAKE" == "ON" ]] || [[ "$BUILD_ANDROID_MK" == "ON" ]]; then
52 git clone --depth=1 https://github.com/urho3d/android-ndk.git $HOME/android-ndk;
53 export ANDROID_NDK=$HOME/android-ndk;
54 git clone --depth=1 https://github.com/taka-no-me/android-cmake.git $HOME/android-cmake;
55 export TOOLCHAIN_PATH=$HOME/android-cmake/android.toolchain.cmake;
57 - if [[ "$CHECK_FORMAT" == "ON" ]]; then
58 curl -L http://llvm.org/svn/llvm-project/cfe/trunk/tools/clang-format/clang-format-diff.py -o utils/clang-format-diff.py;
62 - git clone --depth=1 https://github.com/KhronosGroup/SPIRV-Headers external/spirv-headers
63 - git clone --depth=1 https://github.com/google/googletest external/googletest
64 - git clone --depth=1 https://github.com/google/effcee external/effcee
65 - git clone --depth=1 https://github.com/google/re2 external/re2
68 # Due to the limitation of Travis platform, we cannot start too many concurrent jobs.
69 # Otherwise GCC will panic with internal error, possibility because of memory issues.
70 # ctest with the current tests doesn't profit from using more than 4 threads.
72 - mkdir build && cd build
73 - if [[ "$BUILD_ANDROID_MK" == "ON" ]]; then
74 export BUILD_DIR=$(pwd);
75 mkdir ${BUILD_DIR}/libs;
76 mkdir ${BUILD_DIR}/app;
77 $ANDROID_NDK/ndk-build -C ../android_test NDK_PROJECT_PATH=.
78 NDK_LIBS_OUT=${BUILD_DIR}/libs
79 NDK_APP_OUT=${BUILD_DIR}/app -j${NPROC};
80 elif [[ "$BUILD_ANDROID_CMAKE" == "ON" ]]; then
81 cmake -DCMAKE_TOOLCHAIN_FILE=${TOOLCHAIN_PATH}
82 -DANDROID_NATIVE_API_LEVEL=android-9
83 -DCMAKE_BUILD_TYPE=Release
84 -DANDROID_ABI="armeabi-v7a with NEON"
85 -DSPIRV_BUILD_COMPRESSION=ON
86 -DSPIRV_SKIP_TESTS=ON ..;
88 elif [[ "$CHECK_FORMAT" == "ON" ]]; then
90 ./utils/check_code_format.sh;
92 cmake -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DSPIRV_BUILD_COMPRESSION=ON -DCMAKE_INSTALL_PREFIX=install ..;
93 make -j${NPROC} install;
94 ctest -j${NPROC} --output-on-failure --timeout 300;
98 # Create tarball for deployment
99 - if [[ "${CC}" == "clang" && "${BUILD_ANDROID_MK}" != "ON" && "${BUILD_ANDROID_CMAKE}" != "ON" && "${CHECK_FORMAT}" != "ON" ]]; then
101 export TARBALL=SPIRV-Tools-master-${TRAVIS_OS_NAME}-${BUILD_TYPE}.zip;
102 find . -print | zip -@ ${TARBALL};
106 # Tag the current master top of the tree as "master-tot".
107 # Travis CI relies on the tag name to push to the correct release.
108 - git config --global user.name "Travis CI"
109 - git config --global user.email "builds@travis-ci.org"
110 - git tag -f master-tot
111 - git push -q -f https://${spirvtoken}@github.com/KhronosGroup/SPIRV-Tools --tags
115 api_key: ${spirvtoken}
118 condition: ${CC} == clang && ${BUILD_ANDROID_MK} != ON && ${BUILD_ANDROID_CMAKE} != ON && ${CHECK_FORMAT} != ON
127 - antiagainst@google.com
128 - awoloszyn@google.com