[gjs: 2/3] CI: on fresh docker images build using autotools



commit 39aaa4364ebe463ebee6d23f72699415dc66bdf6
Author: Claudio André <claudioandre br gmail com>
Date:   Sun Feb 25 21:50:23 2018 -0300

    CI: on fresh docker images build using autotools
    
    Do build using autotools (a regular build) when running in an updated
    distro.
    [skip eslint]

 .gitlab-ci.yml           | 16 +++++++++++-----
 Makefile.am              |  1 +
 test/extra/do_jhbuild.sh |  1 +
 test/test-ci.sh          | 38 ++++++++++++++++++++++++++++++++------
 4 files changed, 45 insertions(+), 11 deletions(-)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 5208d56..f102423 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -14,14 +14,18 @@ stages:
     name: log
     when: always
     paths:
-    - $(pwd)/.cache/jhbuild/build/gjs/test-suite.log
-    - $(pwd)/.cache/jhbuild/build/gjs/config.log
+    - $(pwd)/.cache/jhbuild/build/gjs/*.log
     - $(pwd)/.cache/jhbuild/build/gjs/Makefile
+    - $(pwd)/.cache/jhbuild/build/gjs/configure
     - $(pwd)/coverage/
     - $(pwd)/cppcheck/
     - $(pwd)/cpplint/
     - $(pwd)/eslint/
     - $(pwd)/tokei/
+    - $(pwd)/gjs-1.*/_build/sub/test-suite.log
+    - $(pwd)/*.log
+    - $(pwd)/Makefile
+    - $(pwd)/configure
 
   script:
     # CI starts here. Previous messages are GitLab Runner setup.
@@ -33,11 +37,11 @@ stages:
     - echo
 
     # Run static code analysis OR
-    # Build dependencies and 'make check' gjs
+    # Build dependencies and 'make' gjs
     - 'if [[ -n "${CODECHECK}" ]]; then
          $(pwd)/test/test-ci.sh "$CODECHECK";
        else
-         $(pwd)/test/test-ci.sh GJS "$DEV";
+         $(pwd)/test/test-ci.sh GJS;
        fi'
 
     # Run extra tests
@@ -58,7 +62,6 @@ fedora:
   variables:
     CC: gcc
     DEV: devel
-    TEST: "fast"
 
 ubuntu_gcc:
   <<: *build
@@ -67,6 +70,7 @@ ubuntu_gcc:
   variables:
     CC: gcc
     DEV: devel
+    TEST: "distcheck"
     BUILD_OPTS: "--enable-installed-tests"
   only:
     - master@GNOME/gjs
@@ -78,6 +82,7 @@ ubuntu_clang:
   variables:
     CC: clang
     DEV: devel
+    TEST: "distcheck"
     BUILD_OPTS: "--enable-installed-tests"
   only:
     - master@GNOME/gjs
@@ -89,6 +94,7 @@ fedora_gcc:
   variables:
     CC: gcc
     DEV: devel
+    TEST: "distcheck"
     BUILD_OPTS: "--enable-ubsan"
 
 coverage:
diff --git a/Makefile.am b/Makefile.am
index 7f8edd2..2f66cf3 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -199,6 +199,7 @@ EXTRA_DIST +=                                       \
 TAG_PREFIX=GJS_
 COMPRESSION=.bz2
 
+DISTCLEANFILES=gjs-*.syscap installed-tests/scripts/*.test installed-tests/js/*.test
 
 PACKAGE=@PACKAGE@
 VERSION=@VERSION@
diff --git a/test/extra/do_jhbuild.sh b/test/extra/do_jhbuild.sh
index e4e65d0..031f5e6 100755
--- a/test/extra/do_jhbuild.sh
+++ b/test/extra/do_jhbuild.sh
@@ -41,6 +41,7 @@ function do_Configure_MainBuild(){
     if [[ -n "${BUILD_OPTS}" ]]; then
         autogenargs="$autogenargs $BUILD_OPTS"
     fi
+    export ci_autogenargs="$autogenargs"
 
     cat <<EOFILE > ~/.config/jhbuildrc
 module_autogenargs['gjs'] = "$autogenargs"
diff --git a/test/test-ci.sh b/test/test-ci.sh
index 58cdae7..44291f5 100755
--- a/test/test-ci.sh
+++ b/test/test-ci.sh
@@ -33,6 +33,7 @@ function do_Show_Info(){
 
     echo '--------------------------------'
     echo 'Useful build system information'
+    echo -n "Processors: "; grep -c ^processor /proc/cpuinfo
     id; uname -a
     printenv
     echo '--------------------------------'
@@ -108,7 +109,7 @@ if [[ $1 == "GJS" ]]; then
     do_Set_Env
     do_Show_Info
 
-    if [[ $2 != "devel" ]]; then
+    if [[ "$DEV" != "devel" ]]; then
         do_Get_JHBuild
         do_Build_JHBuild
         do_Configure_JHBuild
@@ -123,15 +124,36 @@ if [[ $1 == "GJS" ]]; then
     # Javascript Bindings for GNOME (gjs)
     echo
     echo '-- gjs status --'
-    cp -r ./ ~/jhbuild/checkout/gjs
-
-    cd ~/jhbuild/checkout/gjs
     git log --pretty=format:"%h %cd %s" -1
 
     echo
     echo '-- gjs build --'
     echo
-    jhbuild make --check
+
+    if [[ "$DEV" != "devel" ]]; then
+        cp -r ./ ~/jhbuild/checkout/gjs
+        cd ~/jhbuild/checkout/gjs
+
+        jhbuild make --check
+    else
+        # Ignore JHBuild "chroot" and do a system wide (regular) setup
+        export PKG_CONFIG_PATH=/root/jhbuild/install/lib/pkgconfig
+        export LD_LIBRARY_PATH=/root/jhbuild/install/lib
+        export AM_DISTCHECK_CONFIGURE_FLAGS="--enable-compile-warnings=error --with-xvfb-tests"
+
+        # Regular (autotools only) build
+        echo "Autogen options: $ci_autogenargs"
+        eval ./autogen.sh "$ci_autogenargs"
+
+        if [[ $TEST == "build" ]]; then
+            make -sj
+        elif [[ $TEST == "distcheck" ]]; then
+            make -sj distcheck
+        else
+            make -sj check
+        fi
+        make -sj install
+    fi
 
 elif [[ $1 == "GJS_EXTRA" ]]; then
     # Extra testing. It doesn't (re)build, just run the 'Installed Tests'
@@ -140,7 +162,11 @@ elif [[ $1 == "GJS_EXTRA" ]]; then
     do_Set_Env
     PATH=$PATH:~/.local/bin
 
-    xvfb-run jhbuild run dbus-run-session -- gnome-desktop-testing-runner gjs
+    if [[ "$DEV" != "devel" ]]; then
+        xvfb-run jhbuild run dbus-run-session -- gnome-desktop-testing-runner gjs
+    else
+        xvfb-run dbus-run-session -- gnome-desktop-testing-runner gjs
+    fi
 
 elif [[ $1 == "GJS_COVERAGE" ]]; then
     # Code coverage test. It doesn't (re)build, just run the 'Coverage Tests'


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]