6
0

.gitlab-ci.yml 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. stages:
  2. - build
  3. - test
  4. - deploy
  5. webui:
  6. stage: build
  7. image: node:14
  8. cache:
  9. paths:
  10. - webui/node_modules/
  11. before_script:
  12. - cd webui/
  13. - npm install
  14. script:
  15. - npm run build
  16. artifacts:
  17. expire_in: 1 day
  18. paths:
  19. - webui/dist/
  20. .python_test_template: &python_test_definition
  21. variables:
  22. PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
  23. cache:
  24. key: "$CI_JOB_NAME"
  25. paths:
  26. - .cache/pip
  27. - env/
  28. before_script:
  29. - python -V
  30. - python -m venv env
  31. - source env/bin/activate
  32. - pip install -r requirements.txt
  33. - pip install coverage pylint
  34. script:
  35. - coverage run --source=pycs/ -m unittest discover test/
  36. - "pylint --fail-under=9.5
  37. --disable=duplicate-code
  38. --disable=missing-module-docstring
  39. --disable=too-many-instance-attributes
  40. --extension-pkg-whitelist=cv2
  41. --module-rgx='^[A-Za-z0-9]+$' --class-rgx='^[A-Za-z0-9]+$'
  42. app.py pycs"
  43. tests_3.6:
  44. stage: test
  45. image: python:3.6
  46. only:
  47. - master
  48. <<: *python_test_definition
  49. tests_3.7:
  50. stage: test
  51. image: python:3.7
  52. only:
  53. - master
  54. <<: *python_test_definition
  55. tests_3.8:
  56. stage: test
  57. image: python:3.8
  58. only:
  59. - master
  60. <<: *python_test_definition
  61. tests_3.9:
  62. stage: test
  63. image: python:3.9
  64. <<: *python_test_definition
  65. after_script:
  66. - source env/bin/activate
  67. - coverage report -m
  68. tests_3.10:
  69. stage: test
  70. image: python:3.10-rc
  71. allow_failure: true
  72. only:
  73. - master
  74. <<: *python_test_definition
  75. bundle:
  76. stage: deploy
  77. image: alpine
  78. script:
  79. - mv webui/dist dist
  80. - rm -rf webui
  81. - mv dist webui
  82. artifacts:
  83. expire_in: 30 days
  84. paths:
  85. - settings.json
  86. - app.py
  87. - pycs/
  88. - webui/
  89. - labels
  90. - models