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-16 15:13:23 -0400
commit08188e065f650f851f1c8007acd6ff010d372f2c (patch)
treeb40ed6bd899aef7312c583e8b15bf140bc05e500
parent88ce7fffd479d3c452763bfd443a5f8d9dce2b45 (diff)
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
5 5
6. .ci/travis.sh 6. .ci/travis.sh
7 7
8run_distcheck() {
9 if [ "$DISTRO" != "" ] ; then
10 docker exec --env MAKEFLAGS="-j5 -rR" --env EIO_MONITOR_POLL=1 --env CC="ccache gcc" \
11 --env CXX="ccache g++" \
12 --env CFLAGS="-fdirectives-only" --env CXXFLAGS="-fdirectives-only" \
13 --env LD="ld.gold" $(cat $HOME/cid) bash -c .ci/distcheck.sh
14 else
15 export PATH="/usr/local/opt/ccache/libexec:$(brew --prefix gettext)/bin:$PATH"
16 .ci/distcheck.sh
17 fi
18}
19
20if [ "$1" != "release-ready" ] ; then 8if [ "$1" != "release-ready" ] ; then
21 exit 0 9 exit 0
22fi 10fi
23travis_fold distcheck "make distcheck"
24 11
25num_buildfiles_changed=0 12# skip distcheck if distcheck was skipped
26if [ -f ~/cachedir/last-distcheck.txt ] ; then 13if [ -n "$DISTCHECK_SKIPPED" ] ; then
27 prev_distcheck=$(cat ~/cachedir/last-distcheck.txt) 14 exit 0
28 if git show --oneline $prev_distcheck 2>&1 > /dev/null ; then 15fi
29 num_buildfiles_changed=$(git diff --name-only $prev_distcheck HEAD|grep '\.am\|\.ac\|\.mk'|wc -l) 16
30 manual_trigger=$(git log --grep 'cibuildme' $prev_distcheck..HEAD|wc -l) 17travis_fold distcheck "make distcheck"
31 else 18if [ "$DISTRO" != "" ] ; then
32 manual_trigger=1 19 docker exec --env MAKEFLAGS="-j5 -rR" --env EIO_MONITOR_POLL=1 --env CC="ccache gcc" \
33 fi 20 --env CXX="ccache g++" \
34 if [ "$num_buildfiles_changed" != "0" -o "$manual_trigger" != "0" ]; then 21 --env CFLAGS="-fdirectives-only" --env CXXFLAGS="-fdirectives-only" \
35 run_distcheck 22 --env LD="ld.gold" $(cat $HOME/cid) bash -c .ci/distcheck.sh
36 else
37 echo "Skipping distcheck: not forced and no build files changed"
38 fi
39else 23else
40 run_distcheck 24 export PATH="/usr/local/opt/ccache/libexec:$(brew --prefix gettext)/bin:$PATH"
25 .ci/distcheck.sh
41fi 26fi
27
42rm -f ~/cachedir/last-distcheck.txt 28rm -f ~/cachedir/last-distcheck.txt
43git rev-parse HEAD > ~/cachedir/last-distcheck.txt 29git rev-parse HEAD > ~/cachedir/last-distcheck.txt
44 30
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 @@
1#!/bin/bash -e
2
3
4if [ "x$1" = "xrelease-ready" ] ; then
5 num_buildfiles_changed=0
6 if [ -f ~/cachedir/last-distcheck.txt ] ; then
7 prev_distcheck=$(cat ~/cachedir/last-distcheck.txt)
8 if git show --oneline $prev_distcheck 2>&1 > /dev/null ; then
9 num_buildfiles_changed=$(git diff --name-only $prev_distcheck HEAD|grep '\.am\|\.ac\|\.mk'|wc -l)
10 manual_trigger=$(git log --grep 'cibuildme' $prev_distcheck..HEAD|wc -l)
11 else
12 manual_trigger=1
13 fi
14 if [ "$num_buildfiles_changed" != "0" -o "$manual_trigger" != "0" ]; then
15 echo "Running distcheck: forced or build files changed"
16 exit 0
17 else
18 echo "Skipping distcheck: not forced and no build files changed"
19 rm -f ~/cachedir/last-distcheck.txt
20 git rev-parse HEAD > ~/cachedir/last-distcheck.txt
21 exit 1
22 fi
23 fi
24fi
25
26exit 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:
70 mv $HOME/cachedir/Homebrew $HOME/Library/Caches/Homebrew 70 mv $HOME/cachedir/Homebrew $HOME/Library/Caches/Homebrew
71 .ci/ci-osx-deps.sh 71 .ci/ci-osx-deps.sh
72 fi 72 fi
73 - |
74 if [[ "$CI_BUILD_TYPE" = "release-ready" ]] ; then
75 .ci/distcheck-eval.sh "$CI_BUILD_TYPE" || export DISTCHECK_SKIPPED=1
76 fi
73 77
74before_script: 78before_script:
75 - | 79 - |
76 if [[ "$TRAVIS_OS_NAME" == "linux" ]] && [[ "$DISTRO" != "" ]]; then 80 if [[ "$TRAVIS_OS_NAME" == "linux" ]] && [[ "$DISTRO" != "" ]] && [[ -z "$DISTCHECK_SKIPPED" ]] ; then
77 docker pull stefanschmidt1/ci-support-files:$DISTRO 81 docker pull stefanschmidt1/ci-support-files:$DISTRO
78 fi 82 fi
79 - | 83 - |
80 if [[ "$TRAVIS_OS_NAME" == "linux" ]] ; then 84 if [[ "$TRAVIS_OS_NAME" == "linux" ]] && [[ -z "$DISTCHECK_SKIPPED" ]] ; then
81 docker version 85 docker version
82 docker run --cidfile $HOME/cid -t -d -v `pwd`:/src -v $HOME/.ccache:/root/.ccache -w /src stefanschmidt1/ci-support-files:$DISTRO bash 86 docker run --cidfile $HOME/cid -t -d -v `pwd`:/src -v $HOME/.ccache:/root/.ccache -w /src stefanschmidt1/ci-support-files:$DISTRO bash
83 cp $HOME/cachedir/config.cache . || true 87 cp $HOME/cachedir/config.cache . || true
84 fi 88 fi
85 89
86 - .ci/ci-ccache-stats.sh 90 - if [[ -z "$DISTCHECK_SKIPPED" ]] ; then .ci/ci-ccache-stats.sh ; fi
87 - | 91 - |
88 if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then 92 if [[ "$TRAVIS_OS_NAME" == "osx" ]] && [[ -z "$DISTCHECK_SKIPPED" ]] ; then
89 cp $HOME/cachedir/config.cache . || true 93 cp $HOME/cachedir/config.cache . || true
90 fi 94 fi
91 95
92 96
93script: 97script:
94 - .ci/ci-configure.sh "$CI_BUILD_TYPE" 98 - if [[ -z "$DISTCHECK_SKIPPED" ]] ; then .ci/ci-configure.sh "$CI_BUILD_TYPE" ; fi
95 - .ci/ci-setup-ccache.sh "$CI_BUILD_TYPE" 99 - if [[ -z "$DISTCHECK_SKIPPED" ]] ; then .ci/ci-setup-ccache.sh "$CI_BUILD_TYPE" ; fi
96 - .ci/ci-make.sh "$CI_BUILD_TYPE" 100 - if [[ -z "$DISTCHECK_SKIPPED" ]] ; then .ci/ci-make.sh "$CI_BUILD_TYPE" ; fi
97 - .ci/ci-make-checkbuild.sh "$CI_BUILD_TYPE" 101 - if [[ -z "$DISTCHECK_SKIPPED" ]] ; then .ci/ci-make-checkbuild.sh "$CI_BUILD_TYPE" ; fi
98 #- .ci/ci-make-examples.sh "$CI_BUILD_TYPE" 102 #- if [[ -z "$DISTCHECK_SKIPPED" ]] ; then .ci/ci-make-examples.sh "$CI_BUILD_TYPE" ; fi
99 - | 103 - |
100 if [[ "$TRAVIS_OS_NAME" == "linux" ]] && [[ "$CI_BUILD_TYPE" == "" ]]; then 104 if [[ "$TRAVIS_OS_NAME" == "linux" ]] && [[ "$CI_BUILD_TYPE" == "" ]]; then
101 .ci/ci-make-benchmark.sh "$CI_BUILD_TYPE" 105 .ci/ci-make-benchmark.sh "$CI_BUILD_TYPE"
102 fi 106 fi
103 #- .ci/ci-make-install.sh "$CI_BUILD_TYPE" 107 #- if [[ -z "$DISTCHECK_SKIPPED" ]] ; then .ci/ci-make-install.sh "$CI_BUILD_TYPE" ; fi
104 - .ci/ci-make-check.sh "$CI_BUILD_TYPE" 108 - if [[ -z "$DISTCHECK_SKIPPED" ]] ; then .ci/ci-make-check.sh "$CI_BUILD_TYPE" ; fi
105 - .ci/ci-make-distcheck.sh "$CI_BUILD_TYPE" 109 - if [[ -z "$DISTCHECK_SKIPPED" ]] ; then .ci/ci-make-distcheck.sh "$CI_BUILD_TYPE" ; fi
106 #- | 110 #- |
107 #if [[ "$DISTRO" == "" ]] && [[ "$TRAVIS_OS_NAME" != "linux" ]] ; then 111 #if [[ "$DISTRO" == "" ]] && [[ "$TRAVIS_OS_NAME" != "linux" ]] ; then
108 #true 112 #true
@@ -110,10 +114,10 @@ script:
110 #docker exec --env MAKEFLAGS="-j5 -rR" --env EIO_MONITOR_POLL=1 $(cat $HOME/cid) .ci/build-efl-app.sh 114 #docker exec --env MAKEFLAGS="-j5 -rR" --env EIO_MONITOR_POLL=1 $(cat $HOME/cid) .ci/build-efl-app.sh
111 #fi 115 #fi
112before_cache: 116before_cache:
113 - .ci/ci-ccache-stats.sh 117 - if [[ -z "$DISTCHECK_SKIPPED" ]] ; then .ci/ci-ccache-stats.sh ; fi
114 - | 118 - |
115 mkdir -p $HOME/cachedir 119 mkdir -p $HOME/cachedir
116 if [[ "$TRAVIS_OS_NAME" == "linux" ]] ; then 120 if [[ "$TRAVIS_OS_NAME" == "linux" ]] && [[ -z "$DISTCHECK_SKIPPED" ]] ; then
117 sudo chown travis:travis $HOME/.ccache 121 sudo chown travis:travis $HOME/.ccache
118 mkdir -p $HOME/cachedir/ 122 mkdir -p $HOME/cachedir/
119 sudo cp config.cache $HOME/cachedir/ 123 sudo cp config.cache $HOME/cachedir/
@@ -126,7 +130,7 @@ before_cache:
126 130
127after_success: 131after_success:
128 - | 132 - |
129 if [[ "$TRAVIS_OS_NAME" == "linux" ]] && [[ "$DISTRO" != "" ]]; then 133 if [[ "$TRAVIS_OS_NAME" == "linux" ]] && [[ "$DISTRO" != "" ]] && [[ -z "$DISTCHECK_SKIPPED" ]]; then
130 docker login -u stefanschmidt1 -p "$DOCKER_PASSWORD" 134 docker login -u stefanschmidt1 -p "$DOCKER_PASSWORD"
131 docker tag stefanschmidt1/ci-support-files:$DISTRO stefanschmidt1/ci-support-files:$DISTRO-$TRAVIS_BUILD_NUMBER 135 docker tag stefanschmidt1/ci-support-files:$DISTRO stefanschmidt1/ci-support-files:$DISTRO-$TRAVIS_BUILD_NUMBER
132 docker push stefanschmidt1/ci-support-files:$DISTRO 136 docker push stefanschmidt1/ci-support-files:$DISTRO