From 3e053e15dca2eb2622ec4cb86fcd0e564c2a32d0 Mon Sep 17 00:00:00 2001 From: Michael Levy Date: Wed, 14 Aug 2024 16:11:57 -0600 Subject: [PATCH] Inputdata used to rely on svn hooks to github Updated some scripts to use git sparse checkout instead, also scripts exit when error occurs instead of happily continuing beyond errors --- .github/workflows/run_test_suite.yml | 1 + reg_tests/common/check_inputdata.sh | 17 ++++++++++++----- reg_tests/common/setup_inputdata.sh | 9 +++++++++ reg_tests/tidal-Simmons/Simmons-test.sh | 2 +- 4 files changed, 23 insertions(+), 6 deletions(-) create mode 100755 reg_tests/common/setup_inputdata.sh diff --git a/.github/workflows/run_test_suite.yml b/.github/workflows/run_test_suite.yml index c77797238..edf626197 100644 --- a/.github/workflows/run_test_suite.yml +++ b/.github/workflows/run_test_suite.yml @@ -18,6 +18,7 @@ jobs: sudo apt install make gfortran netcdf-bin libnetcdf-dev libnetcdff-dev openmpi-bin libopenmpi-dev - name: Run Test Suite run: | + ./reg_tests/common/setup_inputdata.sh cd bld ./cvmix_setup gfortran $(dirname $(dirname $(which nc-config))) cd ../CVMix_tools diff --git a/reg_tests/common/check_inputdata.sh b/reg_tests/common/check_inputdata.sh index 44a972d7f..807a17254 100644 --- a/reg_tests/common/check_inputdata.sh +++ b/reg_tests/common/check_inputdata.sh @@ -1,17 +1,24 @@ -#!/bin/bash +#!/bin/bash -e check_inputdata () { DATA_REPO=https://github.com/CVMix/CVMix-data/trunk/ + cd ${INPUTDATA_DIR} + ALL_FOUND=TRUE for file in "$@"; do echo "Looking for $file..." - if [ -e ${INPUTDATA_DIR}/$file ]; then + if [ -e $file ]; then echo "Found!" else - svn export ${DATA_REPO}/$file ${INPUTDATA_DIR}/$file - echo "... Downloaded!" + echo "${file}" >> .git/info/sparse-checkout + ALL_FOUND=FALSE + echo "... added to sparse-checkout!" fi done -} + if [ "${ALL_FOUND}" == "FALSE" ]; then + git checkout master + fi + +} \ No newline at end of file diff --git a/reg_tests/common/setup_inputdata.sh b/reg_tests/common/setup_inputdata.sh new file mode 100755 index 000000000..8f8ad2981 --- /dev/null +++ b/reg_tests/common/setup_inputdata.sh @@ -0,0 +1,9 @@ +#!/bin/bash -e +# Since github dropped support for svn hooks, now need to set up +# a sparse checkout to get inputdata. +# NOTE: this script must be run from ${CVMIX_ROOT}! + +cd inputdata +git init +git config core.sparseCheckout true +git remote add -f CVMix-data https://github.com/CVMix/CVMix-data.git \ No newline at end of file diff --git a/reg_tests/tidal-Simmons/Simmons-test.sh b/reg_tests/tidal-Simmons/Simmons-test.sh index e6848aa2a..3c4f9355f 100755 --- a/reg_tests/tidal-Simmons/Simmons-test.sh +++ b/reg_tests/tidal-Simmons/Simmons-test.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -e # (1) Load required routines . ../common/environ.sh