Add rgignore #595
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Ansible Test | |
on: | |
push: | |
schedule: | |
- cron: 0 0 * * 0 # weekly | |
jobs: | |
ansible-test: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: | |
- ubuntu-22.04 | |
fail-fast: false | |
env: | |
ASDF_DATA_DIR: /tmp/dotfiles-ansible-test/.asdf/ | |
PLAYBOOK: ./ansible/ansible-test.yml | |
TARGET_DIRECTORY: /tmp/dotfiles-ansible-test/ | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install other dependencies | |
run: | | |
pip install ansible-core | |
ansible-galaxy collection install ansible.posix community.general | |
- name: Prepare Ansible test | |
run: mkdir "${TARGET_DIRECTORY}" | |
- name: Run Ansible playbook | |
run: ansible-playbook --extra-vars "target_directory=${TARGET_DIRECTORY}" "${PLAYBOOK}" | |
- name: Run Ansible playbook again | |
run: ansible-playbook --extra-vars "target_directory=${TARGET_DIRECTORY}" "${PLAYBOOK}" | tee ansible_result | |
- name: Check Ansible idempotency | |
run: | | |
if grep --quiet 'changed=0.*failed=0' ansible_result | |
then | |
echo 'Idempotence test: pass' | |
exit 0 | |
else | |
echo 'Idempotence test: fail' | |
exit 1 | |
fi |