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:
<<: *main_tests
stage: Finalization
allow_failure: true
when: on_success
when: always
script:
- rm -rf $HOME/$CI_PIPELINE_ID
......
......@@ -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: #
......@@ -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
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter