forked from ben-manes/caffeine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
travis.sh
executable file
·41 lines (37 loc) · 1.01 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
#!/bin/bash
set -eu
run() {
echo $1
eval $1
}
runSlow() {
echo $1
eval $1 &
pid=$!
while kill -0 $pid 2>/dev/null
do
echo -ne .
sleep 1
done
}
case "${1:?''}" in
analysis)
run "./gradlew pmdJavaPoet pmdMain -Dpmd --console plain"
run "./gradlew spotbugsJavaPoet spotbugsMain spotbugsJmh -Dspotbugs --console plain"
run "sh -c 'cd examples/stats-metrics && ./gradlew test --console plain --no-daemon'"
run "sh -c 'cd examples/write-behind-rxjava && mvn test'"
run "sh -c 'cd examples/coalescing-bulkloader && mvn test'"
;;
tests)
run "./gradlew check --console plain"
runSlow "./gradlew :caffeine:slowCaffeineTest --console plain"
runSlow "./gradlew :caffeine:slowGuavaTest --console plain"
if [[ (${CI:-false} == "true") && (${TRAVIS_PULL_REQUEST:-false} == "false") ]]; then
run "./gradlew coveralls uploadArchives --console plain"
runSlow "./gradlew sonarqube --console plain"
fi
;;
*)
echo $"Usage: $0 {analysis|tests}"
exit 1
esac