.gitlab-ci.yml 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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.7:
  45. stage: test
  46. image: python:3.7
  47. only:
  48. - master
  49. <<: *python_test_definition
  50. tests_3.8:
  51. stage: test
  52. image: python:3.8
  53. only:
  54. - master
  55. <<: *python_test_definition
  56. tests_3.9:
  57. stage: test
  58. image: python:3.9
  59. <<: *python_test_definition
  60. after_script:
  61. - source env/bin/activate
  62. - coverage report -m
  63. # tests_3.10:
  64. # stage: test
  65. # image: python:3.10
  66. # only:
  67. # - master
  68. # <<: *python_test_definition
  69. bundle:
  70. stage: deploy
  71. image: alpine
  72. script:
  73. - mv webui/dist dist
  74. - rm -rf webui
  75. - mv dist webui
  76. artifacts:
  77. expire_in: 30 days
  78. paths:
  79. - settings.json
  80. - app.py
  81. - pycs/
  82. - webui/
  83. - labels
  84. - models