.gitlab-ci.yml 2.4 KB

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