From e70178d3c4a21ba748296d6615456c55fb0d8eda Mon Sep 17 00:00:00 2001
From: thibault allenet <thibault.allenet@cea.fr>
Date: Tue, 28 May 2024 12:17:02 +0000
Subject: [PATCH] Add wheel testing in the CI for python packages

---
 .gitlab/ci/release/pip.gitlab-ci.yml | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/.gitlab/ci/release/pip.gitlab-ci.yml b/.gitlab/ci/release/pip.gitlab-ci.yml
index 2421921..21afe34 100644
--- a/.gitlab/ci/release/pip.gitlab-ci.yml
+++ b/.gitlab/ci/release/pip.gitlab-ci.yml
@@ -17,3 +17,25 @@ release:pip:ubuntu:
     - python --version
     - python -m pip wheel -w wheelhouse .
     - set +x
+
+  after_script: 
+    - >
+    for DEP_NAME in "${DEPS_NAMES[@]}"; do
+      	echo "current dep $DEP_NAME"
+        cd $DEP_NAME
+        pip install . -v
+        cd ..
+      done
+    - export WHL_NAME=$(find . -name "$CI_PROJECT_NAME*.whl")
+    - pip install wheelhouse/$WHL_NAME
+    - cd ..
+    ############################################################################
+    # In order to perform the test on the installed package, not on the source code, change the repo name with mv 
+    # https://stackoverflow.com/questions/56908227/how-to-test-python-wheels-on-ci
+    ############################################################################
+    - mv $CI_PROJECT_NAME src
+    - ls src
+    - cd src/$CI_PROJECT_NAME/unit_tests
+    - export PATH_TEST=$(pwd)
+    - cd ../../../..
+    - pytest $PATH_TEST
-- 
GitLab