.gitlab-ci.yml 1.5 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. - 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. tests_3.10:
  62. stage: test
  63. image: python:3.10-rc
  64. allow_failure: true
  65. only:
  66. - master
  67. <<: *python_test_definition
  68. bundle:
  69. stage: deploy
  70. image: alpine
  71. script:
  72. - mv webui/dist dist
  73. - rm -rf webui
  74. - mv dist webui
  75. artifacts:
  76. expire_in: 30 days
  77. paths:
  78. - settings.json
  79. - app.py
  80. - pycs/
  81. - webui/
  82. - labels
  83. - models