You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

114 lines
3.1 KiB

  1. ---
  2. yamllint:
  3. extends: .job
  4. stage: unit-tests
  5. tags: [light]
  6. variables:
  7. LANG: C.UTF-8
  8. script:
  9. - yamllint --strict .
  10. except: ['triggers', 'master']
  11. vagrant-validate:
  12. extends: .job
  13. stage: unit-tests
  14. tags: [light]
  15. variables:
  16. VAGRANT_VERSION: 2.3.4
  17. script:
  18. - ./tests/scripts/vagrant-validate.sh
  19. except: ['triggers', 'master']
  20. ansible-lint:
  21. extends: .job
  22. stage: unit-tests
  23. tags: [light]
  24. script:
  25. - ansible-lint -v
  26. except: ['triggers', 'master']
  27. syntax-check:
  28. extends: .job
  29. stage: unit-tests
  30. tags: [light]
  31. variables:
  32. ANSIBLE_INVENTORY: inventory/local-tests.cfg
  33. ANSIBLE_REMOTE_USER: root
  34. ANSIBLE_BECOME: "true"
  35. ANSIBLE_BECOME_USER: root
  36. ANSIBLE_VERBOSITY: "3"
  37. script:
  38. - ansible-playbook --syntax-check cluster.yml
  39. - ansible-playbook --syntax-check playbooks/cluster.yml
  40. - ansible-playbook --syntax-check upgrade-cluster.yml
  41. - ansible-playbook --syntax-check playbooks/upgrade-cluster.yml
  42. - ansible-playbook --syntax-check reset.yml
  43. - ansible-playbook --syntax-check playbooks/reset.yml
  44. - ansible-playbook --syntax-check extra_playbooks/upgrade-only-k8s.yml
  45. except: ['triggers', 'master']
  46. collection-build-install-sanity-check:
  47. extends: .job
  48. stage: unit-tests
  49. tags: [light]
  50. variables:
  51. ANSIBLE_COLLECTIONS_PATH: "./ansible_collections"
  52. script:
  53. - ansible-galaxy collection build
  54. - ansible-galaxy collection install kubernetes_sigs-kubespray-$(grep "^version:" galaxy.yml | awk '{print $2}').tar.gz
  55. - ansible-galaxy collection list $(egrep -i '(name:\s+|namespace:\s+)' galaxy.yml | awk '{print $2}' | tr '\n' '.' | sed 's|\.$||g') | grep "^kubernetes_sigs.kubespray"
  56. - test -f ansible_collections/kubernetes_sigs/kubespray/playbooks/cluster.yml
  57. - test -f ansible_collections/kubernetes_sigs/kubespray/playbooks/reset.yml
  58. except: ['triggers', 'master']
  59. tox-inventory-builder:
  60. stage: unit-tests
  61. tags: [light]
  62. extends: .job
  63. before_script:
  64. - ./tests/scripts/rebase.sh
  65. - apt-get update && apt-get install -y python3-pip
  66. - update-alternatives --install /usr/bin/python python /usr/bin/python3 10
  67. - python -m pip uninstall -y ansible ansible-base ansible-core
  68. - python -m pip install -r tests/requirements.txt
  69. script:
  70. - pip3 install tox
  71. - cd contrib/inventory_builder && tox
  72. except: ['triggers', 'master']
  73. markdownlint:
  74. stage: unit-tests
  75. tags: [light]
  76. image: node
  77. before_script:
  78. - npm install -g markdownlint-cli@0.22.0
  79. script:
  80. - markdownlint $(find . -name '*.md' | grep -vF './.git') --ignore docs/_sidebar.md --ignore contrib/dind/README.md
  81. check-readme-versions:
  82. stage: unit-tests
  83. tags: [light]
  84. image: python:3
  85. script:
  86. - tests/scripts/check_readme_versions.sh
  87. check-galaxy-version:
  88. stage: unit-tests
  89. tags: [light]
  90. image: python:3
  91. script:
  92. - tests/scripts/check_galaxy_version.sh
  93. check-typo:
  94. stage: unit-tests
  95. tags: [light]
  96. image: python:3
  97. script:
  98. - tests/scripts/check_typo.sh
  99. ci-matrix:
  100. stage: unit-tests
  101. tags: [light]
  102. image: python:3
  103. script:
  104. - tests/scripts/md-table/test.sh