diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2881eaa9664b7a58efe44aa18bd7879b3cd5c021..e20a524253bb88b00d4381bfe9453238cf0104a4 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -27,7 +27,7 @@ Env Finalize: <<: *main_tests stage: Finalization allow_failure: true - when: on_success + when: always script: - rm -rf $HOME/$CI_PIPELINE_ID diff --git a/scripts/validate.bash b/scripts/validate.bash index 10a24401d210a813029790c5831ae8f07908bcc3..12907fa7648a71f566de5b1ca3a4ba5e84bbecf6 100644 --- a/scripts/validate.bash +++ b/scripts/validate.bash @@ -13,6 +13,7 @@ LKT_STEP="" # Steps: configure, build, etc LKT_DIR="$PWD" # The project directory LKT_CONFIGURE_OPTIONS="" # Options to pass to the configure command LKT_CORE_NUMBER=4 # Number of cores to use with make +LKT_TEST="" # Which tests to perform ### Utility functions ######################################################## function die () @@ -37,9 +38,32 @@ function check_make () make $* || die "Failed to make with compiler $LKT_COMPILER" } +function help () +{ +cat << EOF +Usage validate.bash --build=* --step=* [option] + + --help, -h Prints this help message. + --build=comp Specify the compiler. + --step=AA,BB,.. Specify the steps to do. The list may contains the + following items: configure, launch, build. + +Step configure options: + --debug Perform a debug build. + --static-modules Build modules inside liblektor.so, not in their own + .so files. + +Step launch options: + --test=AA,BB,.. Perform the specified tests. + +EOF +} + if ! [ -f $PWD/scripts/validate.sh ] ; then - die This script should be run from the root of the project + die "This script should be run from the root of the project" fi +SQLITE3=$(which sqlite3) +[ $? -ne 0 ] && die "Can't find the sqlite3 executable" ### CONFIGURE ################################################################ # Globals: # @@ -51,8 +75,8 @@ function do_configure () check_cd $LKT_DIR mkdir {build,install}.$LKT_COMPILER check_cd build.$LKT_COMPILER - check_configure \ - --prefix=$LKT_DIR/install.$LKT_COMPILER \ + check_configure \ + --prefix=$LKT_DIR/install.$LKT_COMPILER \ $LKT_CONFIGURE_OPTIONS check_cd $LKT_DIR } @@ -76,12 +100,28 @@ function do_steps () { local _build="" local _configure="" + local _launch="" for step in $LKT_STEP ; do case "$step" in - build) do_build;; - configure) do_configure;; + build) _build="yes";; + configure) _configure="yes";; + launch) _launch="yes";; esac done + + [ "x$_configure" = "xyes" ] && do_configure + [ "x$_build" = "xyes" ] && do_build + [ "x$_launch" = "xyes" ] && do_launch +} + +### PERFORM THE TESTS ######################################################## +# Globals: # +# - LKT_TEST Which tests to perform # +# - LKT_DIR The project root directory # +function do_launch () +{ + check_cd $LKT_DIR + die "No test available" } ### PROCESS ARGS ############################################################# @@ -119,11 +159,16 @@ for arg in $* ; do --step=*) LKT_STEP=$(echo "A$arg" | sed -e 's/A--step=//g' -e 's/,/ /g') ;; + --test=*) + LKT_TEST=$(echo "A$arg" | sed -e 's/A--test=//g' -e 's/,/ /g') + ;; *) die "Unknown argument $arg" ;; esac done +### DO OUR STUFF HERE ######################################################## process_args do_steps +exit 0