Skip to content
Extraits de code Groupes Projets
Vérifiée Valider e56fe3f1 rédigé par Kubat's avatar Kubat
Parcourir les fichiers

CI: Add help to validate.bash an fix the CI file.

parent ba0fb9fe
Aucune branche associée trouvée
Aucune étiquette associée trouvée
1 requête de fusion!105Refactor and more
...@@ -27,7 +27,7 @@ Env Finalize: ...@@ -27,7 +27,7 @@ Env Finalize:
<<: *main_tests <<: *main_tests
stage: Finalization stage: Finalization
allow_failure: true allow_failure: true
when: on_success when: always
script: script:
- rm -rf $HOME/$CI_PIPELINE_ID - rm -rf $HOME/$CI_PIPELINE_ID
......
...@@ -13,6 +13,7 @@ LKT_STEP="" # Steps: configure, build, etc ...@@ -13,6 +13,7 @@ LKT_STEP="" # Steps: configure, build, etc
LKT_DIR="$PWD" # The project directory LKT_DIR="$PWD" # The project directory
LKT_CONFIGURE_OPTIONS="" # Options to pass to the configure command LKT_CONFIGURE_OPTIONS="" # Options to pass to the configure command
LKT_CORE_NUMBER=4 # Number of cores to use with make LKT_CORE_NUMBER=4 # Number of cores to use with make
LKT_TEST="" # Which tests to perform
### Utility functions ######################################################## ### Utility functions ########################################################
function die () function die ()
...@@ -37,9 +38,32 @@ function check_make () ...@@ -37,9 +38,32 @@ function check_make ()
make $* || die "Failed to make with compiler $LKT_COMPILER" 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 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 fi
SQLITE3=$(which sqlite3)
[ $? -ne 0 ] && die "Can't find the sqlite3 executable"
### CONFIGURE ################################################################ ### CONFIGURE ################################################################
# Globals: # # Globals: #
...@@ -51,8 +75,8 @@ function do_configure () ...@@ -51,8 +75,8 @@ function do_configure ()
check_cd $LKT_DIR check_cd $LKT_DIR
mkdir {build,install}.$LKT_COMPILER mkdir {build,install}.$LKT_COMPILER
check_cd build.$LKT_COMPILER check_cd build.$LKT_COMPILER
check_configure \ check_configure \
--prefix=$LKT_DIR/install.$LKT_COMPILER \ --prefix=$LKT_DIR/install.$LKT_COMPILER \
$LKT_CONFIGURE_OPTIONS $LKT_CONFIGURE_OPTIONS
check_cd $LKT_DIR check_cd $LKT_DIR
} }
...@@ -76,12 +100,28 @@ function do_steps () ...@@ -76,12 +100,28 @@ function do_steps ()
{ {
local _build="" local _build=""
local _configure="" local _configure=""
local _launch=""
for step in $LKT_STEP ; do for step in $LKT_STEP ; do
case "$step" in case "$step" in
build) do_build;; build) _build="yes";;
configure) do_configure;; configure) _configure="yes";;
launch) _launch="yes";;
esac esac
done 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 ############################################################# ### PROCESS ARGS #############################################################
...@@ -119,11 +159,16 @@ for arg in $* ; do ...@@ -119,11 +159,16 @@ for arg in $* ; do
--step=*) --step=*)
LKT_STEP=$(echo "A$arg" | sed -e 's/A--step=//g' -e 's/,/ /g') 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" die "Unknown argument $arg"
;; ;;
esac esac
done done
### DO OUR STUFF HERE ########################################################
process_args process_args
do_steps do_steps
exit 0
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter