forked from timniederhausen/gn-build
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
93 lines (77 loc) · 2.9 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
language: cpp
env:
global:
# https://chromium.googlesource.com/chromium/buildtools/+/04161ec8d7c781e4498c699254c69ba0dd959fde
- GN_LNX64_SHA1: 3523d50538357829725d4ed74b777a572ce0ac74
- GN_MAC_SHA1: d43122f6140d0711518aa909980cb009c4fbce3d
- NINJA_LNX_ZIP: https://github.com/ninja-build/ninja/releases/download/v1.7.2/ninja-linux.zip
- NINJA_MAC_ZIP: https://github.com/ninja-build/ninja/releases/download/v1.7.2/ninja-mac.zip
addons:
apt:
sources: &sources
# this is needed for gcc and clang
- ubuntu-toolchain-r-test
matrix:
include:
- compiler: gcc
os: linux
env: GN_ARGS='gcc_cc="gcc-4.9" gcc_cxx="g++-4.9" is_clang=false'
addons: &gcc_addons
apt:
sources:
- *sources
packages:
- g++-4.9
- compiler: gcc
os: linux
env: GN_ARGS='gcc_cc="gcc-4.9" gcc_cxx="g++-4.9" is_clang=false is_debug=false'
addons: *gcc_addons
- compiler: gcc
os: linux
env: GN_ARGS='gcc_cc="gcc-4.9" gcc_cxx="g++-4.9" is_clang=false is_official_build=true'
addons: *gcc_addons
- compiler: clang
os: linux
env: GN_ARGS='clang_cc="clang-3.8" clang_cxx="clang++-3.8" is_clang=true'
addons: &clang_addons
apt:
sources:
- llvm-toolchain-precise-3.8
- *sources
packages:
- clang-3.8
- compiler: clang
os: linux
env: GN_ARGS='clang_cc="clang-3.8" clang_cxx="clang++-3.8" is_clang=true is_debug=false'
addons: *clang_addons
- compiler: clang
os: linux
env: GN_ARGS='clang_cc="clang-3.8" clang_cxx="clang++-3.8" is_clang=true is_official_build=true'
addons: *clang_addons
- compiler: clang
os: osx
env: GN_ARGS='is_clang=true is_official_build=true'
install:
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then export GN_SHA1="$GN_LNX64_SHA1"; export NINJA_ZIP="$NINJA_LNX_ZIP"; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export GN_SHA1="$GN_MAC_SHA1"; export NINJA_ZIP="$NINJA_MAC_ZIP"; fi
- echo $GN_SHA1
script:
# Run gn_helpers unittests first - this should fail if we have an unsupported Python version
- python gn_helpers_unittest.py
# Install recent Ninja
- travis_retry wget --no-check-certificate --quiet -O ninja.zip $NINJA_ZIP
- python -c 'import sys,zipfile;zipfile.ZipFile(sys.argv[1]).extractall()' ninja.zip
- chmod +x ninja
# Install recent GN binary (from Chromium)
- travis_retry wget --no-check-certificate --quiet -O gn https://storage.googleapis.com/chromium-gn/$GN_SHA1
- chmod +x gn
# Setup test project for our //build
- git clone --branch=testsrc https://github.com/timniederhausen/gn-build.git testsrc
- mkdir testsrc/build
- mv config testsrc/build/
- mv toolchain testsrc/build/
# Try to build the test project
- ./gn gen out --args="$GN_ARGS" --root=testsrc
- cat out/args.gn
- ./ninja -C out
- cd out && ./hello