blob: 2478912177cb4c225f057311fea29246df4af4a0 [file] [log] [blame]
Lei Zhangc4ebb552016-05-04 11:29:21 -04001# Linux and Mac Build Configuration for Travis
2
3language: cpp
4
5os:
6 - linux
7 - osx
8
9# Use Ubuntu 14.04 LTS (Trusty) as the Linux testing environment.
Lei Zhangb21213e2017-05-13 14:26:30 -040010sudo: false
Lei Zhangc4ebb552016-05-04 11:29:21 -040011dist: trusty
12
13env:
Lei Zhangfba299a2017-11-08 21:32:01 -050014 global:
15 - secure: aGFrgzyKp+84hKrGkxVWg8cHV61uqrKEHT38gfSQK6+WS4GfLOyH83p7WnsEBb7AMhzU7LMNFdvOFr6+NaMpVnqRvc40CEG1Q+lNg9Pq9mhIZLowvDrfqTL9kQ+8Nbw5Q6/dg6CTvY7fvRfpfCEmKIUZBRkoKUuHeuM1uy3IupFcdNuL5bSYn3Beo+apSJginh9DI4BLDXFUgBzTRSLLyCX5g3cpaeGGOCr8quJlYx75W6HRck5g9SZuLtUoH9GFEV3l+ZEWB8noErW+J56L03bwNwFuuAh321evw++oQk5KFa8rlDvar3SJ3b1RHB8u/eq5DBYMyaK/fS8+Q7QbGr8diF/wDe68bKO7U9IhpNfExXmczCpExjHomW5TQv4rYdGhygPMfW97aIsPRYyNKcl4fkmb7NDrM8w0Jscdq2g5c2Kz0ItyZoBri/NXLwFQQjaVCs7Pf97TjuMA7mK0GJmDTRzi6SrDYlWMt5BQL3y0CCojyfLIRcTh0CQjQI29s97bLfQrYAxt9GNNFR+HTXRLLrkaAlJkPGEPwUywlSfEThnvHLesNxYqemolAYpQT4ithoL4GehGIHmaxsW295aKVhuRf8K9eBODNqrfblvM42UHhjntT+92ZnQ/Gkq80GqaMxnxi4PO5FyPIxt0r981b54YBkWi8YA4P7w5pNI=
16 matrix:
17 - GLSLANG_BUILD_TYPE=Release
18 - GLSLANG_BUILD_TYPE=Debug
Lei Zhangc4ebb552016-05-04 11:29:21 -040019
20compiler:
21 - clang
22 - gcc
23
24matrix:
25 fast_finish: true # Show final status immediately if a test fails.
26 exclude:
27 # Skip GCC builds on Mac OS X.
28 - os: osx
29 compiler: gcc
Lei Zhangb21213e2017-05-13 14:26:30 -040030 include:
31 # Additional build using Android NDK.
32 - env: BUILD_NDK=ON
Lei Zhangc4ebb552016-05-04 11:29:21 -040033
34cache:
35 apt: true
36
37branches:
38 only:
39 - master
40
41addons:
42 apt:
43 packages:
44 - clang-3.6
Lei Zhangc4ebb552016-05-04 11:29:21 -040045
46install:
Lei Zhangb21213e2017-05-13 14:26:30 -040047 # Make sure that clang-3.6 is selected on Linux.
Lei Zhangc4ebb552016-05-04 11:29:21 -040048 - if [[ "$TRAVIS_OS_NAME" == "linux" && "$CC" == "clang" ]]; then
49 export CC=clang-3.6 CXX=clang++-3.6;
50 fi
David Neto4aeca2d2018-07-12 14:49:26 -040051 # Download a recent Android NDK and use its android.toolchain.cmake file.
Lei Zhangb21213e2017-05-13 14:26:30 -040052 - if [[ "$BUILD_NDK" == "ON" ]]; then
Lei Zhangb21213e2017-05-13 14:26:30 -040053 export ANDROID_NDK=$HOME/android-ndk;
David Neto3541d8a2018-07-11 15:31:36 -040054 git init $ANDROID_NDK;
55 pushd $ANDROID_NDK;
David Neto4aeca2d2018-07-12 14:49:26 -040056 git remote add dneto0 https://github.com/dneto0/android-ndk.git;
57 git fetch --depth=1 dneto0 r17b-strip;
David Neto3541d8a2018-07-11 15:31:36 -040058 git checkout FETCH_HEAD;
59 popd;
David Neto4aeca2d2018-07-12 14:49:26 -040060 export TOOLCHAIN_PATH=$ANDROID_NDK/build/cmake/android.toolchain.cmake;
Lei Zhangb21213e2017-05-13 14:26:30 -040061 fi
Lei Zhangc4ebb552016-05-04 11:29:21 -040062
63before_script:
Lei Zhangafa128a2017-09-25 14:04:20 -040064 - git clone --depth=1 https://github.com/google/googletest.git External/googletest
GregFf4517562017-09-22 15:30:10 -060065 - ./update_glslang_sources.py
Lei Zhangc4ebb552016-05-04 11:29:21 -040066
67script:
68 - mkdir build && cd build
Lei Zhangb21213e2017-05-13 14:26:30 -040069 # For Android, do release building using NDK without testing.
David Neto4aeca2d2018-07-12 14:49:26 -040070 # Use android-14, the oldest native API level supporeted by NDK r17b.
71 # We can use newer API levels if we want.
Lei Zhangb21213e2017-05-13 14:26:30 -040072 # For Linux and macOS, do debug/release building with testing.
73 - if [[ "$BUILD_NDK" == "ON" ]]; then
74 cmake -DCMAKE_TOOLCHAIN_FILE=${TOOLCHAIN_PATH}
David Neto4aeca2d2018-07-12 14:49:26 -040075 -DANDROID_NATIVE_API_LEVEL=android-14
Lei Zhangb21213e2017-05-13 14:26:30 -040076 -DCMAKE_BUILD_TYPE=Release
77 -DANDROID_ABI="armeabi-v7a with NEON"
Lei Zhangafa128a2017-09-25 14:04:20 -040078 -DBUILD_TESTING=OFF ..;
79 make -j4;
Lei Zhangb21213e2017-05-13 14:26:30 -040080 else
81 cmake -DCMAKE_BUILD_TYPE=${GLSLANG_BUILD_TYPE}
Lei Zhangafa128a2017-09-25 14:04:20 -040082 -DCMAKE_INSTALL_PREFIX=`pwd`/install ..;
83 make -j4 install;
Lei Zhangb21213e2017-05-13 14:26:30 -040084 ctest --output-on-failure &&
85 cd ../Test && ./runtests;
86 fi
Lei Zhangfba299a2017-11-08 21:32:01 -050087
88after_success:
89 # For debug build, the generated dll has a postfix "d" in its name.
90 - if [[ "${GLSLANG_BUILD_TYPE}" == "Debug" ]]; then
91 export SUFFIX="d";
92 else
93 export SUFFIX="";
94 fi
95 # Create tarball for deployment
96 - if [[ ${CC} == clang* && "${BUILD_NDK}" != "ON" ]]; then
97 cd ../build/install;
98 export TARBALL=glslang-master-${TRAVIS_OS_NAME}-${GLSLANG_BUILD_TYPE}.zip;
99 zip ${TARBALL}
100 bin/glslangValidator
101 include/glslang/*
102 include/SPIRV/*
103 lib/libglslang${SUFFIX}.a
104 lib/libHLSL${SUFFIX}.a
105 lib/libOGLCompiler${SUFFIX}.a
106 lib/libOSDependent${SUFFIX}.a
107 lib/libSPIRV${SUFFIX}.a
108 lib/libSPVRemapper${SUFFIX}.a
109 lib/libSPIRV-Tools${SUFFIX}.a
110 lib/libSPIRV-Tools-opt${SUFFIX}.a;
111 fi
112
113before_deploy:
114 # Tag the current top of the tree as "master-tot".
115 # Travis CI replies on the tag name to properly push to GitHub Releases.
116 - git config --global user.name "Travis CI"
117 - git config --global user.email "builds@travis-ci.org"
118 - git tag -f master-tot
119 - git push -q -f https://${glslangtoken}@github.com/KhronosGroup/glslang --tags
120
121deploy:
122 provider: releases
123 api_key: ${glslangtoken}
124 on:
125 branch: master
126 condition: ${CC} == clang* && ${BUILD_NDK} != ON
127 file: ${TARBALL}
128 skip_cleanup: true
129 overwrite: true