forked from ponylang/ponyc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis_script.bash
124 lines (103 loc) · 2.76 KB
/
.travis_script.bash
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
#! /bin/bash
set -o errexit
set -o nounset
if [[ "$TRAVIS_BRANCH" == "release" && "$FAVORITE_CONFIG" != "yes" ]]
then
echo "This is a release branch and there's nothing this matrix element must do."
exit 0
fi
ponyc-test(){
echo "Building and testing ponyc..."
make CC="$CC1" CXX="$CXX1" test-ci
}
ponyc-build-packages(){
echo "Installing ruby, rpm, and fpm..."
rvm use 2.2.3 --default
sudo apt-get install -y rpm
gem install fpm
echo "Building ponyc packages for deployment..."
make CC="$CC1" CXX="$CXX1" verbose=1 arch=x86-64 tune=intel package_name="ponyc" package_base_version="$(cat VERSION)" deploy
}
ponyc-build-docs(){
echo "Installing mkdocs..."
sudo -H pip install mkdocs
echo "Building ponyc docs..."
make CC="$CC1" CXX="$CXX1" docs-online
echo "Uploading docs using mkdocs..."
git remote add gh-token "https://${STDLIB_TOKEN}@github.com/ponylang/stdlib.ponylang.org"
git fetch gh-token
git reset gh-token/master
cd stdlib-docs
mkdocs gh-deploy -v --clean --remote-name gh-token --remote-branch master
}
case "${TRAVIS_OS_NAME}:${LLVM_CONFIG}" in
"linux:llvm-config-3.7")
ponyc-test
;;
"linux:llvm-config-3.8")
ponyc-test
;;
"linux:llvm-config-3.9")
# when FAVORITE_CONFIG stops matching part of this case, move this logic
if [[ "$TRAVIS_BRANCH" == "release" && "$TRAVIS_PULL_REQUEST" == "false" && "$FAVORITE_CONFIG" == "yes" ]]
then
ponyc-build-packages
ponyc-build-docs
else
ponyc-test
fi
;;
"linux:llvm-config-4.0")
ponyc-test
;;
"linux:llvm-config-5.0")
ponyc-test
;;
"osx:llvm-config-3.7")
echo "Running config=debug build..."
export config=debug
ponyc-test
echo "Running config=release build..."
export config=release
ponyc-test
;;
"osx:llvm-config-3.8")
echo "Running config=debug build..."
export config=debug
ponyc-test
echo "Running config=release build..."
export config=release
ponyc-test
;;
"osx:llvm-config-3.9")
export PATH=llvmsym/:$PATH
echo "Running config=debug build..."
export config=debug
ponyc-test
echo "Running config=release build..."
export config=release
ponyc-test
;;
"osx:llvm-config-4.0")
export PATH=llvmsym/:$PATH
echo "Running config=debug build..."
export config=debug
ponyc-test
echo "Running config=release build..."
export config=release
ponyc-test
;;
"osx:llvm-config-5.0")
export PATH=llvmsym/:$PATH
echo "Running config=debug build..."
export config=debug
ponyc-test
echo "Running config=release build..."
export config=release
ponyc-test
;;
*)
echo "ERROR: An unrecognized OS and LLVM tuple was found! Consider OS: ${TRAVIS_OS_NAME} and LLVM: ${LLVM_CONFIG}"
exit 1
;;
esac