From 2a91fab6815fc5a4c37bf6222e550930f81d1f3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20de=20Wit?= Date: Mon, 15 Jan 2024 20:21:20 +0100 Subject: [PATCH] Test for idempotency --- .github/workflows/test.yaml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .github/workflows/test.yaml diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 0000000..a1c9bfa --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,19 @@ +name: Test install +on: push +jobs: + install: + name: Install + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Install Ansible + run: pip install ansible + - name: First run + run: ansible-playbook -i "localhost," -c local test.yml --extra-vars "ansible_python_interpreter=auto nvm_install_path=~/.nvmbis" + - name: Second run + run: > + ansible-playbook -i "localhost," -c local test.yml --extra-vars "ansible_python_interpreter=auto nvm_install_path=~/.nvmbis" + | grep -q 'changed=0.*failed=0' + && (echo 'Idempotence test: pass' && exit 0) + || (echo 'Idempotence test: fail' && exit 1)