ci: upgrade Travis config to Ubuntu 18.04

Also in this commit:

 * Drop clang 3.8 (no easy way to install it on 18.04)
 * Add clang 10 (trunk)
 * Drop Xcode 8.3
 * Upgrade Xcode 10.2 to 10.3
 * Output folding markers to improve readability of CI logs

Change-Id: I234fcb06527eb60cc1fe4cf5b16eafaa972e07f6
diff --git a/.jenkins b/.jenkins
index 674d751..78e1ca1 100755
--- a/.jenkins
+++ b/.jenkins
@@ -1,10 +1,27 @@
 #!/usr/bin/env bash
 set -e
 
-DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
+nanos() {
+    # Cannot use date(1) because macOS does not support %N format specifier
+    python -c 'import time; print(int(time.time() * 1e9))'
+}
 
-for file in "$DIR"/.jenkins.d/*; do
+for file in .jenkins.d/*; do
     [[ -f $file && -x $file ]] || continue
-    echo "Run: $file"
+
+    if [[ -n $TRAVIS ]]; then
+        label=$(basename "$file" | sed -E 's/[[:digit:]]+-(.*)\..*/\1/')
+        echo -ne "travis_fold:start:${label}\r"
+        echo -ne "travis_time:start:${label}\r"
+        start=$(nanos)
+    fi
+
+    echo "\$ $file"
     "$file"
+
+    if [[ -n $TRAVIS ]]; then
+        finish=$(nanos)
+        echo -ne "travis_time:end:${label}:start=${start},finish=${finish},duration=$((finish-start)),event=${label}\r"
+        echo -ne "travis_fold:end:${label}\r"
+    fi
 done