.gitlab-ci.yml 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. # This file is a template, and might need editing before it works on your project.
  2. # To contribute improvements to CI/CD templates, please follow the Development guide at:
  3. # https://docs.gitlab.com/ee/development/cicd/templates.html
  4. # This specific template is located at:
  5. # https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Python.gitlab-ci.yml
  6. # Official language image. Look for the different tagged releases at:
  7. # https://hub.docker.com/r/library/python/tags/
  8. image: python:latest
  9. # Change pip's cache directory to be inside the project directory since we can
  10. # only cache local items.
  11. variables:
  12. PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
  13. # Pip's cache doesn't store the python packages
  14. # https://pip.pypa.io/en/stable/topics/caching/
  15. #
  16. # If you want to also cache the installed packages, you have to install
  17. # them in a virtualenv and cache it as well.
  18. cache:
  19. paths:
  20. - .cache/pip
  21. - venv/
  22. before_script:
  23. - python --version # For debugging
  24. - pip install virtualenv
  25. - virtualenv venv
  26. - source venv/bin/activate
  27. test:
  28. script:
  29. - pip install pytest
  30. - pytest -v --pyargs src/ll_sdk
  31. run:
  32. script:
  33. # - python setup.py bdist_wheel
  34. # an alternative approach is to install and run:
  35. #- pip install dist/*
  36. - pip install build twine
  37. - python -m build
  38. # run the command here
  39. - TWINE_PASSWORD=${CI_JOB_TOKEN} TWINE_USERNAME=gitlab-ci-token python -m twine upload --verbose --repository-url ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/pypi dist/*
  40. artifacts:
  41. paths:
  42. - dist/*.whl
  43. #pages:
  44. # script:
  45. # - pip install sphinx sphinx-rtd-theme
  46. # - cd doc
  47. # - make html
  48. # - mv build/html/ ../public/
  49. # artifacts:
  50. # paths:
  51. # - public
  52. # rules:
  53. # - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH