6
0

.gitlab-ci.yml 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  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. tests_3.6:
  21. stage: test
  22. image: python:3.6
  23. variables:
  24. PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
  25. cache:
  26. key: "$CI_JOB_NAME"
  27. paths:
  28. - .cache/pip
  29. - env/
  30. before_script:
  31. - python -V
  32. - python -m venv env
  33. - source env/bin/activate
  34. - pip install coverage
  35. script:
  36. - coverage run --source=pycs/ -m unittest discover test/
  37. tests_3.7:
  38. stage: test
  39. image: python:3.7
  40. variables:
  41. PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
  42. cache:
  43. key: "$CI_JOB_NAME"
  44. paths:
  45. - .cache/pip
  46. - env/
  47. before_script:
  48. - python -V
  49. - python -m venv env
  50. - source env/bin/activate
  51. - pip install coverage
  52. script:
  53. - coverage run --source=pycs/ -m unittest discover test/
  54. tests_3.8:
  55. stage: test
  56. image: python:3.8
  57. variables:
  58. PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
  59. cache:
  60. key: "$CI_JOB_NAME"
  61. paths:
  62. - .cache/pip
  63. - env/
  64. before_script:
  65. - python -V
  66. - python -m venv env
  67. - source env/bin/activate
  68. - pip install coverage
  69. script:
  70. - coverage run --source=pycs/ -m unittest discover test/
  71. tests_3.9:
  72. stage: test
  73. image: python:3.9
  74. variables:
  75. PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
  76. cache:
  77. key: "$CI_JOB_NAME"
  78. paths:
  79. - .cache/pip
  80. - env/
  81. before_script:
  82. - python -V
  83. - python -m venv env
  84. - source env/bin/activate
  85. - pip install coverage
  86. script:
  87. - coverage run --source=pycs/ -m unittest discover test/
  88. - coverage report -m
  89. bundle:
  90. stage: deploy
  91. image: alpine
  92. script:
  93. - mv webui/dist dist
  94. - rm -rf webui
  95. - mv dist webui
  96. artifacts:
  97. expire_in: 30 days
  98. paths:
  99. - settings.json
  100. - app.py
  101. - pycs/
  102. - webui/