summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2018-08-02 13:29:46 -0400
committerMike Blumenkrantz <zmike@samsung.com>2018-08-15 16:16:32 -0400
commitc36ac1574ea411f10d6ffca33f67122d9d95928c (patch)
tree427d0d132c1e88b0540b8889c78c843169060bac
parent50c78492639ba9c667eee443b37eea3747ecea9e (diff)
downloadefl-c36ac1574ea411f10d6ffca33f67122d9d95928c.tar.gz
ci: move distcheck build skipping to earliest possible place in build
this breaks out the script to evaluate whether a distcheck should occur into a separate file and runs it in the before_install hook, setting a variable on skip running configure or any commands at all is unnecessary if the distcheck build will be skipped, so just update the last-distcheck file and abort the build immediately to save time Differential Revision: https://phab.enlightenment.org/D6735
-rwxr-xr-x.ci/ci-make-distcheck.sh42
-rwxr-xr-x.ci/distcheck-eval.sh26
-rw-r--r--.travis.yml34
3 files changed, 59 insertions, 43 deletions
diff --git a/.ci/ci-make-distcheck.sh b/.ci/ci-make-distcheck.sh
index f2b0c62869..07f603be0f 100755
--- a/.ci/ci-make-distcheck.sh
+++ b/.ci/ci-make-distcheck.sh
@@ -5,40 +5,26 @@ set -e
. .ci/travis.sh
-run_distcheck() {
- if [ "$DISTRO" != "" ] ; then
- docker exec --env MAKEFLAGS="-j5 -rR" --env EIO_MONITOR_POLL=1 --env CC="ccache gcc" \
- --env CXX="ccache g++" \
- --env CFLAGS="-fdirectives-only" --env CXXFLAGS="-fdirectives-only" \
- --env LD="ld.gold" $(cat $HOME/cid) bash -c .ci/distcheck.sh
- else
- export PATH="/usr/local/opt/ccache/libexec:$(brew --prefix gettext)/bin:$PATH"
- .ci/distcheck.sh
- fi
-}
-
if [ "$1" != "release-ready" ] ; then
exit 0
fi
-travis_fold distcheck "make distcheck"
-num_buildfiles_changed=0
-if [ -f ~/cachedir/last-distcheck.txt ] ; then
- prev_distcheck=$(cat ~/cachedir/last-distcheck.txt)
- if git show --oneline $prev_distcheck 2>&1 > /dev/null ; then
- num_buildfiles_changed=$(git diff --name-only $prev_distcheck HEAD|grep '\.am\|\.ac\|\.mk'|wc -l)
- manual_trigger=$(git log --grep 'cibuildme' $prev_distcheck..HEAD|wc -l)
- else
- manual_trigger=1
- fi
- if [ "$num_buildfiles_changed" != "0" -o "$manual_trigger" != "0" ]; then
- run_distcheck
- else
- echo "Skipping distcheck: not forced and no build files changed"
- fi
+# skip distcheck if distcheck was skipped
+if [ -n "$DISTCHECK_SKIPPED" ] ; then
+ exit 0
+fi
+
+travis_fold distcheck "make distcheck"
+if [ "$DISTRO" != "" ] ; then
+ docker exec --env MAKEFLAGS="-j5 -rR" --env EIO_MONITOR_POLL=1 --env CC="ccache gcc" \
+ --env CXX="ccache g++" \
+ --env CFLAGS="-fdirectives-only" --env CXXFLAGS="-fdirectives-only" \
+ --env LD="ld.gold" $(cat $HOME/cid) bash -c .ci/distcheck.sh
else
- run_distcheck
+ export PATH="/usr/local/opt/ccache/libexec:$(brew --prefix gettext)/bin:$PATH"
+ .ci/distcheck.sh
fi
+
rm -f ~/cachedir/last-distcheck.txt
git rev-parse HEAD > ~/cachedir/last-distcheck.txt
diff --git a/.ci/distcheck-eval.sh b/.ci/distcheck-eval.sh
new file mode 100755
index 0000000000..bd6f8e5800
--- /dev/null
+++ b/.ci/distcheck-eval.sh
@@ -0,0 +1,26 @@
+#!/bin/bash -e
+
+
+if [ "x$1" = "xrelease-ready" ] ; then
+ num_buildfiles_changed=0
+ if [ -f ~/cachedir/last-distcheck.txt ] ; then
+ prev_distcheck=$(cat ~/cachedir/last-distcheck.txt)
+ if git show --oneline $prev_distcheck 2>&1 > /dev/null ; then
+ num_buildfiles_changed=$(git diff --name-only $prev_distcheck HEAD|grep '\.am\|\.ac\|\.mk'|wc -l)
+ manual_trigger=$(git log --grep 'cibuildme' $prev_distcheck..HEAD|wc -l)
+ else
+ manual_trigger=1
+ fi
+ if [ "$num_buildfiles_changed" != "0" -o "$manual_trigger" != "0" ]; then
+ echo "Running distcheck: forced or build files changed"
+ exit 0
+ else
+ echo "Skipping distcheck: not forced and no build files changed"
+ rm -f ~/cachedir/last-distcheck.txt
+ git rev-parse HEAD > ~/cachedir/last-distcheck.txt
+ exit 1
+ fi
+ fi
+fi
+
+exit 1
diff --git a/.travis.yml b/.travis.yml
index a697a3b113..035f3cf2f2 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -70,39 +70,43 @@ before_install:
mv $HOME/cachedir/Homebrew $HOME/Library/Caches/Homebrew
.ci/ci-osx-deps.sh
fi
+ - |
+ if [[ "$CI_BUILD_TYPE" = "release-ready" ]] ; then
+ .ci/distcheck-eval.sh "$CI_BUILD_TYPE" || export DISTCHECK_SKIPPED=1
+ fi
before_script:
- |
- if [[ "$TRAVIS_OS_NAME" == "linux" ]] && [[ "$DISTRO" != "" ]]; then
+ if [[ "$TRAVIS_OS_NAME" == "linux" ]] && [[ "$DISTRO" != "" ]] && [[ -z "$DISTCHECK_SKIPPED" ]] ; then
docker pull stefanschmidt1/ci-support-files:$DISTRO
fi
- |
- if [[ "$TRAVIS_OS_NAME" == "linux" ]] ; then
+ if [[ "$TRAVIS_OS_NAME" == "linux" ]] && [[ -z "$DISTCHECK_SKIPPED" ]] ; then
docker version
docker run --cidfile $HOME/cid -t -d -v `pwd`:/src -v $HOME/.ccache:/root/.ccache -w /src stefanschmidt1/ci-support-files:$DISTRO bash
cp $HOME/cachedir/config.cache . || true
fi
- - .ci/ci-ccache-stats.sh
+ - if [[ -z "$DISTCHECK_SKIPPED" ]] ; then .ci/ci-ccache-stats.sh ; fi
- |
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
+ if [[ "$TRAVIS_OS_NAME" == "osx" ]] && [[ -z "$DISTCHECK_SKIPPED" ]] ; then
cp $HOME/cachedir/config.cache . || true
fi
script:
- - .ci/ci-configure.sh "$CI_BUILD_TYPE"
- - .ci/ci-setup-ccache.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 [[ -z "$DISTCHECK_SKIPPED" ]] ; then .ci/ci-configure.sh "$CI_BUILD_TYPE" ; fi
+ - if [[ -z "$DISTCHECK_SKIPPED" ]] ; then .ci/ci-setup-ccache.sh "$CI_BUILD_TYPE" ; fi
+ - if [[ -z "$DISTCHECK_SKIPPED" ]] ; then .ci/ci-make.sh "$CI_BUILD_TYPE" ; fi
+ - if [[ -z "$DISTCHECK_SKIPPED" ]] ; then .ci/ci-make-checkbuild.sh "$CI_BUILD_TYPE" ; fi
+ #- if [[ -z "$DISTCHECK_SKIPPED" ]] ; then .ci/ci-make-examples.sh "$CI_BUILD_TYPE" ; fi
- |
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-check.sh "$CI_BUILD_TYPE"
- - .ci/ci-make-distcheck.sh "$CI_BUILD_TYPE"
+ #- if [[ -z "$DISTCHECK_SKIPPED" ]] ; then .ci/ci-make-install.sh "$CI_BUILD_TYPE" ; fi
+ - if [[ -z "$DISTCHECK_SKIPPED" ]] ; then .ci/ci-make-check.sh "$CI_BUILD_TYPE" ; fi
+ - if [[ -z "$DISTCHECK_SKIPPED" ]] ; then .ci/ci-make-distcheck.sh "$CI_BUILD_TYPE" ; fi
#- |
#if [[ "$DISTRO" == "" ]] && [[ "$TRAVIS_OS_NAME" != "linux" ]] ; then
#true
@@ -110,10 +114,10 @@ script:
#docker exec --env MAKEFLAGS="-j5 -rR" --env EIO_MONITOR_POLL=1 $(cat $HOME/cid) .ci/build-efl-app.sh
#fi
before_cache:
- - .ci/ci-ccache-stats.sh
+ - if [[ -z "$DISTCHECK_SKIPPED" ]] ; then .ci/ci-ccache-stats.sh ; fi
- |
mkdir -p $HOME/cachedir
- if [[ "$TRAVIS_OS_NAME" == "linux" ]] ; then
+ if [[ "$TRAVIS_OS_NAME" == "linux" ]] && [[ -z "$DISTCHECK_SKIPPED" ]] ; then
sudo chown travis:travis $HOME/.ccache
mkdir -p $HOME/cachedir/
sudo cp config.cache $HOME/cachedir/
@@ -126,7 +130,7 @@ before_cache:
after_success:
- |
- if [[ "$TRAVIS_OS_NAME" == "linux" ]] && [[ "$DISTRO" != "" ]]; then
+ if [[ "$TRAVIS_OS_NAME" == "linux" ]] && [[ "$DISTRO" != "" ]] && [[ -z "$DISTCHECK_SKIPPED" ]]; then
docker login -u stefanschmidt1 -p "$DOCKER_PASSWORD"
docker tag stefanschmidt1/ci-support-files:$DISTRO stefanschmidt1/ci-support-files:$DISTRO-$TRAVIS_BUILD_NUMBER
docker push stefanschmidt1/ci-support-files:$DISTRO