From 7a526ea537963a09b0886a1139ca190e8f3a0050 Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Fri, 23 Jul 2021 14:14:31 +0200 Subject: [PATCH] First step of action add ssh stuff Update github action Fix Logic Don't override the PATH !!! Download the known host too, so it is possible to add new IPs in it. Fix GIT path and better management of VERSION_NUMBER fix autotest_cgal Fixes for scripts --- .github/workflows/filter_testsuite.yml | 9 +++++---- Scripts/developer_scripts/autotest_cgal | 16 ++++++++++------ .../run_testsuite_from_branch_name.sh | 13 ++++++++----- 3 files changed, 23 insertions(+), 15 deletions(-) diff --git a/.github/workflows/filter_testsuite.yml b/.github/workflows/filter_testsuite.yml index f2eb2dd589e..61ff21ff405 100644 --- a/.github/workflows/filter_testsuite.yml +++ b/.github/workflows/filter_testsuite.yml @@ -75,14 +75,15 @@ jobs: BRANCH_NAME=$(echo $LABEL | cut -d':' -f 2) BASE="${{ steps.get_base.outputs.result }}" mapfile -t HOSTS < ~/ssh_host_list; - LAST_INDEX=$((${#HOSTS[@]}-1)) for i in ${!HOSTS[@]}; do HOST=$(echo ${HOSTS[$i]}|cut -d' ' -f 1 ) PATH_TO_SCRIPT=$(echo ${HOSTS[$i]}|cut -d' ' -f 2 ) - if [ "$i" -ne "$LAST_INDEX" ] ; then - ssh ${HOST} "${PATH_TO_SCRIPT}/run_testsuite_from_branch_name.sh $USER_NAME $BRANCH_NAME $BASE" - else + if [ "$i" -ne "0" ] ; then + echo "ssh ${HOST} ${PATH_TO_SCRIPT}/run_testsuite_from_branch_name.sh $USER_NAME $BRANCH_NAME $BASE y" ssh ${HOST} "${PATH_TO_SCRIPT}/run_testsuite_from_branch_name.sh $USER_NAME $BRANCH_NAME $BASE y" + else + echo "ssh ${HOST} ${PATH_TO_SCRIPT}/run_testsuite_from_branch_name.sh $USER_NAME $BRANCH_NAME $BASE y" + ssh ${HOST} "${PATH_TO_SCRIPT}/run_testsuite_from_branch_name.sh $USER_NAME $BRANCH_NAME $BASE" fi done - name: Post address diff --git a/Scripts/developer_scripts/autotest_cgal b/Scripts/developer_scripts/autotest_cgal index 619f9fea761..4ad3e7b8b1a 100755 --- a/Scripts/developer_scripts/autotest_cgal +++ b/Scripts/developer_scripts/autotest_cgal @@ -380,6 +380,8 @@ setup_dirs() CGAL_DIR=`readlink "${CGAL_ROOT}/CGAL-I"` CGAL_TEST_DIR=${CGAL_DIR}/test + CGAL_DATA_DIR=${CGAL_DIR}/data + export CGAL_DATA_DIR=$(echo "$CGAL_DATA_DIR" | sed -E 's/\/cygdrive\/([a-z])\//\U\1:\//') if [ ! -d "${CGAL_DIR}/cmake" ]; then mkdir "${CGAL_DIR}/cmake" @@ -619,28 +621,28 @@ LIST_TEST_PACKAGES='${LIST_TEST_PACKAGES}' CGAL_ROOT='${CGAL_ROOT}' rm -rf '${CGAL_BINARY_DIR}/test'; - if [ -f '${LIST_TEST_PACKAGES}' ]; then - mkdir '${CGAL_BINARY_DIR}/test' cp '${CGAL_TEST_DIR}/collect_cgal_testresults_from_cmake' '${CGAL_BINARY_DIR}/test' cp '${CGAL_TEST_DIR}/makefile2' '${CGAL_BINARY_DIR}/test' cp '${CGAL_TEST_DIR}/run_testsuite_with_cmake' '${CGAL_BINARY_DIR}/test' - # list all packages in CGAL_TEST_DIR. If PACKAGE is found in LIST_TEST_PACKAGES, - # copy it, else prepare for the special "skipped" case in the table. +# list all packages in CGAL_TEST_DIR. If PACKAGE is found in LIST_TEST_PACKAGES, +# copy it, else prepare for the special "skipped" case in the table. for PACKAGE in \$(ls "${CGAL_TEST_DIR}"); do if [ -d "${CGAL_TEST_DIR}/\$PACKAGE" ]; then if source '${LIST_TEST_PACKAGES}' '${CGAL_ROOT}' | egrep -q \$PACKAGE; then - mkdir "\${CGAL_BINARY_DIR}/test/\${PACKAGE}" + mkdir "${CGAL_BINARY_DIR}/test/\${PACKAGE}" + cp -r "${CGAL_TEST_DIR}/\${PACKAGE}" '${CGAL_BINARY_DIR}/test' + elif [ "\$PACKAGE" = "resources" ]; then + mkdir "${CGAL_BINARY_DIR}/test/\${PACKAGE}" cp -r "${CGAL_TEST_DIR}/\${PACKAGE}" '${CGAL_BINARY_DIR}/test' else mkdir "${CGAL_BINARY_DIR}/test/\${PACKAGE}" touch "${CGAL_BINARY_DIR}/test/\${PACKAGE}/skipped" fi fi - done else @@ -768,6 +770,7 @@ run_test_on_host() fi for PLATFORM in ${PLATFORMS}; do + run_test_on_host_and_platform "${HOST}" "${PLATFORM}" publish_results "${HOST}" "${PLATFORM}" done @@ -985,3 +988,4 @@ rm -f "$LOCK_FILE"; ## Local Variables: ## sh-basic-offset: 2 ## End: + diff --git a/Scripts/developer_scripts/run_testsuite_from_branch_name.sh b/Scripts/developer_scripts/run_testsuite_from_branch_name.sh index 99b59fc1fe6..a19a6ca4ee7 100644 --- a/Scripts/developer_scripts/run_testsuite_from_branch_name.sh +++ b/Scripts/developer_scripts/run_testsuite_from_branch_name.sh @@ -11,12 +11,13 @@ if uname | grep -q -i cygwin; then export SHELLOPTS set -o igncr fi -source "$(dirname $0)/.autofilterrc" +source ~/.autofilterrc +echo "CGAL_ROOT = $CGAL_ROOT" > log USER_REPO=$1 BRANCH_NAME=$2 BASE_NAME=$3 cd ${CGAL_ROOT} -scp mgimeno@cgal.geometryfactory.com:public_html/test_suite/VERSION_NUMBER . +scp ${VERSION_NUMBER_SSH_URL} . cd ${CGAL_GIT_DIR} if [ ! -d cgal ]; then git clone --depth 1 --no-single-branch https://github.com/CGAL/cgal.git @@ -44,6 +45,7 @@ fi ( #create the release from the branch echo " Create release..." +echo "CGAL_VERSION=0.0-Ic-$(cat ${CGAL_ROOT}/VERSION_NUMBER)"> log cmake -DGIT_REPO=${CGAL_GIT_DIR}/cgal -DDESTINATION=${CGAL_ROOT}/CGAL-TEST -DPUBLIC=OFF -DTESTSUITE=ON -DCGAL_VERSION=0.0-Ic-$(cat ${CGAL_ROOT}/VERSION_NUMBER) -P ${CGAL_GIT_DIR}/cgal/Scripts/developer_scripts/cgal_create_release_with_cmake.cmake | tee log echo "done." DEST=$(sed -E 's/.*CGAL-TEST\/(.*)/\1/' log); @@ -55,15 +57,16 @@ ln -s $PWD/CGAL-TEST/$DEST CGAL-I echo "starting testsuite..." ./autotest_cgal -c -)>${CGAL_ROOT}/autotest.log2 2>&1 & -echo "finished." + if [ -n "$4" ]; then cd ${CGAL_ROOT} V=$(cat VERSION_NUMBER) V=$(($V+1)) echo $V > VERSION_NUMBER - scp VERSION_NUMBER mgimeno@cgal.geometryfactory.com:public_html/test_suite/VERSION_NUMBER + scp VERSION_NUMBER ${VERSION_NUMBER_SSH_URL} fi +)>${CGAL_ROOT}/autotest.log2 2>&1 & +echo "finished." echo "exit." exit 0