From 0e4609093bfca2731bcd6d7c56e71f6216b71b8a Mon Sep 17 00:00:00 2001 From: florian <f.spreckelsen@inidscale.com> Date: Tue, 7 Nov 2023 16:56:23 +0100 Subject: [PATCH] TST: Use Pylib in correct branch --- .gitlab-ci.yml | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d2abdcd6..0eb08796 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -91,6 +91,21 @@ build-testenv: - docker build -t $CI_REGISTRY_IMAGE_BASE . - docker push $CI_REGISTRY_IMAGE_BASE + # Determine pylib branch name + - if [ -z "$PYLIB" ]; then + if echo "$CI_COMMIT_REF_NAME" | grep -c "^f-" ; then + echo "Check if pylib has branch $CI_COMMIT_REF_NAME" ; + if wget https://gitlab.indiscale.com/api/v4/projects/97/repository/branches/${CI_COMMIT_REF_NAME} ; then + PYLIB=$CI_COMMIT_REF_NAME ; + fi; + fi; + fi; + - PYLIB=${PYLIB:-dev} + - echo $PYLIB + - echo $PYLIB > setup.env + artifacts: + reports: + dotenv: setup.env cert: tags: [docker] @@ -138,9 +153,11 @@ unittest_py37: tags: [docker] stage: unittest image: python:3.7 + needs: [build-testenv] script: &python_test_script + - echo $PYLIB - pip install nose pandas pytest pytest-cov gitignore-parser openpyxl>=3.0.7 xlrd==1.2 h5py - - pip install git+https://gitlab.indiscale.com/caosdb/src/caosdb-pylib.git@dev + - pip install git+https://gitlab.indiscale.com/caosdb/src/caosdb-pylib.git@$PYLIB - pip install . - pytest --cov=caosadvancedtools unittests @@ -148,18 +165,21 @@ unittest_py38: tags: [docker] stage: unittest image: python:3.8 + needs: [build-testenv] script: *python_test_script unittest_py310: tags: [docker] stage: unittest image: python:3.10 + needs: [build-testenv] script: *python_test_script unittest_py311: tags: [docker] stage: unittest image: python:3.11 + needs: [build-testenv] script: *python_test_script # Build the sphinx documentation and make it ready for deployment by Gitlab Pages -- GitLab