[jenkins] Add fullaot_llvm CI tag and rename aot_only to fullaot
[mono.git] / scripts / ci / run-jenkins.sh
1 #!/bin/bash -e
2
3 TESTCMD=`dirname "${BASH_SOURCE[0]}"`/run-step.sh
4
5 export TEST_HARNESS_VERBOSE=1
6 if [[ ${label} == w* ]]; then
7     # Passing -ggdb3 on Cygwin breaks linking against libmonosgen-x.y.dll
8     export CFLAGS="-g -O2"
9 else
10     export CFLAGS="-ggdb3 -O2"
11 fi
12
13 if [[ ${CI_TAGS} == *'coop-gc'* ]]; then EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --with-cooperative-gc=yes"; fi
14
15 if [[ ${CI_TAGS} == *'checked-coop'* ]]; then EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --enable-checked-build=gc,thread"; export MONO_CHECK_MODE=gc,thread; fi
16 if [[ ${CI_TAGS} == *'checked-all'* ]]; then EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --enable-checked-build=all"; export MONO_CHECK_MODE=all; fi
17
18 if [[ ${CI_TAGS} == *'mcs-compiler'* ]]; then EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --with-csc=mcs"; fi
19
20 if [[ ${label} == 'osx-i386' ]]; then EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --with-libgdiplus=/Library/Frameworks/Mono.framework/Versions/Current/lib/libgdiplus.dylib --build=i386-apple-darwin11.2.0"; fi
21 if [[ ${label} == 'osx-amd64' ]]; then EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --with-libgdiplus=/Library/Frameworks/Mono.framework/Versions/Current/lib/libgdiplus.dylib "; fi
22 if [[ ${label} == 'w32' ]]; then PLATFORM=Win32; EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --host=i686-w64-mingw32 --with-csc=mcs"; export MONO_EXECUTABLE="`cygpath -u ${WORKSPACE}\\\msvc\\\build\\\sgen\\\Win32\\\bin\\\Release\\\mono-sgen.exe`"; fi
23 if [[ ${label} == 'w64' ]]; then PLATFORM=x64; EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --host=x86_64-w64-mingw32 --disable-boehm"; export MONO_EXECUTABLE="`cygpath -u ${WORKSPACE}\\\msvc\\\build\\\sgen\\\x64\\\bin\\\Release\\\mono-sgen.exe`"; fi
24
25 if [[ ${CI_TAGS} == *'fullaot_llvm'* ]];
26     then
27     EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --with-runtime_preset=aot_only --enable-llvm=yes";
28 elif [[ ${CI_TAGS} == *'fullaot'* ]];
29     then
30     EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --with-runtime_preset=aot_only";
31 elif [[ ${CI_TAGS} == *'hybridaot_llvm'* ]];
32     then
33     EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --with-runtime_preset=aot_preferred --enable-llvm=yes";
34 elif [[ ${CI_TAGS} == *'hybridaot'* ]];
35     then
36     EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --with-runtime_preset=aot_preferred";
37 elif [[ ${CI_TAGS} == *'acceptance-tests'* ]];
38     then
39     EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --prefix=${WORKSPACE}/tmp/mono-acceptance-tests --with-sgen-default-concurrent=yes";
40 elif [[ ${label} != w* ]] && [[ ${label} != 'debian-8-ppc64el' ]] && [[ ${label} != 'centos-s390x' ]] && [[ ${CI_TAGS} != *'monolite'* ]];
41     then
42     # only enable the concurrent collector by default on main unix archs
43     EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --with-sgen-default-concurrent=yes"
44
45     if [[ ${label} == 'ubuntu-1404-amd64' ]]; then
46         # only enable build of the additional profiles on one architecture to save time
47         EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --with-runtime_preset=all"
48     fi
49 fi
50
51 if [ -x "/usr/bin/dpkg-architecture" ];
52         then
53         EXTRA_CONF_FLAGS="$EXTRA_CONF_FLAGS --host=`/usr/bin/dpkg-architecture -qDEB_HOST_GNU_TYPE`"
54         #force build arch = dpkg arch, sometimes misdetected
55         mkdir -p ~/.config/.mono/
56         wget -qO- https://download.mono-project.com/test/new-certs.tgz| tar zx -C ~/.config/.mono/
57 fi
58
59
60 ${TESTCMD} --label=configure --timeout=60m --fatal ./autogen.sh $EXTRA_CONF_FLAGS
61 if [[ ${label} == 'w32' ]];
62     then
63         # only build boehm on w32 (only windows platform supporting boehm).
64     ${TESTCMD} --label=make-msvc --timeout=60m --fatal /cygdrive/c/Program\ Files\ \(x86\)/MSBuild/14.0/Bin/MSBuild.exe /p:PlatformToolset=v140 /p:Platform=${PLATFORM} /p:Configuration=Release /p:MONO_TARGET_GC=boehm msvc/mono.sln
65 fi
66 if [[ ${label} == w* ]];
67     then
68     ${TESTCMD} --label=make-msvc-sgen --timeout=60m --fatal /cygdrive/c/Program\ Files\ \(x86\)/MSBuild/14.0/Bin/MSBuild.exe /p:PlatformToolset=v140 /p:Platform=${PLATFORM} /p:Configuration=Release /p:MONO_TARGET_GC=sgen msvc/mono.sln
69 fi
70
71 if [[ ${CI_TAGS} == *'monolite'* ]]; then make get-monolite-latest; fi
72
73 make_parallelism=-j4
74 if [[ ${label} == 'debian-8-ppc64el' ]]; then make_parallelism=-j1; fi
75
76 ${TESTCMD} --label=make --timeout=300m --fatal make ${make_parallelism} -w V=1
77
78 if [[ ${CI_TAGS} == *'acceptance-tests'* ]];
79     then
80         $(dirname "${BASH_SOURCE[0]}")/run-test-acceptance-tests.sh
81 elif [[ ${CI_TAGS} == *'profiler-stress-tests'* ]];
82     then
83         $(dirname "${BASH_SOURCE[0]}")/run-test-profiler-stress-tests.sh
84 elif [[ ${CI_TAGS} == *'no-tests'* ]];
85     then
86         exit 0
87 else
88         make check-ci
89 fi