.gitlab-ci.yml 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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 -r requirements.dev.txt
  34. script:
  35. - make run_coverage
  36. - make run_pylint
  37. tests_3.6:
  38. stage: test
  39. image: python:3.6
  40. only:
  41. - master
  42. <<: *python_test_definition
  43. tests_3.7:
  44. stage: test
  45. image: python:3.7
  46. only:
  47. - master
  48. <<: *python_test_definition
  49. tests_3.8:
  50. stage: test
  51. image: python:3.8
  52. only:
  53. - master
  54. <<: *python_test_definition
  55. tests_3.9:
  56. stage: test
  57. image: python:3.9
  58. <<: *python_test_definition
  59. after_script:
  60. - source env/bin/activate
  61. - coverage report -m
  62. tests_3.10:
  63. stage: test
  64. image: python:3.10-rc
  65. allow_failure: true
  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