[wasm] update run-jenkins.sh (#16771)
[mono-project.git] / scripts / ci / run-jenkins.sh
blobfe5f9c3c08719bad3e583e9a88dafb10bdc41ce3
1 #!/bin/bash -e
2 # -*- mode: shell-script; indent-tabs-mode: nil; -*-
4 export MONO_REPO_ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )/../../" && pwd )"
5 export TESTCMD=${MONO_REPO_ROOT}/scripts/ci/run-step.sh
6 export CI=1
7 export CI_PR=$([[ ${CI_TAGS} == *'pull-request'* ]] && echo 1 || true)
8 export CI_CPU_COUNT=$(getconf _NPROCESSORS_ONLN || getconf NPROCESSORS_ONLN || echo 4)
9 export TEST_HARNESS_VERBOSE=1
11 # workaround for acceptance-tests submodules leaving files behind since Jenkins only does "git clean -xdf" (no second 'f')
12 # which won't clean untracked .git repos (remove once https://github.com/jenkinsci/git-plugin/pull/449 is available)
13 for dir in acceptance-tests/external/*; do [ -d "$dir" ] && (cd "$dir" && echo "Cleaning $dir" && git clean -xdff); done
15 source ${MONO_REPO_ROOT}/scripts/ci/util.sh
17 if [[ ${CI_TAGS} == *'pull-request'* ]]; then
18 # Skip lanes which are not affected by the PR
19 wget -O pr-contents.diff "${ghprbPullLink}.diff"
20 grep '^diff' pr-contents.diff > pr-files.txt
21 echo "Files affected by the PR:"
22 cat pr-files.txt
24 # FIXME: Add more
25 skip=false
26 skip_step=""
27 if ! grep -q -v a/netcore pr-files.txt; then
28 skip_step="NETCORE"
29 skip=true
31 if ! grep -q -v a/mono/mini/mini-ppc pr-files.txt; then
32 skip_step="PPC"
33 skip=true
35 if ! grep -q -v a/scripts/ci/provisioning pr-files.txt; then
36 skip_step="CI provisioning scripts"
37 skip=true
39 if ! grep -q -v a/sdks/wasm pr-files.txt; then
40 if [[ ${CI_TAGS} == *'webassembly'* ]] || [[ ${CI_TAGS} == *'wasm'* ]]; then
41 true
42 else
43 skip_step="WASM"
44 skip=true
47 if [ $skip = true ]; then
48 ${TESTCMD} --label="Skipped on ${skip_step}." --timeout=60m --fatal sh -c 'exit 0'
49 if [[ $CI_TAGS == *'apidiff'* ]]; then report_github_status "success" "API Diff" "Skipped." || true; fi
50 if [[ $CI_TAGS == *'csprojdiff'* ]]; then report_github_status "success" "Project Files Diff" "Skipped." || true; fi
51 exit 0
54 rm pr-files.txt
57 helix_set_env_vars
58 helix_send_build_start_event "build/source/$MONO_HELIX_TYPE/"
60 make_timeout=300m
61 gnumake=$(which gmake || which gnumake || which make)
63 if [[ ${CI_TAGS} == *'clang-sanitizer'* ]]; then
64 export CC="clang"
65 export CXX="clang++"
66 export CFLAGS="$CFLAGS -g -O1 -fsanitize=thread -fsanitize-blacklist=${MONO_REPO_ROOT}/scripts/ci/clang-thread-sanitizer-blacklist -mllvm -tsan-instrument-atomics=false"
67 export LDFLAGS="-fsanitize=thread"
68 # TSAN_OPTIONS are used by programs that were compiled with Clang's ThreadSanitizer
69 # see https://github.com/google/sanitizers/wiki/ThreadSanitizerFlags for more details
70 export TSAN_OPTIONS="history_size=7:exitcode=0:force_seq_cst_atomics=1"
71 make_timeout=30m
74 if [[ ${CI_TAGS} == *'win-'* ]]; then
75 # Passing -ggdb3 on Cygwin breaks linking against libmonosgen-x.y.dll
76 export CFLAGS="$CFLAGS -g -O2"
77 else
78 export EXTRA_CFLAGS="$EXTRA_CFLAGS -ggdb3 -O2"
81 if [[ $CI_TAGS == *'collect-coverage'* ]]; then
82 # Collect coverage for further use by lcov and similar tools.
83 # Coverage must be collected with -O0 and debug information.
84 export CFLAGS="$CFLAGS -ggdb3 --coverage -O0"
87 if [[ $CI_TAGS == *'retry-flaky-tests'* ]]; then
88 export MONO_FLAKY_TEST_RETRIES=5
91 # We don't want to have to maintain symbolification blobs for CI
92 export EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --with-crash-privacy=no "
94 if [[ ${CI_TAGS} == *'osx-i386'* ]]; then EXTRA_CFLAGS="$EXTRA_CFLAGS -m32 -arch i386 -mmacosx-version-min=10.9"; EXTRA_LDFLAGS="$EXTRA_LDFLAGS -m32 -arch i386"; EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --with-libgdiplus=/Library/Frameworks/Mono.framework/Versions/Current/lib/libgdiplus.dylib --host=i386-apple-darwin13.0.0 --build=i386-apple-darwin13.0.0"; fi
95 if [[ ${CI_TAGS} == *'osx-amd64'* ]]; then EXTRA_CFLAGS="$EXTRA_CFLAGS -m64 -arch x86_64 -mmacosx-version-min=10.9"; EXTRA_LDFLAGS="$EXTRA_LDFLAGS -m64 -arch x86_64" EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --with-libgdiplus=/Library/Frameworks/Mono.framework/Versions/Current/lib/libgdiplus.dylib"; fi
96 if [[ ${CI_TAGS} == *'win-i386'* ]]; then PLATFORM=Win32; EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --host=i686-w64-mingw32 --enable-btls"; export MONO_EXECUTABLE="${MONO_REPO_ROOT}/msvc/build/sgen/Win32/bin/Release/mono-sgen.exe"; fi
97 if [[ ${CI_TAGS} == *'win-amd64'* && ${CI_TAGS} != *'sdks-android'* ]]; then PLATFORM=x64; EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --host=x86_64-w64-mingw32 --disable-boehm --enable-btls"; export MONO_EXECUTABLE="${MONO_REPO_ROOT}/msvc/build/sgen/x64/bin/Release/mono-sgen.exe"; fi
98 if [[ ${CI_TAGS} == *'freebsd-amd64'* ]]; then export CC="clang"; export CXX="clang++"; EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --disable-dtrace --disable-boehm ac_cv_header_sys_inotify_h=no ac_cv_func_inotify_init=no ac_cv_func_inotify_add_watch=no ac_cv_func_inotify_rm_watch=no"; fi
99 if [[ ${CI_TAGS} == *'make-install'* ]]; then EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --enable-loadedllvm --prefix=${MONO_REPO_ROOT}/tmp/monoprefix"; fi
101 if [[ ${CI_TAGS} == *'coop-suspend'* ]]; then EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --disable-hybrid-suspend --enable-cooperative-suspend";
102 elif [[ ${CI_TAGS} == *'hybrid-suspend'* ]]; then EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --enable-hybrid-suspend";
103 elif [[ ${CI_TAGS} == *'preemptive-suspend'* ]]; then EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --disable-hybrid-suspend";
106 if [[ ${CI_TAGS} == *'checked-coop'* ]]; then EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --enable-checked-build=gc,thread"; fi
107 if [[ ${CI_TAGS} == *'checked-all'* ]]; then EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --enable-checked-build=all"; fi
109 if [[ ${CI_TAGS} == *'mcs-compiler'* ]]; then EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --with-csc=mcs"; fi
110 if [[ ${CI_TAGS} == *'disable-mcs-build'* ]]; then EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --disable-mcs-build"; fi
112 if [[ ${CI_TAGS} == *'fullaot_llvm'* ]]; then EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --enable-llvm=yes --with-runtime-preset=fullaot_llvm ";
113 elif [[ ${CI_TAGS} == *'hybridaot_llvm'* ]]; then EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --enable-llvm=yes --with-runtime-preset=hybridaot_llvm";
114 elif [[ ${CI_TAGS} == *'winaot_llvm'* ]]; then EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --enable-llvm=yes --with-runtime-preset=winaot_llvm";
115 elif [[ ${CI_TAGS} == *'aot_llvm'* ]]; then EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --enable-llvm=yes --with-runtime-preset=aot_llvm ";
116 elif [[ ${CI_TAGS} == *'jit_llvm'* ]]; then EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --enable-llvm=yes"; export MONO_ENV_OPTIONS="$MONO_ENV_OPTIONS --llvm";
117 elif [[ ${CI_TAGS} == *'fullaotinterp_llvm'* ]]; then EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --enable-llvm=yes --with-runtime-preset=fullaotinterp_llvm";
118 elif [[ ${CI_TAGS} == *'fullaotinterp'* ]]; then EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --with-runtime-preset=fullaotinterp";
119 elif [[ ${CI_TAGS} == *'winaotinterp'* ]]; then EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --with-runtime-preset=winaotinterp";
120 elif [[ ${CI_TAGS} == *'winaotinterp_llvm'* ]]; then EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --enable-llvm=yes --with-runtime-preset=winaotinterp_llvm";
121 elif [[ ${CI_TAGS} == *'fullaot'* ]]; then EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --with-runtime-preset=fullaot";
122 elif [[ ${CI_TAGS} == *'hybridaot'* ]]; then EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --with-runtime-preset=hybridaot";
123 elif [[ ${CI_TAGS} == *'winaot'* ]]; then EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --with-runtime-preset=winaot";
124 elif [[ ${CI_TAGS} == *'aot'* ]]; then EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --with-runtime-preset=aot";
125 elif [[ ${CI_TAGS} == *'bitcodeinterp'* ]]; then EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --with-runtime-preset=bitcodeinterp"; export PATH="$PATH:${MONO_REPO_ROOT}/llvm/usr/bin";
126 elif [[ ${CI_TAGS} == *'bitcode'* ]]; then EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --with-runtime-preset=bitcode"; export PATH="$PATH:${MONO_REPO_ROOT}/llvm/usr/bin";
127 elif [[ ${CI_TAGS} == *'acceptance-tests'* ]]; then EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --prefix=${MONO_REPO_ROOT}/tmp/mono-acceptance-tests --with-sgen-default-concurrent=yes";
128 elif [[ ${CI_TAGS} == *'all-profiles'* ]]; then EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --with-runtime-preset=all";
129 elif [[ ${CI_TAGS} == *'compile-msbuild-source'* ]]; then EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --prefix=/tmp/mono-from-source";
132 if [ -x "/usr/bin/dpkg-architecture" ];
133 then
134 EXTRA_CONF_FLAGS="$EXTRA_CONF_FLAGS --host=`/usr/bin/dpkg-architecture -qDEB_HOST_GNU_TYPE`"
135 #force build arch = dpkg arch, sometimes misdetected
136 mkdir -p ~/.config/.mono/
137 wget -O- https://download.mono-project.com/test/new-certs.tgz | tar zx -C ~/.config/.mono/
140 if [[ ${CI_TAGS} == *'cxx'* ]]; then
141 EXTRA_CONF_FLAGS="$EXTRA_CONF_FLAGS -enable-cxx"
142 MSBUILD_CXX="/p:MONO_COMPILE_AS_CPP=true"
145 if [[ ${CI_TAGS} == *'microbench'* ]]; then
146 EXTRA_CONF_FLAGS="$EXTRA_CONF_FLAGS --with-profile4_x=yes"
149 if [[ ${CI_TAGS} == *'win-'* ]];
150 then
151 mkdir -p ~/.config/.mono/
152 wget -qO- https://download.mono-project.com/test/new-certs.tgz| tar zx -C ~/.config/.mono/
155 if [[ ${CI_TAGS} == *'ccache'* ]];
156 then
157 # CCACHE_DIR should be set to a directory outside the chroot which holds the cache
158 CCACHE=$(which ccache)
159 if [ "$CCACHE" ]; then
160 if [[ ${CI_TAGS} == *'osx-'* ]]; then
161 export CC="ccache clang"
162 export CXX="ccache clang++"
163 else
164 export CC="ccache gcc"
165 export CXX="ccache g++"
170 if [[ ${CI_TAGS} == *'sdks-llvm'* ]]; then
171 ${TESTCMD} --label=archive --timeout=120m --fatal $gnumake -j ${CI_CPU_COUNT} --output-sync=recurse --trace -C sdks/builds archive-llvm-llvm{,win}64 NINJA=
172 exit 0
175 if [[ ${CI_TAGS} == *'sdks-ios'* ]];
176 then
177 # configuration on our bots: https://github.com/mono/mono/pull/11691#issuecomment-439178459
178 if [[ ${CI_TAGS} == *'xcode11'* ]]; then
179 export XCODE_DIR=/Applications/Xcode11.app/Contents/Developer
180 export XCODE32_DIR=/Applications/Xcode94.app/Contents/Developer
181 export MACOS_VERSION=10.15
182 export IOS_VERSION=13.0
183 export TVOS_VERSION=13.0
184 export WATCHOS_VERSION=6.0
185 export WATCHOS64_32_VERSION=6.0
186 else
187 export XCODE_DIR=/Applications/Xcode101.app/Contents/Developer
188 export XCODE32_DIR=/Applications/Xcode94.app/Contents/Developer
189 export MACOS_VERSION=10.14
190 export IOS_VERSION=12.1
191 export TVOS_VERSION=12.1
192 export WATCHOS_VERSION=5.1
193 export WATCHOS64_32_VERSION=5.1
196 # make sure we embed the correct path into the PDBs
197 export MONOTOUCH_MCS_FLAGS=-pathmap:${MONO_REPO_ROOT}/=/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/src/Xamarin.iOS/
199 echo "ENABLE_IOS=1" > sdks/Make.config
200 echo "ENABLE_MAC=1" >> sdks/Make.config
201 if [[ ${CI_TAGS} == *'cxx'* ]]; then
202 echo "ENABLE_CXX=1" >> sdks/Make.config
204 if [[ ${CI_TAGS} == *'debug'* ]]; then
205 echo "CONFIGURATION=debug" >> sdks/Make.config
208 export device_test_suites="Mono.Runtime.Tests System.Core"
210 ${TESTCMD} --label=configure --timeout=180m --fatal $gnumake -j ${CI_CPU_COUNT} --output-sync=recurse --trace -C sdks/builds configure-ios NINJA=
211 ${TESTCMD} --label=build --timeout=180m --fatal $gnumake -j ${CI_CPU_COUNT} --output-sync=recurse --trace -C sdks/builds build-ios NINJA=
212 ${TESTCMD} --label=archive --timeout=180m --fatal $gnumake -j ${CI_CPU_COUNT} --output-sync=recurse --trace -C sdks/builds archive-ios NINJA=
214 if [[ ${CI_TAGS} != *'no-tests'* ]]; then
215 ${TESTCMD} --label=run-sim --timeout=20m $gnumake -C sdks/ios run-ios-sim-all
216 ${TESTCMD} --label=build-ios-dev --timeout=60m $gnumake -C sdks/ios build-ios-dev-all
217 if [[ ${CI_TAGS} == *'run-device-tests'* ]]; then
218 for suite in ${device_test_suites}; do ${TESTCMD} --label=run-ios-dev-${suite} --timeout=10m $gnumake -C sdks/ios run-ios-dev-${suite}; done
220 ${TESTCMD} --label=build-ios-dev-llvm --timeout=60m $gnumake -C sdks/ios build-ios-dev-llvm-all
221 if [[ ${CI_TAGS} == *'run-device-tests'* ]]; then
222 for suite in ${device_test_suites}; do ${TESTCMD} --label=run-ios-dev-llvm-${suite} --timeout=10m $gnumake -C sdks/ios run-ios-dev-${suite}; done
224 ${TESTCMD} --label=build-ios-dev-interp-only --timeout=60m $gnumake -C sdks/ios build-ios-dev-interp-only-all
225 if [[ ${CI_TAGS} == *'run-device-tests'* ]]; then
226 for suite in ${device_test_suites}; do ${TESTCMD} --label=run-ios-dev-interp-only-${suite} --timeout=10m $gnumake -C sdks/ios run-ios-dev-${suite}; done
228 ${TESTCMD} --label=build-ios-dev-interp-mixed --timeout=60m $gnumake -C sdks/ios build-ios-dev-interp-mixed-all
229 if [[ ${CI_TAGS} == *'run-device-tests'* ]]; then
230 for suite in ${device_test_suites}; do ${TESTCMD} --label=run-ios-dev-interp-mixed-${suite} --timeout=10m $gnumake -C sdks/ios run-ios-dev-${suite}; done
233 exit 0
236 if [[ ${CI_TAGS} == *'sdks-mac'* ]];
237 then
238 # configuration on our bots: https://github.com/mono/mono/pull/11691#issuecomment-439178459
239 if [[ ${CI_TAGS} == *'xcode11'* ]]; then
240 export XCODE_DIR=/Applications/Xcode11.app/Contents/Developer
241 export XCODE32_DIR=/Applications/Xcode94.app/Contents/Developer
242 export MACOS_VERSION=10.15
243 else
244 export XCODE_DIR=/Applications/Xcode101.app/Contents/Developer
245 export XCODE32_DIR=/Applications/Xcode94.app/Contents/Developer
246 export MACOS_VERSION=10.14
249 # make sure we embed the correct path into the PDBs
250 export XAMMAC_MCS_FLAGS=-pathmap:${MONO_REPO_ROOT}/=/Library/Frameworks/Xamarin.Mac.framework/Versions/Current/src/Xamarin.Mac/
252 echo "ENABLE_MAC=1" > sdks/Make.config
253 if [[ ${CI_TAGS} == *'cxx'* ]]; then
254 echo "ENABLE_CXX=1" >> sdks/Make.config
256 if [[ ${CI_TAGS} == *'debug'* ]]; then
257 echo "CONFIGURATION=debug" >> sdks/Make.config
260 ${TESTCMD} --label=configure --timeout=180m --fatal $gnumake -j ${CI_CPU_COUNT} --output-sync=recurse --trace -C sdks/builds configure-mac NINJA=
261 ${TESTCMD} --label=build --timeout=180m --fatal $gnumake -j ${CI_CPU_COUNT} --output-sync=recurse --trace -C sdks/builds build-mac NINJA=
262 ${TESTCMD} --label=archive --timeout=180m --fatal $gnumake -j ${CI_CPU_COUNT} --output-sync=recurse --trace -C sdks/builds archive-mac NINJA=
264 exit 0
267 if [[ ${CI_TAGS} == *'sdks-android'* ]];
268 then
269 echo "ENABLE_ANDROID=1" > sdks/Make.config
270 echo "DISABLE_CCACHE=1" >> sdks/Make.config
271 if [[ ${CI_TAGS} == *'cxx'* ]]; then
272 echo "ENABLE_CXX=1" >> sdks/Make.config
274 if [[ ${CI_TAGS} == *'debug'* ]]; then
275 echo "CONFIGURATION=debug" >> sdks/Make.config
278 # TODO: provision-android on Windows.
279 if [[ ${CI_TAGS} != *'win-'* ]]; then
280 # For some very strange reasons, `make -C sdks/android accept-android-license` get stuck when invoked through ${TESTCMD}
281 # but doesn't get stuck when called via the shell, so let's just call it here now.
282 ${TESTCMD} --label=provision-android --timeout=120m --fatal $gnumake -j ${CI_CPU_COUNT} -C sdks/builds provision-android && $gnumake -C sdks/android accept-android-license
284 ${TESTCMD} --label=provision-mxe --timeout=240m --fatal $gnumake -j ${CI_CPU_COUNT} -C sdks/builds provision-mxe
286 ${TESTCMD} --label=configure --timeout=180m --fatal $gnumake -j ${CI_CPU_COUNT} --output-sync=recurse --trace -C sdks/builds configure-android NINJA= IGNORE_PROVISION_ANDROID=1 IGNORE_PROVISION_MXE=1
287 ${TESTCMD} --label=build --timeout=180m --fatal $gnumake -j ${CI_CPU_COUNT} --output-sync=recurse --trace -C sdks/builds build-android NINJA= IGNORE_PROVISION_ANDROID=1 IGNORE_PROVISION_MXE=1
288 ${TESTCMD} --label=archive --timeout=180m --fatal $gnumake -j ${CI_CPU_COUNT} --output-sync=recurse --trace -C sdks/builds archive-android NINJA= IGNORE_PROVISION_ANDROID=1 IGNORE_PROVISION_MXE=1
290 if [[ ${CI_TAGS} != *'no-tests'* ]]; then
291 ${TESTCMD} --label=mini --timeout=20m $gnumake -C sdks/android check-Mono.Runtime.Tests
292 ${TESTCMD} --label=corlib --timeout=20m $gnumake -C sdks/android check-corlib
293 ${TESTCMD} --label=System --timeout=20m $gnumake -C sdks/android check-System
294 ${TESTCMD} --label=System.Core --timeout=20m $gnumake -C sdks/android check-System.Core
295 ${TESTCMD} --label=System.Data --timeout=20m $gnumake -C sdks/android check-System.Data
296 ${TESTCMD} --label=System.IO.Compression.FileSystem --timeout=20m $gnumake -C sdks/android check-System.IO.Compression.FileSystem
297 ${TESTCMD} --label=System.IO.Compression --timeout=20m $gnumake -C sdks/android check-System.IO.Compression
298 ${TESTCMD} --label=System.Json --timeout=20m $gnumake -C sdks/android check-System.Json
299 ${TESTCMD} --label=System.Net.Http --timeout=20m $gnumake -C sdks/android check-System.Net.Http
300 ${TESTCMD} --label=System.Numerics --timeout=20m $gnumake -C sdks/android check-System.Numerics
301 ${TESTCMD} --label=System.Runtime.Serialization --timeout=20m $gnumake -C sdks/android check-System.Runtime.Serialization
302 ${TESTCMD} --label=System.ServiceModel.Web --timeout=20m $gnumake -C sdks/android check-System.ServiceModel.Web
303 ${TESTCMD} --label=System.Transactions --timeout=20m $gnumake -C sdks/android check-System.Transactions
304 ${TESTCMD} --label=System.Xml --timeout=20m $gnumake -C sdks/android check-System.Xml
305 ${TESTCMD} --label=System.Xml.Linq --timeout=20m $gnumake -C sdks/android check-System.Xml.Linq
306 ${TESTCMD} --label=Mono.CSharp --timeout=20m $gnumake -C sdks/android check-Mono.CSharp
307 # ${TESTCMD} --label=Mono.Data.Sqlite --timeout=20m $gnumake -C sdks/android check-Mono.Data.Sqlite
308 ${TESTCMD} --label=Mono.Data.Tds --timeout=20m $gnumake -C sdks/android check-Mono.Data.Tds
309 ${TESTCMD} --label=Mono.Security --timeout=20m $gnumake -C sdks/android check-Mono.Security
310 ${TESTCMD} --label=Mono.Debugger.Soft --timeout=20m $gnumake -C sdks/android check-Mono.Debugger.Soft
312 exit 0
315 if [[ ${CI_TAGS} == *'webassembly'* ]] || [[ ${CI_TAGS} == *'wasm'* ]];
316 then
317 echo "ENABLE_WASM=1" > sdks/Make.config
318 echo "ENABLE_WINDOWS=1" >> sdks/Make.config
319 if [[ ${CI_TAGS} == *'cxx'* ]]; then
320 echo "ENABLE_CXX=1" >> sdks/Make.config
322 if [[ ${CI_TAGS} == *'debug'* ]]; then
323 echo "CONFIGURATION=debug" >> sdks/Make.config
325 echo "ENABLE_WASM_DYNAMIC_RUNTIME=1" >> sdks/Make.config
326 #echo "ENABLE_WASM_THREADS=1" >> sdks/Make.config
328 export aot_test_suites="System.Core"
329 export mixed_test_suites="System.Core"
330 export xunit_test_suites="System.Core corlib"
332 ${TESTCMD} --label=provision --timeout=20m --fatal $gnumake --output-sync=recurse --trace -C sdks/builds provision-wasm
334 ${TESTCMD} --label=configure --timeout=180m --fatal $gnumake -j ${CI_CPU_COUNT} --output-sync=recurse --trace -C sdks/builds configure-wasm NINJA=
335 ${TESTCMD} --label=build --timeout=180m --fatal $gnumake -j ${CI_CPU_COUNT} --output-sync=recurse --trace -C sdks/builds build-wasm NINJA=
336 ${TESTCMD} --label=archive --timeout=180m --fatal $gnumake -j ${CI_CPU_COUNT} --output-sync=recurse --trace -C sdks/builds archive-wasm NINJA=
338 if [[ ${CI_TAGS} != *'no-tests'* ]]; then
339 ${TESTCMD} --label=wasm-build --timeout=20m --fatal $gnumake -j ${CI_CPU_COUNT} -C sdks/wasm build
340 ${TESTCMD} --label=mini --timeout=20m $gnumake -C sdks/wasm run-all-mini
341 ${TESTCMD} --label=corlib --timeout=60m $gnu$gnumake -C sdks/wasm run-all-corlib
342 #The following tests are not passing yet, so enabling them would make us perma-red
343 #${TESTCMD} --label=mini-system --timeout=20m $gnu$gnumake -C sdks/wasm run-all-system
344 ${TESTCMD} --label=system-core --timeout=20m $gnumake -C sdks/wasm run-all-System.Core
345 for suite in ${xunit_test_suites}; do ${TESTCMD} --label=xunit-${suite} --timeout=30m $gnumake -C sdks/wasm run-${suite}-xunit; done
346 # disable for now until https://github.com/mono/mono/pull/13622 goes in
347 #${TESTCMD} --label=debugger --timeout=20m $gnumake -C sdks/wasm test-debugger
348 ${TESTCMD} --label=browser --timeout=20m $gnumake -C sdks/wasm run-browser-tests
349 #${TESTCMD} --label=browser-threads --timeout=20m $gnumake -C sdks/wasm run-browser-threads-tests
350 ${TESTCMD} --label=aot-mini --timeout=20m $gnumake -j ${CI_CPU_COUNT} -C sdks/wasm run-aot-mini
351 ${TESTCMD} --label=build-aot-all --timeout=20m $gnumake -j ${CI_CPU_COUNT} -C sdks/wasm build-aot-all
352 for suite in ${aot_test_suites}; do ${TESTCMD} --label=run-aot-${suite} --timeout=10m $gnumake -C sdks/wasm run-aot-${suite}; done
353 for suite in ${mixed_test_suites}; do ${TESTCMD} --label=run-aot-mixed-${suite} --timeout=10m $gnumake -C sdks/wasm run-aot-mixed-${suite}; done
354 #${TESTCMD} --label=check-aot --timeout=20m $gnumake -C sdks/wasm check-aot
355 ${TESTCMD} --label=package --timeout=20m $gnumake -C sdks/wasm package
357 exit 0
361 if [[ ${CI_TAGS} != *'mac-sdk'* ]]; # Mac SDK builds Mono itself
362 then
363 echo ./autogen.sh CFLAGS="$CFLAGS $EXTRA_CFLAGS" CXXFLAGS="$CXXFLAGS $EXTRA_CXXFLAGS" LDFLAGS="$LDFLAGS $EXTRA_LDFLAGS" $EXTRA_CONF_FLAGS
364 ${TESTCMD} --label=configure --timeout=60m --fatal ./autogen.sh CFLAGS="$CFLAGS $EXTRA_CFLAGS" CXXFLAGS="$CXXFLAGS $EXTRA_CXXFLAGS" LDFLAGS="$LDFLAGS $EXTRA_LDFLAGS" $EXTRA_CONF_FLAGS
366 if [[ ${CI_TAGS} == *'win-i386'* ]];
367 then
368 # only build boehm on w32 (only windows platform supporting boehm).
369 ${TESTCMD} --label=make-msvc --timeout=60m --fatal ./msvc/run-msbuild.sh "build" "${PLATFORM}" "release" "/p:PlatformToolset=v140 /p:MONO_TARGET_GC=boehm ${MSBUILD_CXX}"
371 if [[ ${CI_TAGS} == *'win-'* ]];
372 then
373 ${TESTCMD} --label=make-msvc-sgen --timeout=60m --fatal ./msvc/run-msbuild.sh "build" "${PLATFORM}" "release" "/p:PlatformToolset=v140 /p:MONO_TARGET_GC=sgen ${MSBUILD_CXX}"
376 if [[ ${CI_TAGS} == *'win-amd64'* ]];
377 then
378 # The AOT compiler on Windows requires Visual Studio's clang.exe and link.exe.
379 # Depending on codegen (JIT/LLVM) it might also need platform specific libraries.
380 # Use a wrapper script that will make sure to setup full VS MSVC environment if
381 # needed when running mono-sgen.exe as AOT compiler.
382 export MONO_EXECUTABLE_WRAPPER="${MONO_REPO_ROOT}/msvc/build/sgen/x64/bin/Release/mono-sgen-msvc.sh"
385 if [[ ${CI_TAGS} == *'monolite'* ]]; then make get-monolite-latest; fi
387 make_parallelism="-j ${CI_CPU_COUNT}"
388 if [[ ${CI_TAGS} == *'linux-ppc64el'* ]]; then make_parallelism=-j1; fi
390 make_continue=
391 if [[ ${CI_TAGS} == *'checked-all'* ]]; then make_continue=-k; fi
393 if [[ ${CI_TAGS} != *'mac-sdk'* ]]; # Mac SDK builds Mono itself
394 then
395 build_error=0
396 ${TESTCMD} --label=make --timeout=${make_timeout} --fatal make ${make_parallelism} ${make_continue} -w V=1 || build_error=1
397 helix_send_build_done_event "build/source/$MONO_HELIX_TYPE/" $build_error
399 if [[ ${build_error} != 0 ]]; then
400 echo "ERROR: The Mono build failed."
401 ${MONO_REPO_ROOT}/scripts/ci/run-upload-sentry.sh
402 exit ${build_error}
406 if [[ ${CI_TAGS} == *'checked-coop'* ]]; then export MONO_CHECK_MODE=gc,thread; fi
407 if [[ ${CI_TAGS} == *'checked-all'* ]]; then export MONO_CHECK_MODE=all; fi
409 if [[ ${CI_TAGS} == *'hardened-runtime'* ]]; then codesign -s - -fv -o runtime --entitlements ${MONO_REPO_ROOT}/mono/mini/mac-entitlements.plist ${MONO_REPO_ROOT}/mono/mini/mono-sgen; fi
411 export MONO_ENV_OPTIONS="$MONO_ENV_OPTIONS $MONO_TEST_ENV_OPTIONS"
413 if [[ ${CI_TAGS} == *'acceptance-tests'* ]]; then ${MONO_REPO_ROOT}/scripts/ci/run-test-acceptance-tests.sh;
414 elif [[ ${CI_TAGS} == *'microbench'* ]]; then ${MONO_REPO_ROOT}/scripts/ci/run-test-microbench.sh;
415 elif [[ ${CI_TAGS} == *'profiler-stress-tests'* ]]; then ${MONO_REPO_ROOT}/scripts/ci/run-test-profiler-stress-tests.sh;
416 elif [[ ${CI_TAGS} == *'stress-tests'* ]]; then ${MONO_REPO_ROOT}/scripts/ci/run-test-stress-tests.sh;
417 elif [[ ${CI_TAGS} == *'interpreter'* ]]; then ${MONO_REPO_ROOT}/scripts/ci/run-test-interpreter.sh;
418 elif [[ ${CI_TAGS} == *'mcs-compiler'* ]]; then ${MONO_REPO_ROOT}/scripts/ci/run-test-mcs.sh;
419 elif [[ ${CI_TAGS} == *'mac-sdk'* ]]; then ${MONO_REPO_ROOT}/scripts/ci/run-test-mac-sdk.sh;
420 elif [[ ${CI_TAGS} == *'helix-tests'* ]]; then ${MONO_REPO_ROOT}/scripts/ci/run-test-helix.sh;
421 elif [[ ${CI_TAGS} == *'compile-msbuild-source'* ]]; then ${MONO_REPO_ROOT}/scripts/ci/run-test-msbuild.sh;
422 elif [[ ${CI_TAGS} == *'make-install'* ]]; then ${MONO_REPO_ROOT}/scripts/ci/run-test-make-install.sh;
423 elif [[ ${CI_TAGS} == *'compiler-server-tests'* ]]; then ${MONO_REPO_ROOT}/scripts/ci/run-test-compiler-server.sh;
424 elif [[ ${CI_TAGS} == *'no-tests'* ]]; then echo "Skipping tests.";
425 else make check-ci;
428 if [[ $CI_TAGS == *'apidiff'* ]]; then
429 if ${TESTCMD} --label=apidiff --timeout=15m --fatal make -w -C mcs -j ${CI_CPU_COUNT} mono-api-diff
430 then report_github_status "success" "API Diff" "No public API changes found." || true
431 else report_github_status "error" "API Diff" "The public API changed." "$BUILD_URL/Public_20API_20Diff/" || true
434 if [[ $CI_TAGS == *'csprojdiff'* ]]; then
435 make update-solution-files
436 if ${TESTCMD} --label=csprojdiff --timeout=5m --fatal make -w -C mcs mono-csproj-diff
437 then report_github_status "success" "Project Files Diff" "No csproj file changes found." || true
438 else report_github_status "error" "Project Files Diff" "The csproj files changed." "$BUILD_URL/Project_20Files_20Diff/" || true