chore(ci): run backward compatibility tests in ci

This commit is contained in:
Nicolas Sarlin
2024-06-05 15:11:43 +02:00
committed by Nicolas Sarlin
parent 8ea70aa00b
commit 4d3dc990ee
4 changed files with 53 additions and 0 deletions

View File

@@ -55,6 +55,10 @@ jobs:
with:
toolchain: stable
- name: Install git-lfs
run: |
sudo apt update && sudo apt -y install git-lfs
- name: Run concrete-csprng tests
run: |
make test_concrete_csprng
@@ -107,6 +111,17 @@ jobs:
run: |
make test_safe_deserialization
- name: Clone test data
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633
with:
repository: zama-ai/tfhe-backward-compat-data
path: tfhe/tfhe-backward-compat-data
lfs: 'true'
- name: Run backward compatibility tests
run: |
make test_backward_compatibility_ci
- name: Slack Notification
if: ${{ always() }}
continue-on-error: true

3
.gitignore vendored
View File

@@ -22,3 +22,6 @@ dieharder_run.log
# Cuda local build
backends/tfhe-cuda-backend/cuda/cmake-build-debug/
# Dir used for backward compatibility test data
tfhe/tfhe-backward-compat-data/

View File

@@ -19,6 +19,8 @@ FAST_BENCH?=FALSE
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_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
# p indicates to print, so we keep only the start of the Cargo.toml until we hit the first version
@@ -658,6 +660,14 @@ test_versionable: install_rs_build_toolchain
RUSTFLAGS="$(RUSTFLAGS)" cargo $(CARGO_RS_BUILD_TOOLCHAIN) test --profile $(CARGO_PROFILE) \
-p tfhe-versionable
.PHONY: test_backward_compatibility_ci
test_backward_compatibility_ci: install_rs_build_toolchain
TFHE_BACKWARD_COMPAT_DATA_DIR="$(BACKWARD_COMPAT_DATA_DIR)" RUSTFLAGS="$(RUSTFLAGS)" cargo $(CARGO_RS_BUILD_TOOLCHAIN) test --profile $(CARGO_PROFILE) \
--features=$(TARGET_ARCH_FEATURE),shortint -p $(TFHE_SPEC) test_backward_compatibility -- --nocapture
.PHONY: test_backward_compatibility # Same as test_backward_compatibility_ci but tries to clone the data repo first if needed
test_backward_compatibility: tfhe/$(BACKWARD_COMPAT_DATA_DIR) test_backward_compatibility_ci
.PHONY: doc # Build rust doc
doc: install_rs_check_toolchain
@# Even though we are not in docs.rs, this allows to "just" build the doc
@@ -934,6 +944,12 @@ write_params_to_file: install_rs_check_toolchain
--example write_params_to_file \
--features=$(TARGET_ARCH_FEATURE),boolean,shortint,internal-keycache
.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)
tfhe/$(BACKWARD_COMPAT_DATA_DIR): clone_backward_compat_data
#
# Real use case examples
#

View File

@@ -0,0 +1,19 @@
#!/usr/bin/env bash
set -e
if [ $# -lt 2 ]; then
echo "$0 git_url dest_path"
exit 1
fi
if ! git lfs env 2>/dev/null >/dev/null; then
echo "git lfs is not installed, please install it and try again"
exit 1
fi
if [ -d $2 ]; then
cd $2 && git pull
else
git clone $1 $2
fi