.gitlab-ci.yml 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  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. only:
  24. - master
  25. variables:
  26. PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
  27. cache:
  28. key: "$CI_JOB_NAME"
  29. paths:
  30. - .cache/pip
  31. - env/
  32. before_script:
  33. - python -V
  34. - python -m venv env
  35. - source env/bin/activate
  36. - pip install coverage pylint
  37. script:
  38. - coverage run --source=pycs/ -m unittest discover test/
  39. - pylint pycs --fail-under=5
  40. tests_3.7:
  41. stage: test
  42. image: python:3.7
  43. only:
  44. - master
  45. variables:
  46. PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
  47. cache:
  48. key: "$CI_JOB_NAME"
  49. paths:
  50. - .cache/pip
  51. - env/
  52. before_script:
  53. - python -V
  54. - python -m venv env
  55. - source env/bin/activate
  56. - pip install coverage pylint
  57. script:
  58. - coverage run --source=pycs/ -m unittest discover test/
  59. - pylint pycs --fail-under=5
  60. tests_3.8:
  61. stage: test
  62. image: python:3.8
  63. only:
  64. - master
  65. variables:
  66. PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
  67. cache:
  68. key: "$CI_JOB_NAME"
  69. paths:
  70. - .cache/pip
  71. - env/
  72. before_script:
  73. - python -V
  74. - python -m venv env
  75. - source env/bin/activate
  76. - pip install coverage pylint
  77. script:
  78. - coverage run --source=pycs/ -m unittest discover test/
  79. - pylint pycs --fail-under=5
  80. tests_3.9:
  81. stage: test
  82. image: python:3.9
  83. variables:
  84. PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
  85. cache:
  86. key: "$CI_JOB_NAME"
  87. paths:
  88. - .cache/pip
  89. - env/
  90. before_script:
  91. - python -V
  92. - python -m venv env
  93. - source env/bin/activate
  94. - pip install coverage pylint
  95. script:
  96. - coverage run --source=pycs/ -m unittest discover test/
  97. - coverage report -m
  98. - pylint pycs --fail-under=5
  99. tests_3.10:
  100. stage: test
  101. image: python:3.10-rc
  102. allow_failure: true
  103. only:
  104. - master
  105. variables:
  106. PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
  107. cache:
  108. key: "$CI_JOB_NAME"
  109. paths:
  110. - .cache/pip
  111. - env/
  112. before_script:
  113. - python -V
  114. - python -m venv env
  115. - source env/bin/activate
  116. - pip install coverage pylint
  117. script:
  118. - coverage run --source=pycs/ -m unittest discover test/
  119. - pylint pycs --fail-under=5
  120. bundle:
  121. stage: deploy
  122. image: alpine
  123. script:
  124. - mv webui/dist dist
  125. - rm -rf webui
  126. - mv dist webui
  127. artifacts:
  128. expire_in: 30 days
  129. paths:
  130. - settings.json
  131. - app.py
  132. - pycs/
  133. - webui/