Skip to content

Commit

Permalink
chore(backward): use shallow clone for backward compat tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nsarlin-zama committed Jun 28, 2024
1 parent 2dc5c8a commit ef390b7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ BENCH_OP_FLAVOR?=DEFAULT
NODE_VERSION=20
FORWARD_COMPAT?=OFF
BACKWARD_COMPAT_DATA_URL=https://github.com/zama-ai/tfhe-backward-compat-data.git
BACKWARD_COMPAT_DATA_BRANCH=v0.1
BACKWARD_COMPAT_DATA_DIR=tfhe-backward-compat-data
# sed: -n, do not print input stream, -e means a script/expression
# 1,/version/ indicates from the first line, to the line matching version at the start of the line
Expand Down Expand Up @@ -1016,7 +1017,7 @@ write_params_to_file: install_rs_check_toolchain

.PHONY: clone_backward_compat_data # Clone the data repo needed for backward compatibility tests
clone_backward_compat_data:
./scripts/clone_backward_compat_data.sh $(BACKWARD_COMPAT_DATA_URL) tfhe/$(BACKWARD_COMPAT_DATA_DIR)
./scripts/clone_backward_compat_data.sh $(BACKWARD_COMPAT_DATA_URL) $(BACKWARD_COMPAT_DATA_BRANCH) tfhe/$(BACKWARD_COMPAT_DATA_DIR)

tfhe/$(BACKWARD_COMPAT_DATA_DIR): clone_backward_compat_data

Expand Down
9 changes: 5 additions & 4 deletions scripts/clone_backward_compat_data.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

set -e

if [ $# -lt 2 ]; then
echo "$0 git_url dest_path"
if [ $# -lt 3 ]; then
echo "$0 git_url branch dest_path"
exit 1
fi

Expand All @@ -13,7 +13,8 @@ if ! git lfs env 2>/dev/null >/dev/null; then
fi

if [ -d $2 ]; then
cd $2 && git pull
cd $2 && git fetch --depth 1 && git reset --hard origin/$2 && git clean -dfx

else
git clone $1 $2
git clone $1 -b $2 --depth 1
fi

0 comments on commit ef390b7

Please sign in to comment.