ci: refactor all build steps into separate build scripts
authorMike Blumenkrantz <zmike@samsung.com>
Tue, 10 Jul 2018 16:14:27 +0000 (12:14 -0400)
committerYoungbok Shin <youngb.shin@samsung.com>
Thu, 26 Jul 2018 08:26:36 +0000 (17:26 +0900)
this moves each step of the ci build into a separate script with the build
type passed as an argument, allowing for easier modification of each individual
step as necessary and making travis.yml more readable

Differential Revision: https://phab.enlightenment.org/D6604

also includes:
ci: break out make commands into travis.yml from build scripts

this simplifies the platform-specific build scripts to only perform
the configure stage of the build (and any additional setup) and then
uses standardized commands for the build

in addition to being simpler, this will also provide more/better info
about build timings

ref D6603

.ci/build-efl-app.sh
.ci/ci-configure.sh [new file with mode: 0755]
.ci/ci-linux-build.sh [deleted file]
.ci/ci-make-benchmark.sh [new file with mode: 0755]
.ci/ci-make-checkbuild.sh [new file with mode: 0755]
.ci/ci-make-distcheck.sh [new file with mode: 0755]
.ci/ci-make-examples.sh [new file with mode: 0755]
.ci/ci-make-install.sh [new file with mode: 0755]
.ci/ci-make.sh [new file with mode: 0755]
.ci/ci-osx-build.sh [deleted file]
.travis.yml

index ac22e09..94013a3 100755 (executable)
@@ -5,7 +5,7 @@ set -e
 cd /
 
 #clone our examples from efl
-git clone http://git.enlightenment.org/tools/examples.git/
+git clone --depth=1 -b master http://git.enlightenment.org/tools/examples.git/
 
 cd examples/apps/c/life/
 
