-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy path.travis.sh
executable file
·61 lines (44 loc) · 1.33 KB
/
.travis.sh
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
#!/bin/bash
set -euo pipefail
IFS=$'\n\t'
if [[ -n "${TRAVIS_PULL_REQUEST:-}" ]] || [[ -n "${TRAVIS_COMMIT_RANGE:-}" ]]; then
if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
file_names=$(curl "https://api.github.com/repos/$TRAVIS_REPO_SLUG/pulls/$TRAVIS_PULL_REQUEST/files" \
| jq '.[] | .filename' | tr '\n' ' ' | tr '"' ' ')
else
file_names=$( (git diff --name-only "$TRAVIS_COMMIT_RANGE" || echo "") \
| tr '\n' ' ' )
fi
else
echo "WARNING: No travis information present, assuming this is a non-travis test run..." >&2
NO_TRAVIS=y
fi
### Setup activity ticker
(
while true; do
echo '...'
sleep 10
done
)&
TICKER_PID=$!
trap 'kill ${TICKER_PID:-} ${BUILD_PID:-} &>/dev/null || :' EXIT
### base.bash
if [[ -z "${NO_TRAVIS:-}" ]]; then
if echo "$file_names" | grep -q "Dockerfile"; then
echo -n 'Building base image (if needed) ... '
make base &>/tmp/base.bash.log
echo 'DONE.'
fi
fi
### build.bash
echo "Running build of llvm-$VARIANT... "
make NO_TTY=y "ARCH=$ARCH" "VARIANT=$VARIANT" build &>/tmp/build.bash.log &
BUILD_PID=$!
wait $BUILD_PID
echo 'DONE.'
### build_example.bash
if [[ $ARCH == *arm* ]] && [[ $VARIANT == obfuscator ]]; then
echo -n 'Building example project... '
make NO_TTY=y build-example &>/tmp/build_example.bash.log
echo 'DONE.'
fi