.gitlab-ci.yml 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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 numpy opencv-python Pillow scipy
  33. - pip install eventlet flask python-socketio
  34. - pip install coverage pylint
  35. script:
  36. - coverage run --source=pycs/ -m unittest discover test/
  37. - "pylint --fail-under=9.5
  38. --disable=duplicate-code
  39. --disable=missing-module-docstring
  40. --disable=too-many-instance-attributes
  41. --extension-pkg-whitelist=cv2
  42. --module-rgx='^[A-Za-z0-9]+$' --class-rgx='^[A-Za-z0-9]+$'
  43. app.py pycs"
  44. tests_3.6:
  45. stage: test
  46. image: python:3.6
  47. only:
  48. - master
  49. <<: *python_test_definition
  50. tests_3.7:
  51. stage: test
  52. image: python:3.7
  53. only:
  54. - master
  55. <<: *python_test_definition
  56. tests_3.8:
  57. stage: test
  58. image: python:3.8
  59. only:
  60. - master
  61. <<: *python_test_definition
  62. tests_3.9:
  63. stage: test
  64. image: python:3.9
  65. <<: *python_test_definition
  66. after_script:
  67. - source env/bin/activate
  68. - coverage report -m
  69. tests_3.10:
  70. stage: test
  71. image: python:3.10-rc
  72. allow_failure: true
  73. only:
  74. - master
  75. <<: *python_test_definition
  76. bundle:
  77. stage: deploy
  78. image: alpine
  79. script:
  80. - mv webui/dist dist
  81. - rm -rf webui
  82. - mv dist webui
  83. artifacts:
  84. expire_in: 30 days
  85. paths:
  86. - settings.json
  87. - app.py
  88. - pycs/
  89. - webui/
  90. - labels
  91. - models