From d92c7cadcc4764e35b23a8ed4fe93a21ef9f9ae2 Mon Sep 17 00:00:00 2001 From: Klaus Wakonig Date: Wed, 28 Jun 2023 13:16:43 +0200 Subject: [PATCH 1/4] ci: added additional tests for other python versions --- .gitlab-ci.yml | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d0c4f6f..8a6abc6 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: morgana-harbor.psi.ch/bec/python:3.8 +image: $CI_DOCKER_REGISTRY/python:3.8 #commands to run in the Docker container before starting each job. before_script: @@ -11,6 +11,7 @@ before_script: stages: - Formatter - Test + - AdditionalTests - Deploy formatter: @@ -24,4 +25,22 @@ pytest: script: - pytest -v --random-order ./tests +tests-3.9: + stage: AdditionalTests + image: $CI_DOCKER_REGISTRY/python:3.9 + needs: ["pytest"] + script: + - pytest -v --random-order ./tests + allow_failure: true +tests-3.10: + extends: "tests-3.9" + stage: AdditionalTests + image: $CI_DOCKER_REGISTRY/python:3.10 + allow_failure: true + +tests-3.11: + extends: "tests-3.9" + stage: AdditionalTests + image: $CI_DOCKER_REGISTRY/python:3.11 + allow_failure: true From c5931a4010d49fc3770311433f111f2ae7cc94c2 Mon Sep 17 00:00:00 2001 From: Klaus Wakonig Date: Wed, 28 Jun 2023 13:31:44 +0200 Subject: [PATCH 2/4] refactor: prep for semver --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 52eee07..e9c4273 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,6 @@ from setuptools import setup -__version__ = "0.0.1" +__version__ = "0.0.0" if __name__ == "__main__": setup( From daa5d9e822eaec6afb5817348db65d9a2ac1ead9 Mon Sep 17 00:00:00 2001 From: Klaus Wakonig Date: Wed, 28 Jun 2023 13:35:05 +0200 Subject: [PATCH 3/4] ci: added semver --- .gitlab-ci.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8a6abc6..316d615 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -44,3 +44,31 @@ tests-3.11: stage: AdditionalTests image: $CI_DOCKER_REGISTRY/python:3.11 allow_failure: true + +semver: + stage: Deploy + needs: ["tests"] + script: + - git config --global user.name "ci_update_bot" + - git config --global user.email "ci_update_bot@bec.ch" + - git checkout "$CI_COMMIT_REF_NAME" + - git reset --hard origin/"$CI_COMMIT_REF_NAME" + + # delete all local tags + - git tag -l | xargs git tag -d + - git fetch --tags + - git tag + + # build + - pip install python-semantic-release wheel + - export GL_TOKEN=$CI_UPDATES + - export REPOSITORY_USERNAME=__token__ + - export REPOSITORY_PASSWORD=$CI_PYPI_TOKEN + - > + semantic-release publish -v DEBUG + -D version_variable=./setup.py:__version__ + -D hvcs=gitlab + + allow_failure: false + rules: + - if: '$CI_COMMIT_REF_NAME == "master"' From 2b0ee223bb4ed50036554875862f0f166cce1eb9 Mon Sep 17 00:00:00 2001 From: wakonig_k Date: Wed, 28 Jun 2023 11:37:08 +0000 Subject: [PATCH 4/4] ci: fixed typo --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 316d615..75e4ca1 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -47,7 +47,7 @@ tests-3.11: semver: stage: Deploy - needs: ["tests"] + needs: ["pytest"] script: - git config --global user.name "ci_update_bot" - git config --global user.email "ci_update_bot@bec.ch"