diff --git a/.ci/ci-configure.sh b/.ci/ci-configure.sh
new file mode 100755 (executable)
index 0000000..28897da
--- /dev/null
@@ -0,0 +1,67 @@
+#!/bin/sh
+
+set -e
+
+CI_BUILD_TYPE="$1"
+
+export MAKEFLAGS="-j5"
+export EIO_MONITOR_POLL=1
+
+DEFAULT_LINUX_COPTS="--prefix=/usr/ --with-tests=regular --disable-cxx-bindings"
+
+WAYLAND_LINUX_COPTS=" --enable-wayland --enable-elput --enable-drm \
+--enable-wayland-ivi-shell --enable-gl-drm --with-opengl=es --enable-egl"
+
+MISC_LINUX_COPTS=" --enable-harfbuzz --enable-liblz4 --enable-image-loader-webp --enable-xinput22 \
+--enable-multisense --enable-lua-old --enable-xpresent --enable-hyphen \
+--enable-pixman --enable-pixman-font --enable-pixman-rect --enable-pixman-line \
+--enable-pixman-poly --enable-pixman-image --enable-pixman-image-scale-sample \
+--enable-image-loader-generic --enable-libuv --enable-tile-rotate --enable-vnc-server \
+--enable-sdl --enable-fb --enable-v4l2 --enable-cserve --enable-always-build-examples \
+--enable-ecore-wayland --enable-ecore-drm --enable-cancel-ok --with-crypto=gnutls \
+--enable-debug --disable-gstreamer1 --enable-gstreamer"
+
+MISC_DISABLED_LINUX_COPTS=" --disable-neon --disable-libeeze --disable-systemd --disable-magic-debug \
+--disable-valgrind --disable-gstreamer1 \
+--disable-fontconfig --disable-fribidi --disable-poppler --disable-spectre --disable-libraw \
+--disable-librsvg --disable-xcf --disable-libmount --disable-tslib --disable-audio \
+--disable-pulseaudio --disable-avahi --disable-xinput2 --disable-xim --disable-scim \
+--disable-ibus --disable-physics --disable-quick-launch --disable-elua"
+
+RELEASE_READY_LINUX_COPTS=" --with-profile=release"
+
+if [ "$DISTRO" != "" ] ; then
+  # Normal build test of all targets
+  OPTS="$DEFAULT_LINUX_COPTS"
+
+  if [ "$1" = "wayland" ]; then
+    OPTS="$OPTS $WAYLAND_LINUX_COPTS"
+  fi
+
+  if [ "$1" = "misc" ]; then
+    OPTS="$OPTS $MISC_LINUX_COPTS"
+  fi
+
+  if [ "$1" = "misc-disabled" ]; then
+    OPTS="$OPTS $MISC_DISABLED_LINUX_COPTS"
+  fi
+
+  if [ "$1" = "release-ready" ]; then
+    OPTS="$OPTS $RELEASE_READY_LINUX_COPTS"
+  fi
+  docker run --env MAKEFLAGS="-j5" --env EIO_MONITOR_POLL=1 -v `pwd`:/src -w /src stefanschmidt1/ci-support-files:$DISTRO ./autogen.sh $OPTS
+else
+  OSX_COPTS="--disable-cxx-bindings"
+
+  # Prepare OSX env for build
+  mkdir -p ~/Library/LaunchAgents
+  ln -sfv /usr/local/opt/d-bus/*.plist ~/Library/LaunchAgents
+  launchctl load ~/Library/LaunchAgents/org.freedesktop.dbus-session.plist
+  export PATH="$(brew --prefix gettext)/bin:$PATH"
+
+  export CFLAGS="-I/usr/local/opt/openssl/include $CFLAGS"
+  export LDFLAGS="-L/usr/local/opt/openssl/lib $LDFLAGS"
+
+  # Normal build test of all targets
+  ./autogen.sh $OSX_COPTS
+fi
diff --git a/.ci/ci-linux-build.sh b/.ci/ci-linux-build.sh
deleted file mode 100755 (executable)
index ddc33fe..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-#!/bin/sh
-
-set -e
-
-CI_BUILD_TYPE=$1
-
-DEFAULT_COPTS="--prefix=/usr/ --with-tests=regular --disable-cxx-bindings"
-
-WAYLAND_COPTS="--with-tests=regular --enable-wayland --enable-elput --enable-drm \
---enable-wayland-ivi-shell --enable-gl-drm --with-opengl=es --enable-egl"
-
-MISC_COPTS="--enable-harfbuzz --enable-liblz4 --enable-image-loader-webp --enable-xinput22 \
---enable-multisense --enable-lua-old --enable-xpresent --enable-hyphen \
---enable-pixman --enable-pixman-font --enable-pixman-rect --enable-pixman-line \
---enable-pixman-poly --enable-pixman-image --enable-pixman-image-scale-sample \
---enable-image-loader-generic --enable-libuv --enable-tile-rotate --enable-vnc-server \
---enable-sdl --enable-fb --enable-v4l2 --enable-cserve --enable-always-build-examples \
---enable-ecore-wayland --enable-ecore-drm --enable-cancel-ok --with-crypto=gnutls \
---enable-debug --disable-gstreamer1 --enable-gstreamer"
-
-MISC_DISABLED_COPTS="--disable-neon --disable-libeeze --disable-systemd --disable-magic-debug \
---disable-valgrind --disable-cxx-bindings --disable-gstreamer1 \
---disable-fontconfig --disable-fribidi --disable-poppler --disable-spectre --disable-libraw \
---disable-librsvg --disable-xcf --disable-libmount --disable-tslib --disable-audio \
---disable-pulseaudio --disable-avahi --disable-xinput2 --disable-xim --disable-scim \
---disable-ibus --disable-physics --disable-quick-launch --disable-elua"
-
-RELEASE_READY_COPTS="--with-profile=release"
-
-if [ "$CI_BUILD_TYPE" = "" ]; then
-  # Normal build test of all targets
-  ./autogen.sh $DEFAULT_COPTS
-  make
-  make check-build
-  make examples
-  make benchmark
-  make install
-  ./.ci/build-efl-app.sh
-fi
-
-if [ "$CI_BUILD_TYPE" = "wayland" ]; then
-  ./autogen.sh $WAYLAND_COPTS
-  make
-  make examples
-fi
-
-if [ "$CI_BUILD_TYPE" = "misc" ]; then
-  ./autogen.sh $MISC_COPTS
-  make
-  make examples
-fi
-
-if [ "$CI_BUILD_TYPE" = "misc-disabled" ]; then
-  ./autogen.sh $MISC_DISABLED_COPTS
-  make
-  make examples
-fi
-
-if [ "$CI_BUILD_TYPE" = "release-ready" ]; then
-  ./autogen.sh $RELEASE_READY_COPTS
-  make
-  make distcheck
-fi
diff --git a/.ci/ci-make-benchmark.sh b/.ci/ci-make-benchmark.sh
new file mode 100755 (executable)
index 0000000..bd63977
--- /dev/null
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+set -e
+
+if [ "$1" = "release-ready" ] ; then
+  exit 0
+fi
+
+if [ "$DISTRO" != "" ] ; then
+  docker exec --env MAKEFLAGS="-j5" --env EIO_MONITOR_POLL=1 $(cat $HOME/cid) make benchmark
+else
+  export PATH="/usr/local/opt/ccache/libexec:$(brew --prefix gettext)/bin:$PATH"
+  make benchmark
+fi
diff --git a/.ci/ci-make-checkbuild.sh b/.ci/ci-make-checkbuild.sh
new file mode 100755 (executable)
index 0000000..2cb852d
--- /dev/null
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+set -e
+
+if [ "$1" = "release-ready" ] ; then
+  exit 0
+fi
+
+if [ "$DISTRO" != "" ] ; then
+  docker exec --env MAKEFLAGS="-j5" --env EIO_MONITOR_POLL=1 $(cat $HOME/cid) make check-build
+else
+  export PATH="/usr/local/opt/ccache/libexec:$(brew --prefix gettext)/bin:$PATH"
+  make check-build
+fi
diff --git a/.ci/ci-make-distcheck.sh b/.ci/ci-make-distcheck.sh
new file mode 100755 (executable)
index 0000000..144b957
--- /dev/null
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+set -e
+
+if [ "$1" != "release-ready" ] ; then
+  exit 0
+fi
+
+if [ "$DISTRO" != "" ] ; then
+  docker exec --env MAKEFLAGS="-j5" --env EIO_MONITOR_POLL=1 $(cat $HOME/cid) make distcheck
+else
+  export PATH="/usr/local/opt/ccache/libexec:$(brew --prefix gettext)/bin:$PATH"
+  make
+fi
diff --git a/.ci/ci-make-examples.sh b/.ci/ci-make-examples.sh
new file mode 100755 (executable)
index 0000000..4ab0f70
--- /dev/null
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+set -e
+
+if [ "$1" = "release-ready" ] ; then
+  exit 0
+fi
+
+if [ "$DISTRO" != "" ] ; then
+  docker exec --env MAKEFLAGS="-j5" --env EIO_MONITOR_POLL=1 $(cat $HOME/cid) make examples
+else
+  export PATH="/usr/local/opt/ccache/libexec:$(brew --prefix gettext)/bin:$PATH"
+  make examples
+fi
diff --git a/.ci/ci-make-install.sh b/.ci/ci-make-install.sh
new file mode 100755 (executable)
index 0000000..9856179
--- /dev/null
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+set -e
+
+if [ "$1" = "release-ready" ] ; then
+  exit 0
+fi
+
+if [ "$DISTRO" != "" ] ; then
+  docker exec --env MAKEFLAGS="-j5" --env EIO_MONITOR_POLL=1 $(cat $HOME/cid) make install
+else
+  export PATH="/usr/local/opt/ccache/libexec:$(brew --prefix gettext)/bin:$PATH"
+  make install
+fi
diff --git a/.ci/ci-make.sh b/.ci/ci-make.sh
new file mode 100755 (executable)
index 0000000..8bd445f
--- /dev/null
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+set -e
+
+if [ "$DISTRO" != "" ] ; then
+  docker exec --env MAKEFLAGS="-j5" --env EIO_MONITOR_POLL=1 $(cat $HOME/cid) make
+else
+  export PATH="$(brew --prefix gettext)/bin:$PATH"
+  make
+fi
diff --git a/.ci/ci-osx-build.sh b/.ci/ci-osx-build.sh
deleted file mode 100755 (executable)
index 4e7a0f0..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/sh
-
-set -e
-
-COPTS="--disable-cxx-bindings"
-
-# Prepare OSX env for build
-mkdir -p ~/Library/LaunchAgents
-ln -sfv /usr/local/opt/d-bus/*.plist ~/Library/LaunchAgents
-launchctl load ~/Library/LaunchAgents/org.freedesktop.dbus-session.plist
-export PATH="$(brew --prefix gettext)/bin:$PATH"
-
-export CFLAGS="-I/usr/local/opt/openssl/include $CFLAGS"
-export LDFLAGS="-L/usr/local/opt/openssl/lib $LDFLAGS"
-
-# Normal build test of all targets
-./autogen.sh $COPTS $@
-make
-make examples
-#make benchmark
index db48ce3..817e4f1 100644 (file)
@@ -52,6 +52,7 @@ matrix:
     - os: osx
       env:
         DISTRO=Archlinux
+
     - os: linux
       env:
   allow_failures:
@@ -66,13 +67,30 @@ before_script:
       if [[ "$TRAVIS_OS_NAME" == "linux" ]] && [[ "$DISTRO" != "" ]]; then
         docker pull stefanschmidt1/ci-support-files:$DISTRO
       fi
+  - |
+      if [[ "$TRAVIS_OS_NAME" == "linux" ]] ; then
+        docker version
+        docker run --cidfile $HOME/cid -t -d -v `pwd`:/src -w /src stefanschmidt1/ci-support-files:$DISTRO bash
+        cat $HOME/cid
+      fi
 
 script:
+  - .ci/ci-configure.sh "$CI_BUILD_TYPE"
+  - .ci/ci-make.sh "$CI_BUILD_TYPE"
+  - .ci/ci-make-checkbuild.sh "$CI_BUILD_TYPE"
+  - .ci/ci-make-examples.sh "$CI_BUILD_TYPE"
   - |
-      if [[ "$TRAVIS_OS_NAME" == "linux" ]] && [[ "$DISTRO" != "" ]]; then
-        docker run -v `pwd`:/src -w /src stefanschmidt1/ci-support-files:$DISTRO /src/.ci/ci-linux-build.sh $CI_BUILD_TYPE
+      if [[ "$TRAVIS_OS_NAME" == "linux" ]] && [[ "$CI_BUILD_TYPE" == "" ]]; then
+          .ci/ci-make-benchmark.sh "$CI_BUILD_TYPE"
+      fi
+  - .ci/ci-make-install.sh "$CI_BUILD_TYPE"
+  - .ci/ci-make-distcheck.sh "$CI_BUILD_TYPE"
+  - |
+      if [[ "$DISTRO" == "" ]] && [[ "$TRAVIS_OS_NAME" != "linux" ]] ; then
+        .ci/build-efl-app.sh
+      elif [[ "$CI_BUILD_TYPE" != "release-ready" ]] ; then
+        docker exec --env MAKEFLAGS="-j5" --env EIO_MONITOR_POLL=1 $(cat $HOME/cid) .ci/build-efl-app.sh
       fi
-  - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then .ci/ci-osx-build.sh ; fi
 
 after_success:
   - |