6
0

.gitlab-ci.yml 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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. - apt-get update
  33. - apt-get install -y libgl1-mesa-glx
  34. - pip install -r requirements.txt
  35. - pip install -r requirements.dev.txt
  36. script:
  37. - make run_coverage
  38. - make run_pylint
  39. tests_3.6:
  40. stage: test
  41. image: python:3.6
  42. only:
  43. - master
  44. <<: *python_test_definition
  45. tests_3.7:
  46. stage: test
  47. image: python:3.7
  48. only:
  49. - master
  50. <<: *python_test_definition
  51. tests_3.8:
  52. stage: test
  53. image: python:3.8
  54. only:
  55. - master
  56. <<: *python_test_definition
  57. tests_3.9:
  58. stage: test
  59. image: python:3.9
  60. <<: *python_test_definition
  61. after_script:
  62. - source env/bin/activate
  63. - coverage report -m
  64. tests_3.10:
  65. stage: test
  66. image: python:3.10-rc
  67. allow_failure: true
  68. only:
  69. - master
  70. <<: *python_test_definition
  71. bundle:
  72. stage: deploy
  73. image: alpine
  74. script:
  75. - mv webui/dist dist
  76. - rm -rf webui
  77. - mv dist webui
  78. artifacts:
  79. expire_in: 30 days
  80. paths:
  81. - settings.json
  82. - app.py
  83. - pycs/
  84. - webui/
  85. - labels
  86. - models