forked from opprop/checker-framework-inference
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis-build.sh
executable file
·48 lines (38 loc) · 1.4 KB
/
.travis-build.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
#!/bin/bash
ROOT=$TRAVIS_BUILD_DIR/..
# Fail the whole script if any command fails
set -e
export SHELLOPTS
# Optional argument $1 is one of:
# cfi-tests, downstream
# If it is omitted, this script does everything.
export GROUP=$1
if [[ "${GROUP}" == "" ]]; then
export GROUP=all
fi
SLUGOWNER=${TRAVIS_REPO_SLUG%/*}
if [[ "$SLUGOWNER" == "" ]]; then
SLUGOWNER=opprop
fi
if [[ "${GROUP}" != "cfi-tests" && "${GROUP}" != "downstream" && "${GROUP}" != "all" ]]; then
echo "Bad argument '${GROUP}'; should be omitted or one of: cfi-tests, downstream, all."
exit 1
fi
. ./.travis-build-without-test.sh
# Test CF Inference
if [[ "${GROUP}" == "cfi-tests" || "${GROUP}" == "all" ]]; then
./gradlew test
fi
# Downstream tests
if [[ "${GROUP}" == "downstream" || "${GROUP}" == "all" ]]; then
# Only perform ontology downstream test in opprop.
if [[ "${SLUGOWNER}" == "opprop" ]]; then
# Ontology test: 10 minutes
echo "Running: (cd .. && git clone --depth 1 https://github.com/opprop/ontology.git)"
(cd .. && git clone --depth 1 https://github.com/opprop/ontology.git)
echo "... done: (cd .. && git clone --depth 1 https://github.com/opprop/ontology.git)"
echo "Running: (cd ../ontology && gradle build -x test && ./test-ontology.sh)"
(cd ../ontology && gradle build -x test && ./test-ontology.sh)
echo "... done: (cd ../ontology && gradle build -x test && ./test-ontology.sh)"
fi
fi