From 45988ac6c0c8ca661601dcd9fdf10171a13568c7 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Tue, 10 Jul 2018 12:14:27 -0400 Subject: [PATCH] ci: refactor all build steps into separate build scripts 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 | 2 +- .ci/ci-configure.sh | 67 +++++++++++++++++++++++++++++++++++++++ .ci/ci-linux-build.sh | 63 ------------------------------------ .ci/ci-make-benchmark.sh | 14 ++++++++ .ci/ci-make-checkbuild.sh | 14 ++++++++ .ci/ci-make-distcheck.sh | 14 ++++++++ .ci/ci-make-examples.sh | 14 ++++++++ .ci/ci-make-install.sh | 14 ++++++++ .ci/ci-make.sh | 10 ++++++ .ci/ci-osx-build.sh | 20 ------------ .travis.yml | 24 ++++++++++++-- 11 files changed, 169 insertions(+), 87 deletions(-) create mode 100755 .ci/ci-configure.sh delete mode 100755 .ci/ci-linux-build.sh create mode 100755 .ci/ci-make-benchmark.sh create mode 100755 .ci/ci-make-checkbuild.sh create mode 100755 .ci/ci-make-distcheck.sh create mode 100755 .ci/ci-make-examples.sh create mode 100755 .ci/ci-make-install.sh create mode 100755 .ci/ci-make.sh delete mode 100755 .ci/ci-osx-build.sh diff --git a/.ci/build-efl-app.sh b/.ci/build-efl-app.sh index ac22e09db5..94013a3ba3 100755 --- a/.ci/build-efl-app.sh +++ b/.ci/build-efl-app.sh @@ -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 index 0000000000..28897dafcc --- /dev/null +++ b/.ci/ci-configure.sh @@ -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 index ddc33fef50..0000000000 --- a/.ci/ci-linux-build.sh +++ /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 index 0000000000..bd63977724 --- /dev/null +++ b/.ci/ci-make-benchmark.sh @@ -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 index 0000000000..2cb852dba6 --- /dev/null +++ b/.ci/ci-make-checkbuild.sh @@ -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 index 0000000000..144b95782e --- /dev/null +++ b/.ci/ci-make-distcheck.sh @@ -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 index 0000000000..4ab0f70b7b --- /dev/null +++ b/.ci/ci-make-examples.sh @@ -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 index 0000000000..9856179080 --- /dev/null +++ b/.ci/ci-make-install.sh @@ -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 index 0000000000..8bd445f276 --- /dev/null +++ b/.ci/ci-make.sh @@ -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 index 4e7a0f05cc..0000000000 --- a/.ci/ci-osx-build.sh +++ /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 diff --git a/.travis.yml b/.travis.yml index db48ce3840..817e4f177f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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: - |