1
0

.gitlab-ci.yml 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. ---
  2. stages:
  3. - lint
  4. - test
  5. include:
  6. - local: 'cicd/kitchen_template.yml'
  7. - local: 'cicd/kitchen_testruns.yml'
  8. # pre-commit-run-all:
  9. # image:
  10. # name: registry.gitlab.com/saltstack/pop/cicd/containers/ubuntu1804:latest
  11. # entrypoint: [""]
  12. # stage: lint
  13. # variables:
  14. # PRE_COMMIT_HOME: "${CI_PROJECT_DIR}/pre-commit-cache"
  15. # only:
  16. # refs:
  17. # - merge_requests
  18. # cache:
  19. # key: pre-commit-cache
  20. # paths:
  21. # - pre-commit-cache/
  22. # script:
  23. # - pip3 install pre-commit
  24. # - pre-commit run -a -v --color always
  25. lint-salt-full:
  26. image: registry.gitlab.com/saltstack/pop/cicd/containers/ubuntu1804:latest
  27. stage: lint
  28. tags:
  29. - saltstack-internal
  30. cache:
  31. key: nox-lint-cache
  32. paths:
  33. - .nox
  34. only:
  35. refs:
  36. - schedules
  37. script:
  38. - python --version
  39. - pip3 install -U nox-py2==2019.6.25
  40. - nox --version
  41. - nox --install-only -e lint-salt
  42. - EC=254
  43. - export PYLINT_REPORT=pylint-report-salt-full.log
  44. - nox -e lint-salt
  45. - EC=$?
  46. - exit $EC
  47. lint-tests-full:
  48. image: registry.gitlab.com/saltstack/pop/cicd/containers/ubuntu1804:latest
  49. stage: lint
  50. tags:
  51. - saltstack-internal
  52. cache:
  53. key: nox-lint-cache
  54. paths:
  55. - .nox
  56. only:
  57. refs:
  58. - schedules
  59. script:
  60. - python --version
  61. - pip3 install -U nox-py2==2019.6.25
  62. - nox --version
  63. - nox --install-only -e lint-tests
  64. - EC=254
  65. - export PYLINT_REPORT=pylint-report-tests-full.log
  66. - nox -e lint-tests
  67. - EC=$?
  68. - exit $EC
  69. docs-build-html:
  70. image: registry.gitlab.com/saltstack/pop/cicd/containers/ubuntu1804:latest
  71. stage: test
  72. tags:
  73. - saltstack-internal
  74. cache:
  75. key: nox-docs-cache
  76. paths:
  77. - .nox
  78. only:
  79. refs:
  80. - schedules
  81. script:
  82. - python --version
  83. - pip install -U nox-py2==2019.6.25
  84. - nox --version
  85. - nox -e 'docs-html(compress=True)'
  86. docs-build-man-pages:
  87. image: registry.gitlab.com/saltstack/pop/cicd/containers/ubuntu1804:latest
  88. stage: test
  89. tags:
  90. - saltstack-internal
  91. cache:
  92. key: nox-docs-cache
  93. paths:
  94. - .nox
  95. only:
  96. refs:
  97. - schedules
  98. script:
  99. - python --version
  100. - pip install -U nox-py2==2019.6.25
  101. - nox --version
  102. - nox -e 'docs-man(compress=True, update=False)'
  103. scan:
  104. stage: test
  105. image: shiftleft/sast-scan
  106. script:
  107. - scan --src ${CI_PROJECT_DIR} --type python --out_dir ${CI_PROJECT_DIR}/reports
  108. artifacts:
  109. name: "$CI_JOB_NAME-$CI_COMMIT_REF_NAME"
  110. paths:
  111. - $CI_PROJECT_DIR/reports/
  112. when: always