diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 28a5ae02ff76f86deef121ff4ddbba9e55fdbbb7..a386d1928980dedd60a361ed4cc53f04a77a329d 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -3,6 +3,7 @@ image: python:3.7-stretch
 stages:
     - style
     - tests
+    - pypi_test
 
 before_script:
     - pip install -U pip setuptools
@@ -12,9 +13,16 @@ tests:
     script:
         - tox -r -vv -e py37
     stage: tests
+    allow_failure: true
 
 style:
     script:
         - tox -r -vv -e flake8
     allow_failure: true
     stage: style
+
+pypi_test:
+    script:
+        - python setup.py sdist
+        - twine upload -u openbis-team -p 4z2-3oZ-rFK-YNh --repository-url https://test.pypi.org/legacy/ dist/*
+    when: manual