.gitlab-ci.yml 1.82 KB
Newer Older
Matt Clarkson's avatar
Matt Clarkson committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
#Tell Gitlab to load these environental vars from the variables list
variables:
  PYPI_USER: SECURE
  PYPI_PASS: SECURE

stages:
  - build
  - installer
  - test
  - deploy


build docs:
  stage: build
  script:
    - tox -e docs
  tags:
    - shared-linux
  artifacts:
    paths:
    - doc/
    expire_in: 1 week


build linux installer:
  stage: build
  script:
    - tox -e installer
  tags:
    - shared-linux
  artifacts:
    paths:
    - dist/
    expire_in: 1 week


build mac installer:
  stage: build
  script:
    - tox -e installer
  tags:
    - shared-mac
  artifacts:
    paths:
    - dist/
    expire_in: 1 week


build windows installer:
  stage: build
  script:
    - tox -e installer
  tags:
    - shared-win
  artifacts:
    paths:
    - dist/
    expire_in: 1 week


test Linux:
  stage: test
63 64
  variables:
    LD_LIBRARY_PATH: ${CI_PROJECT_DIR}/.tox/py36/lib/python3.6/site-packages/PySide2/Qt/plugins/platforms
65
    DISPLAY: localhost:1
Matt Clarkson's avatar
Matt Clarkson committed
66
  script:
67 68
      - echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}"
      - echo "DISPLAY=${DISPLAY}"
Matt Clarkson's avatar
Matt Clarkson committed
69 70
      - tox
  tags:
71
    - shared-linux, gui
Matt Clarkson's avatar
Matt Clarkson committed
72 73 74 75 76 77 78 79
  coverage: '/^TOTAL.*\s+(\d+\%)$/'


test macOS:
  stage: test
  script:
      - tox
  tags:
80
    - shared-mac, gui
Matt Clarkson's avatar
Matt Clarkson committed
81 82 83 84 85 86 87


test Windows:
  stage: test
  script:
      - tox
  tags:
88
    - shared-win, gui
Matt Clarkson's avatar
Matt Clarkson committed
89 90 91 92 93 94 95 96 97 98

deploy pip to PyPI:

  stage: deploy
  when: manual
  only:
    - tags
    
  environment:
    name: PyPI
99
    url: https://pypi.python.org/pypi/scikit-surgeryutils
Matt Clarkson's avatar
Matt Clarkson committed
100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118
    
  tags:
    - pip-production
    
  artifacts:
    paths:
    - dist/
    
  script:
    # Install packages required to build/publish
    # remove any previous distribution files
    - pip install wheel twine setuptools
    - rm -rf dist

    # bundle installer
    - python setup.py bdist_wheel

    # Upload to pypi
    - twine upload --repository pypi dist/* --username $PYPI_USER --password $PYPI_PASS