fix: minor configuration updates #4092
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: Test Ansible collections, roles, playbooks | |
on: # yamllint disable-line rule:truthy | |
push: | |
paths: | |
- ".github/workflows/test-ansible.yaml" | |
- "config/ansible/**" | |
- "docker/ansible/**" | |
- "scripts/common.sh" | |
- "scripts/run-ansible.sh" | |
# Don't test playbooks when editing these files because we have dedicated tests | |
- "!config/ansible/roles/ferrarimarco_home_lab_node/files/config/dependency-updates-helper/Dockerfile" | |
- "!config/ansible/roles/ferrarimarco_home_lab_node/files/config/monitoring-ont/requirements.txt" | |
- "!config/ansible/roles/ferrarimarco_home_lab_node/files/config/restic/Dockerfile" | |
- "!config/ansible/roles/ferrarimarco_home_lab_node/files/config/sense-hat-exporter/requirements.txt" | |
pull_request: | |
paths: | |
- ".github/workflows/test-ansible.yaml" | |
- "config/ansible/**" | |
- "docker/ansible/**" | |
- "scripts/common.sh" | |
- "scripts/run-ansible.sh" | |
# Don't test playbooks when editing these files because we have dedicated tests | |
- "!config/ansible/roles/ferrarimarco_home_lab_node/files/config/dependency-updates-helper/Dockerfile" | |
- "!config/ansible/roles/ferrarimarco_home_lab_node/files/config/monitoring-ont/requirements.txt" | |
- "!config/ansible/roles/ferrarimarco_home_lab_node/files/config/restic/Dockerfile" | |
- "!config/ansible/roles/ferrarimarco_home_lab_node/files/config/sense-hat-exporter/requirements.txt" | |
permissions: | |
contents: read | |
jobs: | |
test-ansible: | |
concurrency: | |
# Ref: https://docs.github.com/en/actions/learn-github-actions/contexts#github-context | |
# github.head_ref: head_ref or source branch of the pull request | |
# github.ref: ref of the branch that triggered the workflow | |
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}-${{ github.event_name }}-${{ matrix.test_container_image_id }}-${{ matrix.test_playbook_name }} | |
cancel-in-progress: true | |
env: | |
ANSIBLE_TEST_CONTAINER_IMAGE_ID: "${{ github.repository }}-ansible" | |
steps: | |
- name: Free Disk Space (Ubuntu) | |
uses: jlumbroso/free-disk-space@v1.3.1 | |
with: | |
# This might remove tools that are actually needed, | |
# if set to "true" but frees about 6 GB | |
tool-cache: false | |
android: true | |
dotnet: true | |
haskell: true | |
large-packages: true | |
docker-images: true | |
swap-storage: false | |
- uses: actions/checkout@v4 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Run molecule | |
run: | | |
set -o errexit | |
set -o nounset | |
ANSIBLE_TEST_DISTRO=${{ matrix.test_container_image_id }} | |
export ANSIBLE_TEST_DISTRO | |
ANSIBLE_TEST_PLAYBOOK_NAME=${{ matrix.test_playbook_name }} | |
export ANSIBLE_TEST_PLAYBOOK_NAME | |
scripts/run-ansible.sh "molecule test" | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
test_container_image_id: | |
- "geerlingguy/docker-debian11-ansible:latest" | |
- "geerlingguy/docker-debian12-ansible:latest" | |
test_playbook_name: | |
- boot-bare-metal | |
- bootstrap | |
- container-engine | |
- coral | |
- home-lab-node | |
- proxmox-node | |
- main |