From 83d51dd733e283dd8aa62074eeb112175728db8b Mon Sep 17 00:00:00 2001 From: Bertrand Lanson Date: Sun, 18 Jun 2023 22:01:46 +0200 Subject: [PATCH] ci-tests --- .gitlab-ci.yml | 82 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..1769576 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,82 @@ +--- +stages: + - verify + - test-default + - test-with-ssh-keys + +image: + name: registry.ednz.fr/forge/ansible-runner + +variables: + ANSIBLE_HOST_KEY_CHECKING: 'false' + ANSIBLE_FORCE_COLOR: 'true' + ANSIBLE_PYTHON_INTERPRETER: /usr/bin/python3 + DOCKER_AUTH_CONFIG: $CI_DOCKER_AUTH_CONFIG + +.stage-test-default: + stage: test-default + +.stage-test-with-ssh-keys: + stage: test-with-ssh-keys + +.variables-ubuntu-2004: + variables: + MOLECULE_TEST_OS: "ubuntu2004" + +.variables-ubuntu-2204: + variables: + MOLECULE_TEST_OS: "ubuntu2204" + +.variables-debian-11: + variables: + MOLECULE_TEST_OS: "debian11" + +.script-molecule-test-default: + script: + - molecule test + +.script-molecule-test-with-ssh-keys: + script: + - molecule test -s with_ssh_keys + +ansible-verify: + stage: verify + script: + - yamllint . -c .yamllint + - ansible-lint + +ansible-test-ubuntu-2004-default: + extends: + - .stage-test-default + - .variables-ubuntu-2004 + - .script-molecule-test-default + +ansible-test-ubuntu-2204-default: + extends: + - .stage-test-default + - .variables-ubuntu-2204 + - .script-molecule-test-default + +ansible-test-debian-11-default: + extends: + - .stage-test-default + - .variables-debian-11 + - .script-molecule-test-default + +ansible-test-ubuntu-2004-with-ssh-keys: + extends: + - .stage-test-with-ssh-keys + - .variables-ubuntu-2004 + - .script-molecule-test-with-ssh-keys + +ansible-test-ubuntu-2204-with-ssh-keys: + extends: + - .stage-test-with-ssh-keys + - .variables-ubuntu-2204 + - .script-molecule-test-with-ssh-keys + +ansible-test-debian-11-with-ssh-keys: + extends: + - .stage-test-with-ssh-keys + - .variables-debian-11 + - .script-molecule-test-with-ssh-keys