forked from corda/corda-runtime-os
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-benchmark.sh
executable file
·44 lines (32 loc) · 1.88 KB
/
build-benchmark.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
# The purpose of this script it so run a number of build benchmark tests. The results of these tests will be sent
# to Gradle Enterprise so that we can analyse them.
#
MAX_WORKERS=4
TAG_BENCHMARK="build-benchmark-5.2" # Gradle build scan label prefix - should remain stable
TAG_EXP="${TAG_BENCHMARK}-0002" # Gradle build scan label suffix - can be incremented in case we want another set of benchmarks, for example to compare a before/after change
TAG_CACHE="cache"
TAG_NO_CACHE="no-cache"
TAG_CLEAN="clean"
TAG_INCREMENTAL="incremental"
TAG_BENCHMARK_ID="${USER}-$(date +%y%m%d_%H%M%S)"
gradle_run() {
echo "[$1] $2"
./gradlew -Dscan.tag.${TAG_BENCHMARK} -Dscan.tag.${TAG_EXP} -Dscan.tag.${TAG_EXP} -Dscan.tag.${TAG_BENCHMARK_ID} -Dscan.tag.$1 --parallel --max-workers=${MAX_WORKERS} $2
}
set -x
./gradlew --stop
echo "Using ${MAX_WORKERS} workers"
echo "Building without cache"
gradle_run "${TAG_EXP}-${TAG_NO_CACHE}-${TAG_CLEAN}" "--no-build-cache clean"
gradle_run "${TAG_EXP}-${TAG_NO_CACHE}-${TAG_CLEAN}" "--no-build-cache publishOSGiImage -PmultiArchSupport=false"
gradle_run "${TAG_EXP}-${TAG_NO_CACHE}-${TAG_INCREMENTAL}" "--no-build-cache publishOSGiImage -PmultiArchSupport=false"
echo "Building with cache"
gradle_run "${TAG_EXP}-${TAG_CACHE}-${TAG_CLEAN}" "--build-cache clean"
gradle_run "${TAG_EXP}-${TAG_CACHE}-${TAG_CLEAN}" "--build-cache publishOSGiImage -PmultiArchSupport=false"
gradle_run "${TAG_EXP}-${TAG_CACHE}-${TAG_INCREMENTAL}" "--build-cache publishOSGiImage -PmultiArchSupport=false"
echo "(Incremental) Detekt without cache"
gradle_run "${TAG_EXP}-${TAG_NO_CACHE}-${TAG_INCREMENTAL}" "--no-build-cache detekt"
echo "(Incremental) Testing without cache"
gradle_run "${TAG_EXP}-${TAG_NO_CACHE}-${TAG_INCREMENTAL}" "--no-build-cache test"
echo "(Incremental) Testing without cache"
gradle_run "${TAG_EXP}-${TAG_NO_CACHE}-${TAG_INCREMENTAL}" "--no-build-cache integrationTest"