.gitlab-ci.yml 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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.7:
  40. stage: test
  41. image: python:3.7
  42. only:
  43. - master
  44. <<: *python_test_definition
  45. tests_3.8:
  46. stage: test
  47. image: python:3.8
  48. only:
  49. - master
  50. <<: *python_test_definition
  51. tests_3.9:
  52. stage: test
  53. image: python:3.9
  54. <<: *python_test_definition
  55. # tests_3.10:
  56. # stage: test
  57. # image: python:3.10
  58. # only:
  59. # - master
  60. # <<: *python_test_definition
  61. bundle:
  62. stage: deploy
  63. image: alpine
  64. script:
  65. - mv webui/dist dist
  66. - rm -rf webui
  67. - mv dist webui
  68. artifacts:
  69. expire_in: 30 days
  70. paths:
  71. - settings.json
  72. - app.py
  73. - pycs/
  74. - webui/
  75. - labels
  76. - models