From 855be3551a1372bcbebba6f8930903f99202bbca Mon Sep 17 00:00:00 2001 From: wyzula-jan Date: Tue, 28 May 2024 14:47:42 +0200 Subject: [PATCH] ci: added tests for pyside6, pyqt6 and pyqt5, default test and e2e is python 3.11 and pyqt6 --- .gitlab-ci.yml | 125 +++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 115 insertions(+), 10 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8fccc6ea..7a1c4982 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,7 +1,7 @@ # This file is a template, and might need editing before it works on your project. # Official language image. Look for the different tagged releases at: # https://hub.docker.com/r/library/python/tags/ -image: $CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX/python:3.10 +image: $CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX/python:3.11 #commands to run in the Docker container before starting each job. variables: DOCKER_TLS_CERTDIR: "" @@ -23,7 +23,6 @@ workflow: include: - template: Security/Secret-Detection.gitlab-ci.yml - # different stages in the pipeline stages: - Formatter @@ -65,7 +64,7 @@ pylint: - ./pylint/ expire_in: 1 week rules: - - if: $CI_PROJECT_PATH == "bec/bec_widgets" + - if: $CI_PROJECT_PATH == "bec/bec_widgets" pylint-check: stage: Formatter @@ -98,7 +97,7 @@ pylint-check: - ./pylint/ expire_in: 1 week rules: - - if: $CI_PROJECT_PATH == "bec/bec_widgets" + - if: $CI_PROJECT_PATH == "bec/bec_widgets" tests: stage: test @@ -124,17 +123,124 @@ tests: coverage_format: cobertura path: coverage.xml - -tests-3.11: +tests-3.10-pyside6: extends: "tests" stage: AdditionalTests - image: $CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX/python:3.11 + image: $CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX/python:3.10 + script: + - git clone --branch $BEC_CORE_BRANCH https://gitlab.psi.ch/bec/bec.git + - git clone --branch $OPHYD_DEVICES_BRANCH https://gitlab.psi.ch/bec/ophyd_devices.git + - export OHPYD_DEVICES_PATH=$PWD/ophyd_devices + - apt-get update + - apt-get install -y libgl1-mesa-glx libegl1-mesa x11-utils libxkbcommon-x11-0 libdbus-1-3 + - pip install -e ./bec/bec_lib[dev] + - pip install -e .[dev,pyside6] + - pytest -v --junitxml=report.xml --random-order ./tests/unit_tests allow_failure: true -tests-3.12: +tests-3.12-pyside6: extends: "tests" stage: AdditionalTests image: $CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX/python:3.12 + script: + - git clone --branch $BEC_CORE_BRANCH https://gitlab.psi.ch/bec/bec.git + - git clone --branch $OPHYD_DEVICES_BRANCH https://gitlab.psi.ch/bec/ophyd_devices.git + - export OHPYD_DEVICES_PATH=$PWD/ophyd_devices + - apt-get update + - apt-get install -y libgl1-mesa-glx libegl1-mesa x11-utils libxkbcommon-x11-0 libdbus-1-3 + - pip install -e ./bec/bec_lib[dev] + - pip install -e .[dev,pyside6] + - pytest -v --junitxml=report.xml --random-order ./tests/unit_tests + allow_failure: true + +tests-3.10-pyqt5: + extends: "tests" + stage: AdditionalTests + image: $CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX/python:3.10 + script: + - git clone --branch $BEC_CORE_BRANCH https://gitlab.psi.ch/bec/bec.git + - git clone --branch $OPHYD_DEVICES_BRANCH https://gitlab.psi.ch/bec/ophyd_devices.git + - export OHPYD_DEVICES_PATH=$PWD/ophyd_devices + - apt-get update + - apt-get install -y libgl1-mesa-glx libegl1-mesa x11-utils libxkbcommon-x11-0 libdbus-1-3 + - pip install -e ./bec/bec_lib[dev] + - pip install -e .[dev,pyqt5] + - pytest -v --junitxml=report.xml --random-order ./tests/unit_tests + allow_failure: true + +tests-3.11-pyqt5: + extends: "tests" + stage: AdditionalTests + image: $CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX/python:3.11 + script: + - git clone --branch $BEC_CORE_BRANCH https://gitlab.psi.ch/bec/bec.git + - git clone --branch $OPHYD_DEVICES_BRANCH https://gitlab.psi.ch/bec/ophyd_devices.git + - export OHPYD_DEVICES_PATH=$PWD/ophyd_devices + - apt-get update + - apt-get install -y libgl1-mesa-glx libegl1-mesa x11-utils libxkbcommon-x11-0 libdbus-1-3 + - pip install -e ./bec/bec_lib[dev] + - pip install -e .[dev,pyqt5] + - pytest -v --junitxml=report.xml --random-order ./tests/unit_tests + allow_failure: true + +tests-3.12-pyqt5: + extends: "tests" + stage: AdditionalTests + image: $CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX/python:3.12 + script: + - git clone --branch $BEC_CORE_BRANCH https://gitlab.psi.ch/bec/bec.git + - git clone --branch $OPHYD_DEVICES_BRANCH https://gitlab.psi.ch/bec/ophyd_devices.git + - export OHPYD_DEVICES_PATH=$PWD/ophyd_devices + - apt-get update + - apt-get install -y libgl1-mesa-glx libegl1-mesa x11-utils libxkbcommon-x11-0 libdbus-1-3 + - pip install -e ./bec/bec_lib[dev] + - pip install -e .[dev,pyqt5] + - pytest -v --junitxml=report.xml --random-order ./tests/unit_tests + allow_failure: true + +tests-3.10-pyqt6: + extends: "tests" + stage: AdditionalTests + image: $CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX/python:3.10 + script: + - git clone --branch $BEC_CORE_BRANCH https://gitlab.psi.ch/bec/bec.git + - git clone --branch $OPHYD_DEVICES_BRANCH https://gitlab.psi.ch/bec/ophyd_devices.git + - export OHPYD_DEVICES_PATH=$PWD/ophyd_devices + - apt-get update + - apt-get install -y libgl1-mesa-glx libegl1-mesa x11-utils libxkbcommon-x11-0 libdbus-1-3 + - pip install -e ./bec/bec_lib[dev] + - pip install -e .[dev,pyqt6] + - pytest -v --junitxml=report.xml --random-order ./tests/unit_tests + allow_failure: true + +tests-3.11-pyqt6: + extends: "tests" + stage: AdditionalTests + image: $CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX/python:3.11 + script: + - git clone --branch $BEC_CORE_BRANCH https://gitlab.psi.ch/bec/bec.git + - git clone --branch $OPHYD_DEVICES_BRANCH https://gitlab.psi.ch/bec/ophyd_devices.git + - export OHPYD_DEVICES_PATH=$PWD/ophyd_devices + - apt-get update + - apt-get install -y libgl1-mesa-glx libegl1-mesa x11-utils libxkbcommon-x11-0 libdbus-1-3 + - pip install -e ./bec/bec_lib[dev] + - pip install -e .[dev,pyqt6] + - pytest -v --junitxml=report.xml --random-order ./tests/unit_tests + allow_failure: true + +tests-3.12-pyqt6: + extends: "tests" + stage: AdditionalTests + image: $CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX/python:3.12 + script: + - git clone --branch $BEC_CORE_BRANCH https://gitlab.psi.ch/bec/bec.git + - git clone --branch $OPHYD_DEVICES_BRANCH https://gitlab.psi.ch/bec/ophyd_devices.git + - export OHPYD_DEVICES_PATH=$PWD/ophyd_devices + - apt-get update + - apt-get install -y libgl1-mesa-glx libegl1-mesa x11-utils libxkbcommon-x11-0 libdbus-1-3 + - pip install -e ./bec/bec_lib[dev] + - pip install -e .[dev,pyqt6] + - pytest -v --junitxml=report.xml --random-order ./tests/unit_tests allow_failure: true end-2-end-conda: @@ -150,7 +256,7 @@ end-2-end-conda: - conda config --prepend channels conda-forge - conda config --set channel_priority strict - conda config --set always_yes yes --set changeps1 no - - conda create -q -n test-environment python=3.10 + - conda create -q -n test-environment python=3.11 - conda init bash - source ~/.bashrc - conda activate test-environment @@ -183,7 +289,6 @@ end-2-end-conda: - if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "main"' - if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "production"' - semver: stage: Deploy needs: ["tests"]