Skip to content

Commit

Permalink
Inputdata used to rely on svn hooks to github
Browse files Browse the repository at this point in the history
Updated some scripts to use git sparse checkout instead, also scripts exit when
error occurs instead of happily continuing beyond errors
  • Loading branch information
mnlevy1981 committed Aug 14, 2024
1 parent 13c72ce commit 3e053e1
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 6 deletions.
1 change: 1 addition & 0 deletions .github/workflows/run_test_suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
17 changes: 12 additions & 5 deletions reg_tests/common/check_inputdata.sh
Original file line number Diff line number Diff line change
@@ -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

}
9 changes: 9 additions & 0 deletions reg_tests/common/setup_inputdata.sh
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion reg_tests/tidal-Simmons/Simmons-test.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/bash -e

# (1) Load required routines
. ../common/environ.sh
Expand Down

0 comments on commit 3e053e1

Please sign in to comment.