forked from renaissance-benchmarks/renaissance
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
125 lines (112 loc) · 4.69 KB
/
.travis.yml
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
125
sudo: false
dist: trusty
language: java
env:
global:
- RENAISSANCE_VERSION="0.10.0"
refs:
- &bundle
stage: bundle
script:
# Fail the script if any command fails
- set -e
- 'java -version'
- 'javac -version'
- ./tools/sbt/bin/sbt assembly
- ./tools/sbt/bin/sbt renaissanceJmh/jmh:assembly
# Ensure that the JMH bundle contains non-empty BenchmarkList
- 'test $(unzip -p renaissance-jmh/target/scala-2.12/renaissance-jmh-assembly-$RENAISSANCE_VERSION.jar META-INF/BenchmarkList | wc -l) -gt 0'
# Clear cache directory
- 'mkdir -p "$HOME/.prebuilt"'
- 'ls "$HOME/.prebuilt"'
- 'rm -f "$HOME/.prebuilt"/*.jar'
# Store bundles in cache directory
- 'cp target/renaissance-gpl-$RENAISSANCE_VERSION.jar "$HOME/.prebuilt/$(git rev-parse HEAD).jar"'
- 'cp renaissance-jmh/target/scala-2.12/renaissance-jmh-assembly-$RENAISSANCE_VERSION.jar "$HOME/.prebuilt/$(git rev-parse HEAD)-jmh-assembly.jar"'
- &bench
stage: benchmark
script:
# Fail the script if any command fails
- set -e
# Get bundles from cache or build them
- mkdir -p target
- CACHED_JAR_NAME="$HOME/.prebuilt/$(git rev-parse HEAD).jar"; if [ -e "$CACHED_JAR_NAME" ]; then cp "$CACHED_JAR_NAME" target/renaissance-gpl-$RENAISSANCE_VERSION.jar; else ./tools/sbt/bin/sbt assembly; fi
- mkdir -p renaissance-jmh/target/scala-2.12
- CACHED_JMH_JAR_NAME="$HOME/.prebuilt/$(git rev-parse HEAD)-jmh-assembly.jar"; if [ -e "$CACHED_JMH_JAR_NAME" ]; then cp "$CACHED_JMH_JAR_NAME" renaissance-jmh/target/scala-2.12/renaissance-jmh-assembly-$RENAISSANCE_VERSION.jar; else ./tools/sbt/bin/sbt renaissanceJmh/jmh:assembly; fi
# Ensure that the JMH bundle contains non-empty BenchmarkList
- 'test $(unzip -p renaissance-jmh/target/scala-2.12/renaissance-jmh-assembly-$RENAISSANCE_VERSION.jar META-INF/BenchmarkList | wc -l) -gt 0'
- 'java -version'
# Test benchmarks under Renaissance harness
- 'java -jar ./target/renaissance-gpl-$RENAISSANCE_VERSION.jar --raw-list | grep -v "^dummy" >list.txt'
- 'for BENCH in $(cat list.txt); do echo "====> $BENCH"; java -Xms2500M -Xmx2500M -jar ./target/renaissance-gpl-$RENAISSANCE_VERSION.jar -c test -r 1 "$BENCH" || exit 1; done'
# Test benchmarks under JMH harness
- 'java -Xms2500M -Xmx2500M -jar ./renaissance-jmh/target/scala-2.12/renaissance-jmh-assembly-$RENAISSANCE_VERSION.jar -wi 0 -i 1 -f 1 -foe true'
jobs:
include:
- stage: "Basic checks"
name: "Check style"
script:
- ./tools/sbt/bin/sbt renaissanceFormatCheck
- stage: "Basic checks"
name: "README.md is up to date"
script:
- ./tools/sbt/bin/sbt assembly
- java -jar ./target/renaissance-gpl-$RENAISSANCE_VERSION.jar --readme && git diff --exit-code -- README.md CONTRIBUTION.md
- stage: "Basic checks"
name: "Content encoding of Java sources"
script:
- ./tools/check-encoding.sh
- <<: *bundle
os: osx
- <<: *bundle
jdk: openjdk8
- <<: *bundle
jdk: oraclejdk8
- <<: *bundle
jdk: oraclejdk9
- <<: *bundle
env:
- USE_JDK=openjdk11
- <<: *bundle
env:
- USE_JDK=OpenJ9
- <<: *bench
os: osx
- <<: *bench
jdk: openjdk8
- <<: *bench
jdk: oraclejdk8
- <<: *bench
jdk: oraclejdk9
- <<: *bench
env:
- USE_JDK=openjdk11
# Disabled because of #131
#- <<: *bench
# env:
# - USE_JDK=OpenJ9
stages:
- "Basic checks"
- bundle
- benchmark
before_script:
# For us, the default options are broken as they pass "-v"
# to the JVM instead after the sbt JAR.
- unset SBT_OPTS
- "# Install custom JDK if needed"
- 'if [ -n "$USE_JDK" ]; then wget "https://github.com/sormuras/bach/raw/master/install-jdk.sh" && chmod +x install-jdk.sh; fi'
- 'if [ -n "$USE_JDK" ]; then export JAVA_HOME="$HOME/$USE_JDK"; fi'
- 'if [ "$USE_JDK" = "OpenJ9" ]; then ./install-jdk.sh --url "https://api.adoptopenjdk.net/v2/binary/releases/openjdk11?openjdk_impl=openj9&os=linux&arch=x64&release=latest&heap_size=normal&type=jdk" --target "$JAVA_HOME"; fi'
- 'if [ "$USE_JDK" = "openjdk11" ]; then ./install-jdk.sh -f 11 --target "$JAVA_HOME"; fi'
- 'if [ -n "$USE_JDK" ]; then export PATH="$JAVA_HOME/bin:$PATH"; fi'
cache:
directories:
- $HOME/.ivy2/cache
- $HOME/.sbt
- $HOME/.prebuilt
before_cache:
# Cleanup the cached directories to avoid unnecessary cache updates
# (see https://www.scala-sbt.org/1.0/docs/Travis-CI-with-sbt.html#Caching)
- rm -fv $HOME/.ivy2/.sbt.ivy.lock
- find $HOME/.ivy2/cache -name "ivydata-*.properties" -print -delete
- find $HOME/.sbt -name "*.lock" -print -delete