diff --git a/.github/workflows/podman_container_copy.yml b/.github/workflows/podman_container_copy.yml index f783bc4..f2cd91c 100644 --- a/.github/workflows/podman_container_copy.yml +++ b/.github/workflows/podman_container_copy.yml @@ -4,6 +4,7 @@ on: push: paths: - '.github/workflows/podman_container_copy.yml' + - '.github/workflows/reusable-module-test.yml' - 'ci/*.yml' - 'ci/run_containers_tests.sh' - 'ci/playbooks/containers/podman_container_copy.yml' @@ -14,6 +15,7 @@ on: pull_request: paths: - '.github/workflows/podman_container_copy.yml' + - '.github/workflows/reusable-module-test.yml' - 'ci/*.yml' - 'ci/run_containers_tests.sh' - 'ci/playbooks/containers/podman_container_copy.yml' @@ -23,76 +25,8 @@ on: - cron: 4 0 * * * # Run daily at 0:03 UTC jobs: - test_podman_container_copy: - name: Podman Container Copy ${{ matrix.ansible-version }}-${{ matrix.os || 'ubuntu-22.04' }} - runs-on: ${{ matrix.os || 'ubuntu-22.04' }} - defaults: - run: - shell: bash - strategy: - fail-fast: false - matrix: - ansible-version: - - git+https://github.com/ansible/ansible.git@stable-2.18 - - git+https://github.com/ansible/ansible.git@devel - os: - - ubuntu-22.04 - python-version: - - "3.12" - - steps: - - - name: Check out repository - uses: actions/checkout@v4 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - - name: Upgrade pip and display Python and PIP versions - run: | - sudo apt-get update - sudo apt-get install -y python*-wheel python*-yaml - python -m pip install --upgrade pip - python -V - pip --version - - name: Set up pip cache - uses: actions/cache@v4 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ github.ref }}-units-VMs - restore-keys: | - ${{ runner.os }}-pip- - ${{ runner.os }}- - - name: Install Ansible ${{ matrix.ansible-version }} - run: python3 -m pip install --user --force-reinstall --upgrade '${{ matrix.ansible-version }}' - - - name: Build and install the collection tarball - run: | - rm -rf /tmp/just_new_collection - ~/.local/bin/ansible-galaxy collection build --output-path /tmp/just_new_collection --force - ~/.local/bin/ansible-galaxy collection install -vvv --force /tmp/just_new_collection/*.tar.gz - - name: Run collection tests for Podman Container Copy module - run: | - export PATH=~/.local/bin:$PATH - echo "Run ansible version" - command -v ansible - ansible --version - export ANSIBLE_CONFIG=$(pwd)/ci/ansible-dev.cfg - if [[ '${{ matrix.ansible-version }}' == 'ansible<2.10' ]]; then - export ANSIBLE_CONFIG=$(pwd)/ci/ansible-2.9.cfg - fi - echo $ANSIBLE_CONFIG - command -v ansible-playbook - pip --version - python --version - ansible-playbook --version - ansible-playbook -vv ci/playbooks/pre.yml \ - -e host=localhost \ - -i localhost, \ - -e ansible_connection=local \ - -e setup_python=false - TEST2RUN=podman_container_copy ./ci/run_containers_tests.sh - shell: bash + uses: ./.github/workflows/reusable-module-test.yml + with: + module_name: 'podman_container_copy' + display_name: 'Podman Container Copy module' diff --git a/.github/workflows/podman_container_exec.yml b/.github/workflows/podman_container_exec.yml index 9446c90..0f951ee 100644 --- a/.github/workflows/podman_container_exec.yml +++ b/.github/workflows/podman_container_exec.yml @@ -4,6 +4,7 @@ on: push: paths: - '.github/workflows/podman_container_exec.yml' + - '.github/workflows/reusable-module-test.yml' - 'ci/*.yml' - 'ci/run_containers_tests.sh' - 'ci/playbooks/containers/podman_container_exec.yml' @@ -14,6 +15,7 @@ on: pull_request: paths: - '.github/workflows/podman_container_exec.yml' + - '.github/workflows/reusable-module-test.yml' - 'ci/*.yml' - 'ci/run_containers_tests.sh' - 'ci/playbooks/containers/podman_container_exec.yml' @@ -23,76 +25,8 @@ on: - cron: 4 0 * * * # Run daily at 0:03 UTC jobs: - test_podman_container_exec: - name: Podman container exec ${{ matrix.ansible-version }}-${{ matrix.os || 'ubuntu-22.04' }} - runs-on: ${{ matrix.os || 'ubuntu-22.04' }} - defaults: - run: - shell: bash - strategy: - fail-fast: false - matrix: - ansible-version: - - git+https://github.com/ansible/ansible.git@stable-2.18 - - git+https://github.com/ansible/ansible.git@devel - os: - - ubuntu-22.04 - python-version: - - "3.12" - - steps: - - - name: Check out repository - uses: actions/checkout@v4 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - - name: Upgrade pip and display Python and PIP versions - run: | - sudo apt-get update - sudo apt-get install -y python*-wheel python*-yaml - python -m pip install --upgrade pip - python -V - pip --version - - name: Set up pip cache - uses: actions/cache@v4 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ github.ref }}-units-VMs - restore-keys: | - ${{ runner.os }}-pip- - ${{ runner.os }}- - - name: Install Ansible ${{ matrix.ansible-version }} - run: python3 -m pip install --user --force-reinstall --upgrade '${{ matrix.ansible-version }}' - - - name: Build and install the collection tarball - run: | - rm -rf /tmp/just_new_collection - ~/.local/bin/ansible-galaxy collection build --output-path /tmp/just_new_collection --force - ~/.local/bin/ansible-galaxy collection install -vvv --force /tmp/just_new_collection/*.tar.gz - - name: Run collection tests for Podman container exec - run: | - export PATH=~/.local/bin:$PATH - echo "Run ansible version" - command -v ansible - ansible --version - export ANSIBLE_CONFIG=$(pwd)/ci/ansible-dev.cfg - if [[ '${{ matrix.ansible-version }}' == 'ansible<2.10' ]]; then - export ANSIBLE_CONFIG=$(pwd)/ci/ansible-2.9.cfg - fi - echo $ANSIBLE_CONFIG - command -v ansible-playbook - pip --version - python --version - ansible-playbook --version - ansible-playbook -vv ci/playbooks/pre.yml \ - -e host=localhost \ - -i localhost, \ - -e ansible_connection=local \ - -e setup_python=false - TEST2RUN=podman_container_exec ./ci/run_containers_tests.sh - shell: bash + uses: ./.github/workflows/reusable-module-test.yml + with: + module_name: 'podman_container_exec' + display_name: 'Podman container exec' diff --git a/.github/workflows/podman_container_idem.yml b/.github/workflows/podman_container_idem.yml index 928e278..ebc8095 100644 --- a/.github/workflows/podman_container_idem.yml +++ b/.github/workflows/podman_container_idem.yml @@ -27,94 +27,8 @@ on: - cron: 4 0 * * * # Run daily at 0:03 UTC jobs: - test_podman_container_idem: - name: Podman container ${{ matrix.ansible-version }}-${{ matrix.os || 'ubuntu-22.04' }} - runs-on: ${{ matrix.os || 'ubuntu-22.04' }} - defaults: - run: - shell: bash - strategy: - fail-fast: false - matrix: - ansible-version: - # - ansible<2.10 - - git+https://github.com/ansible/ansible.git@stable-2.18 - - git+https://github.com/ansible/ansible.git@devel - os: - - ubuntu-22.04 - python-version: - - "3.12" - - steps: - - - name: Check out repository - uses: actions/checkout@v4 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - - name: Upgrade pip and display Python and PIP versions - run: | - sudo apt-get update - sudo apt-get install -y python*-wheel python*-yaml - python -m pip install --upgrade pip - python -V - pip --version - - - name: Set up pip cache - uses: actions/cache@v4 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ github.ref }}-units-VMs - restore-keys: | - ${{ runner.os }}-pip- - ${{ runner.os }}- - - - name: Install Ansible ${{ matrix.ansible-version }} - run: | - python3 -m pip install --user --force-reinstall --upgrade '${{ matrix.ansible-version }}' - - - name: Build and install the collection tarball - run: | - rm -rf /tmp/just_new_collection - ~/.local/bin/ansible-galaxy collection build --output-path /tmp/just_new_collection --force - ~/.local/bin/ansible-galaxy collection install -vvv --force /tmp/just_new_collection/*.tar.gz - - - name: Run preparing tests for podman container - run: | - export PATH=~/.local/bin:$PATH - - echo "Run ansible version" - command -v ansible - ansible --version - - export ANSIBLE_CONFIG=$(pwd)/ci/ansible-dev.cfg - if [[ '${{ matrix.ansible-version }}' == 'ansible<2.10' ]]; then - export ANSIBLE_CONFIG=$(pwd)/ci/ansible-2.9.cfg - fi - - echo $ANSIBLE_CONFIG - command -v ansible-playbook - pip --version - python --version - ansible-playbook --version - - ansible-playbook -vv ci/playbooks/pre.yml \ - -e host=localhost \ - -i localhost, \ - -e ansible_connection=local \ - -e setup_python=false - shell: bash - - - name: Run idempotency tests for podman container - run: | - export PATH=~/.local/bin:$PATH - export ANSIBLE_CONFIG=$(pwd)/ci/ansible-dev.cfg - if [[ '${{ matrix.ansible-version }}' == 'ansible<2.10' ]]; then - export ANSIBLE_CONFIG=$(pwd)/ci/ansible-2.9.cfg - fi - TEST2RUN=podman_container_idempotency ./ci/run_containers_tests.sh - shell: bash + uses: ./.github/workflows/reusable-module-test.yml + with: + module_name: 'podman_container_idempotency' + display_name: 'Idempotency' diff --git a/.github/workflows/podman_container_info.yml b/.github/workflows/podman_container_info.yml index d14f1b0..9083c37 100644 --- a/.github/workflows/podman_container_info.yml +++ b/.github/workflows/podman_container_info.yml @@ -4,6 +4,7 @@ on: push: paths: - '.github/workflows/podman_container_info.yml' + - '.github/workflows/reusable-module-test.yml' - 'ci/*.yml' - 'ci/run_containers_tests.sh' - 'ci/playbooks/containers/podman_container_info.yml' @@ -17,6 +18,7 @@ on: pull_request: paths: - '.github/workflows/podman_container_info.yml' + - '.github/workflows/reusable-module-test.yml' - 'ci/*.yml' - 'ci/run_containers_tests.sh' - 'ci/playbooks/containers/podman_container_info.yml' @@ -29,84 +31,8 @@ on: - cron: 4 0 * * * # Run daily at 0:03 UTC jobs: - test_podman_container_info: - name: Podman container info ${{ matrix.ansible-version }}-${{ matrix.os || 'ubuntu-22.04' }} - runs-on: ${{ matrix.os || 'ubuntu-22.04' }} - defaults: - run: - shell: bash - strategy: - fail-fast: false - matrix: - ansible-version: - - git+https://github.com/ansible/ansible.git@stable-2.18 - - git+https://github.com/ansible/ansible.git@devel - os: - - ubuntu-22.04 - python-version: - - "3.12" - - steps: - - - name: Check out repository - uses: actions/checkout@v4 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - - name: Upgrade pip and display Python and PIP versions - run: | - sudo apt-get update - sudo apt-get install -y python*-wheel python*-yaml - python -m pip install --upgrade pip - python -V - pip --version - - - name: Set up pip cache - uses: actions/cache@v4 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ github.ref }}-units-VMs - restore-keys: | - ${{ runner.os }}-pip- - ${{ runner.os }}- - - - name: Install Ansible ${{ matrix.ansible-version }} - run: python3 -m pip install --user --force-reinstall --upgrade '${{ matrix.ansible-version }}' - - - name: Build and install the collection tarball - run: | - rm -rf /tmp/just_new_collection - ~/.local/bin/ansible-galaxy collection build --output-path /tmp/just_new_collection --force - ~/.local/bin/ansible-galaxy collection install -vvv --force /tmp/just_new_collection/*.tar.gz - - - name: Run collection tests for podman container info - run: | - export PATH=~/.local/bin:$PATH - - echo "Run ansible version" - command -v ansible - ansible --version - - export ANSIBLE_CONFIG=$(pwd)/ci/ansible-dev.cfg - if [[ '${{ matrix.ansible-version }}' == 'ansible<2.10' ]]; then - export ANSIBLE_CONFIG=$(pwd)/ci/ansible-2.9.cfg - fi - - echo $ANSIBLE_CONFIG - command -v ansible-playbook - pip --version - python --version - ansible-playbook --version - - ansible-playbook -vv ci/playbooks/pre.yml \ - -e host=localhost \ - -i localhost, \ - -e ansible_connection=local \ - -e setup_python=false - - TEST2RUN=podman_container_info ./ci/run_containers_tests.sh - shell: bash + uses: ./.github/workflows/reusable-module-test.yml + with: + module_name: 'podman_container_info' + display_name: 'Podman container info' diff --git a/.github/workflows/podman_containers.yml b/.github/workflows/podman_containers.yml index c9804fb..204fcda 100644 --- a/.github/workflows/podman_containers.yml +++ b/.github/workflows/podman_containers.yml @@ -4,6 +4,7 @@ on: push: paths: - '.github/workflows/podman_containers.yml' + - '.github/workflows/reusable-module-test.yml' - 'ci/*.yml' - 'ci/run_containers_tests.sh' - 'ci/playbooks/containers/podman_containers.yml' @@ -17,9 +18,10 @@ on: pull_request: paths: - '.github/workflows/podman_containers.yml' + - '.github/workflows/reusable-module-test.yml' - 'ci/*.yml' - 'ci/run_containers_tests.sh' - - 'ci/playbooks/containers/podman_container.yml' + - 'ci/playbooks/containers/podman_containers.yml' - 'plugins/modules/podman_container.py' - 'plugins/module_utils/podman/podman_container_lib.py' - 'plugins/module_utils/podman/common.py' @@ -29,85 +31,8 @@ on: - cron: 4 0 * * * # Run daily at 0:03 UTC jobs: - test_podman_containers: - name: Podman multi containers ${{ matrix.ansible-version }}-${{ matrix.os || 'ubuntu-22.04' }} - runs-on: ${{ matrix.os || 'ubuntu-22.04' }} - defaults: - run: - shell: bash - strategy: - fail-fast: false - matrix: - ansible-version: - - git+https://github.com/ansible/ansible.git@stable-2.18 - - git+https://github.com/ansible/ansible.git@devel - os: - - ubuntu-22.04 - python-version: - - "3.12" - - steps: - - - name: Check out repository - uses: actions/checkout@v4 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - - name: Upgrade pip and display Python and PIP versions - run: | - sudo apt-get update - sudo apt-get install -y python*-wheel python*-yaml - python -m pip install --upgrade pip - python -V - pip --version - - - name: Set up pip cache - uses: actions/cache@v4 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ github.ref }}-units-VMs - restore-keys: | - ${{ runner.os }}-pip- - ${{ runner.os }}- - - - name: Install Ansible ${{ matrix.ansible-version }} - run: python3 -m pip install --user --force-reinstall --upgrade '${{ matrix.ansible-version }}' - - - name: Build and install the collection tarball - run: | - export PATH=~/.local/bin:$PATH - - echo "Run ansible version" - command -v ansible - ansible --version - rm -rf /tmp/just_new_collection - ~/.local/bin/ansible-galaxy collection build --output-path /tmp/just_new_collection --force - ~/.local/bin/ansible-galaxy collection install -vvv --force /tmp/just_new_collection/*.tar.gz - - - name: Run collection tests for podman containers - run: | - export PATH=~/.local/bin:$PATH - - export ANSIBLE_CONFIG=$(pwd)/ci/ansible-dev.cfg - if [[ '${{ matrix.ansible-version }}' == 'ansible<2.10' ]]; then - export ANSIBLE_CONFIG=$(pwd)/ci/ansible-2.9.cfg - fi - - echo $ANSIBLE_CONFIG - command -v ansible-playbook - pip --version - python --version - ansible-playbook --version - - ansible-playbook -vv ci/playbooks/pre.yml \ - -e host=localhost \ - -i localhost, \ - -e ansible_connection=local \ - -e setup_python=false - - TEST2RUN=podman_containers ./ci/run_containers_tests.sh - shell: bash + uses: ./.github/workflows/reusable-module-test.yml + with: + module_name: 'podman_containers' + display_name: 'Podman multi-containers' diff --git a/.github/workflows/podman_export.yml b/.github/workflows/podman_export.yml index dd785f4..7ae916a 100644 --- a/.github/workflows/podman_export.yml +++ b/.github/workflows/podman_export.yml @@ -4,6 +4,7 @@ on: push: paths: - '.github/workflows/podman_export.yml' + - '.github/workflows/reusable-module-test.yml' - 'ci/*.yml' - 'ci/run_containers_tests.sh' - 'ci/playbooks/containers/podman_export.yml' @@ -14,6 +15,7 @@ on: pull_request: paths: - '.github/workflows/podman_export.yml' + - '.github/workflows/reusable-module-test.yml' - 'ci/*.yml' - 'ci/run_containers_tests.sh' - 'ci/playbooks/containers/podman_export.yml' @@ -23,84 +25,8 @@ on: - cron: 4 0 * * * # Run daily at 0:03 UTC jobs: - test_podman_export: - name: Podman export ${{ matrix.ansible-version }}-${{ matrix.os || 'ubuntu-22.04' }} - runs-on: ${{ matrix.os || 'ubuntu-22.04' }} - defaults: - run: - shell: bash - strategy: - fail-fast: false - matrix: - ansible-version: - - git+https://github.com/ansible/ansible.git@stable-2.18 - - git+https://github.com/ansible/ansible.git@devel - os: - - ubuntu-22.04 - python-version: - - "3.12" - - steps: - - - name: Check out repository - uses: actions/checkout@v4 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - - name: Upgrade pip and display Python and PIP versions - run: | - sudo apt-get update - sudo apt-get install -y python*-wheel python*-yaml - python -m pip install --upgrade pip - python -V - pip --version - - - name: Set up pip cache - uses: actions/cache@v4 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ github.ref }}-units-VMs - restore-keys: | - ${{ runner.os }}-pip- - ${{ runner.os }}- - - - name: Install Ansible ${{ matrix.ansible-version }} - run: python3 -m pip install --user --force-reinstall --upgrade '${{ matrix.ansible-version }}' - - - name: Build and install the collection tarball - run: | - rm -rf /tmp/just_new_collection - ~/.local/bin/ansible-galaxy collection build --output-path /tmp/just_new_collection --force - ~/.local/bin/ansible-galaxy collection install -vvv --force /tmp/just_new_collection/*.tar.gz - - - name: Run collection tests for podman export - run: | - export PATH=~/.local/bin:$PATH - - echo "Run ansible version" - command -v ansible - ansible --version - - export ANSIBLE_CONFIG=$(pwd)/ci/ansible-dev.cfg - if [[ '${{ matrix.ansible-version }}' == 'ansible<2.10' ]]; then - export ANSIBLE_CONFIG=$(pwd)/ci/ansible-2.9.cfg - fi - - echo $ANSIBLE_CONFIG - command -v ansible-playbook - pip --version - python --version - ansible-playbook --version - - ansible-playbook -vv ci/playbooks/pre.yml \ - -e host=localhost \ - -i localhost, \ - -e ansible_connection=local \ - -e setup_python=false - - TEST2RUN=podman_export ./ci/run_containers_tests.sh - shell: bash + uses: ./.github/workflows/reusable-module-test.yml + with: + module_name: 'podman_export' + display_name: 'Podman export' diff --git a/.github/workflows/podman_generate_systemd.yml b/.github/workflows/podman_generate_systemd.yml index 22e31bf..492b629 100644 --- a/.github/workflows/podman_generate_systemd.yml +++ b/.github/workflows/podman_generate_systemd.yml @@ -4,6 +4,7 @@ on: push: paths: - '.github/workflows/podman_generate_systemd.yml' + - '.github/workflows/reusable-module-test.yml' - 'ci/*.yml' - 'ci/run_containers_tests.sh' - 'ci/playbooks/containers/podman_generate_systemd.yml' @@ -14,6 +15,7 @@ on: pull_request: paths: - '.github/workflows/podman_generate_systemd.yml' + - '.github/workflows/reusable-module-test.yml' - 'ci/*.yml' - 'ci/run_containers_tests.sh' - 'ci/playbooks/containers/podman_generate_systemd.yml' @@ -23,76 +25,8 @@ on: - cron: 4 0 * * * # Run daily at 0:03 UTC jobs: - test_podman_generate_systemd: - name: Podman generate systemd ${{ matrix.ansible-version }}-${{ matrix.os || 'ubuntu-22.04' }} - runs-on: ${{ matrix.os || 'ubuntu-22.04' }} - defaults: - run: - shell: bash - strategy: - fail-fast: false - matrix: - ansible-version: - - git+https://github.com/ansible/ansible.git@stable-2.18 - - git+https://github.com/ansible/ansible.git@devel - os: - - ubuntu-22.04 - python-version: - - "3.12" - - steps: - - - name: Check out repository - uses: actions/checkout@v4 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - - name: Upgrade pip and display Python and PIP versions - run: | - sudo apt-get update - sudo apt-get install -y python*-wheel python*-yaml - python -m pip install --upgrade pip - python -V - pip --version - - name: Set up pip cache - uses: actions/cache@v4 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ github.ref }}-units-VMs - restore-keys: | - ${{ runner.os }}-pip- - ${{ runner.os }}- - - name: Install Ansible ${{ matrix.ansible-version }} - run: python3 -m pip install --user --force-reinstall --upgrade '${{ matrix.ansible-version }}' - - - name: Build and install the collection tarball - run: | - rm -rf /tmp/just_new_collection - ~/.local/bin/ansible-galaxy collection build --output-path /tmp/just_new_collection --force - ~/.local/bin/ansible-galaxy collection install -vvv --force /tmp/just_new_collection/*.tar.gz - - name: Run collection tests for Podman generate systemd - run: | - export PATH=~/.local/bin:$PATH - echo "Run ansible version" - command -v ansible - ansible --version - export ANSIBLE_CONFIG=$(pwd)/ci/ansible-dev.cfg - if [[ '${{ matrix.ansible-version }}' == 'ansible<2.10' ]]; then - export ANSIBLE_CONFIG=$(pwd)/ci/ansible-2.9.cfg - fi - echo $ANSIBLE_CONFIG - command -v ansible-playbook - pip --version - python --version - ansible-playbook --version - ansible-playbook -vv ci/playbooks/pre.yml \ - -e host=localhost \ - -i localhost, \ - -e ansible_connection=local \ - -e setup_python=false - TEST2RUN=podman_generate_systemd ./ci/run_containers_tests.sh - shell: bash + uses: ./.github/workflows/reusable-module-test.yml + with: + module_name: 'podman_generate_systemd' + display_name: 'Podman generate systemd' diff --git a/.github/workflows/podman_image.yml b/.github/workflows/podman_image.yml index 04d6477..feff729 100644 --- a/.github/workflows/podman_image.yml +++ b/.github/workflows/podman_image.yml @@ -4,6 +4,7 @@ on: push: paths: - '.github/workflows/podman_image.yml' + - '.github/workflows/reusable-module-test.yml' - 'ci/*.yml' - 'ci/run_containers_tests.sh' - 'ci/playbooks/containers/podman_image.yml' @@ -16,6 +17,7 @@ on: pull_request: paths: - '.github/workflows/podman_image.yml' + - '.github/workflows/reusable-module-test.yml' - 'ci/*.yml' - 'ci/run_containers_tests.sh' - 'ci/playbooks/containers/podman_image.yml' @@ -27,84 +29,8 @@ on: - cron: 4 0 * * * # Run daily at 0:03 UTC jobs: - test_podman_image: - name: Podman image ${{ matrix.ansible-version }}-${{ matrix.os || 'ubuntu-22.04' }} - runs-on: ${{ matrix.os || 'ubuntu-22.04' }} - defaults: - run: - shell: bash - strategy: - fail-fast: false - matrix: - ansible-version: - - git+https://github.com/ansible/ansible.git@stable-2.18 - - git+https://github.com/ansible/ansible.git@devel - os: - - ubuntu-22.04 - python-version: - - "3.12" - - steps: - - - name: Check out repository - uses: actions/checkout@v4 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - - name: Upgrade pip and display Python and PIP versions - run: | - sudo apt-get update - sudo apt-get install -y python*-wheel python*-yaml - python -m pip install --upgrade pip - python -V - pip --version - - - name: Set up pip cache - uses: actions/cache@v4 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ github.ref }}-units-VMs - restore-keys: | - ${{ runner.os }}-pip- - ${{ runner.os }}- - - - name: Install Ansible ${{ matrix.ansible-version }} - run: python3 -m pip install --user --force-reinstall --upgrade '${{ matrix.ansible-version }}' - - - name: Build and install the collection tarball - run: | - rm -rf /tmp/just_new_collection - ~/.local/bin/ansible-galaxy collection build --output-path /tmp/just_new_collection --force - ~/.local/bin/ansible-galaxy collection install -vvv --force /tmp/just_new_collection/*.tar.gz - - - name: Run collection tests for podman image - run: | - export PATH=~/.local/bin:$PATH - - echo "Run ansible version" - command -v ansible - ansible --version - - export ANSIBLE_CONFIG=$(pwd)/ci/ansible-dev.cfg - if [[ '${{ matrix.ansible-version }}' == 'ansible<2.10' ]]; then - export ANSIBLE_CONFIG=$(pwd)/ci/ansible-2.9.cfg - fi - - echo $ANSIBLE_CONFIG - command -v ansible-playbook - pip --version - python --version - ansible-playbook --version - - ansible-playbook -vv ci/playbooks/pre.yml \ - -e host=localhost \ - -i localhost, \ - -e ansible_connection=local \ - -e setup_python=false - - TEST2RUN=podman_image ./ci/run_containers_tests.sh - shell: bash + uses: ./.github/workflows/reusable-module-test.yml + with: + module_name: 'podman_image' + display_name: 'Podman image' diff --git a/.github/workflows/podman_image_info.yml b/.github/workflows/podman_image_info.yml index 7b278c8..5d39e3c 100644 --- a/.github/workflows/podman_image_info.yml +++ b/.github/workflows/podman_image_info.yml @@ -4,6 +4,7 @@ on: push: paths: - '.github/workflows/podman_image_info.yml' + - '.github/workflows/reusable-module-test.yml' - 'ci/*.yml' - 'ci/run_containers_tests.sh' - 'ci/playbooks/containers/podman_image_info.yml' @@ -15,6 +16,7 @@ on: pull_request: paths: - '.github/workflows/podman_image_info.yml' + - '.github/workflows/reusable-module-test.yml' - 'ci/*.yml' - 'ci/run_containers_tests.sh' - 'ci/playbooks/containers/podman_image_info.yml' @@ -25,84 +27,9 @@ on: - cron: 4 0 * * * # Run daily at 0:03 UTC jobs: - test_podman_image_info: - name: Podman image info ${{ matrix.ansible-version }}-${{ matrix.os || 'ubuntu-22.04' }} - runs-on: ${{ matrix.os || 'ubuntu-22.04' }} - defaults: - run: - shell: bash - strategy: - fail-fast: false - matrix: - ansible-version: - - git+https://github.com/ansible/ansible.git@stable-2.18 - - git+https://github.com/ansible/ansible.git@devel - os: - - ubuntu-22.04 - python-version: - - "3.12" + uses: ./.github/workflows/reusable-module-test.yml + with: + module_name: 'podman_image_info' + display_name: 'Podman image info' - steps: - - - name: Check out repository - uses: actions/checkout@v4 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - - name: Upgrade pip and display Python and PIP versions - run: | - sudo apt-get update - sudo apt-get install -y python*-wheel python*-yaml - python -m pip install --upgrade pip - python -V - pip --version - - - name: Set up pip cache - uses: actions/cache@v4 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ github.ref }}-units-VMs - restore-keys: | - ${{ runner.os }}-pip- - ${{ runner.os }}- - - - name: Install Ansible ${{ matrix.ansible-version }} - run: python3 -m pip install --user --force-reinstall --upgrade '${{ matrix.ansible-version }}' - - - name: Build and install the collection tarball - run: | - rm -rf /tmp/just_new_collection - ~/.local/bin/ansible-galaxy collection build --output-path /tmp/just_new_collection --force - ~/.local/bin/ansible-galaxy collection install -vvv --force /tmp/just_new_collection/*.tar.gz - - - name: Run collection tests for podman image info - run: | - export PATH=~/.local/bin:$PATH - - echo "Run ansible version" - command -v ansible - ansible --version - - export ANSIBLE_CONFIG=$(pwd)/ci/ansible-dev.cfg - if [[ '${{ matrix.ansible-version }}' == 'ansible<2.10' ]]; then - export ANSIBLE_CONFIG=$(pwd)/ci/ansible-2.9.cfg - fi - - echo $ANSIBLE_CONFIG - command -v ansible-playbook - pip --version - python --version - ansible-playbook --version - - ansible-playbook -vv ci/playbooks/pre.yml \ - -e host=localhost \ - -i localhost, \ - -e ansible_connection=local \ - -e setup_python=false - - TEST2RUN=podman_image_info ./ci/run_containers_tests.sh - shell: bash diff --git a/.github/workflows/podman_import.yml b/.github/workflows/podman_import.yml index 64b6d1a..fce311e 100644 --- a/.github/workflows/podman_import.yml +++ b/.github/workflows/podman_import.yml @@ -4,6 +4,7 @@ on: push: paths: - '.github/workflows/podman_import.yml' + - '.github/workflows/reusable-module-test.yml' - 'ci/*.yml' - 'ci/run_containers_tests.sh' - 'ci/playbooks/containers/podman_import.yml' @@ -14,6 +15,7 @@ on: pull_request: paths: - '.github/workflows/podman_import.yml' + - '.github/workflows/reusable-module-test.yml' - 'ci/*.yml' - 'ci/run_containers_tests.sh' - 'ci/playbooks/containers/podman_import.yml' @@ -23,84 +25,8 @@ on: - cron: 4 0 * * * # Run daily at 0:03 UTC jobs: - test_podman_import: - name: Podman import ${{ matrix.ansible-version }}-${{ matrix.os || 'ubuntu-22.04' }} - runs-on: ${{ matrix.os || 'ubuntu-22.04' }} - defaults: - run: - shell: bash - strategy: - fail-fast: false - matrix: - ansible-version: - - git+https://github.com/ansible/ansible.git@stable-2.18 - - git+https://github.com/ansible/ansible.git@devel - os: - - ubuntu-22.04 - python-version: - - "3.12" - - steps: - - - name: Check out repository - uses: actions/checkout@v4 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - - name: Upgrade pip and display Python and PIP versions - run: | - sudo apt-get update - sudo apt-get install -y python*-wheel python*-yaml - python -m pip install --upgrade pip - python -V - pip --version - - - name: Set up pip cache - uses: actions/cache@v4 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ github.ref }}-units-VMs - restore-keys: | - ${{ runner.os }}-pip- - ${{ runner.os }}- - - - name: Install Ansible ${{ matrix.ansible-version }} - run: python3 -m pip install --user --force-reinstall --upgrade '${{ matrix.ansible-version }}' - - - name: Build and install the collection tarball - run: | - rm -rf /tmp/just_new_collection - ~/.local/bin/ansible-galaxy collection build --output-path /tmp/just_new_collection --force - ~/.local/bin/ansible-galaxy collection install -vvv --force /tmp/just_new_collection/*.tar.gz - - - name: Run collection tests for podman import - run: | - export PATH=~/.local/bin:$PATH - - echo "Run ansible version" - command -v ansible - ansible --version - - export ANSIBLE_CONFIG=$(pwd)/ci/ansible-dev.cfg - if [[ '${{ matrix.ansible-version }}' == 'ansible<2.10' ]]; then - export ANSIBLE_CONFIG=$(pwd)/ci/ansible-2.9.cfg - fi - - echo $ANSIBLE_CONFIG - command -v ansible-playbook - pip --version - python --version - ansible-playbook --version - - ansible-playbook -vv ci/playbooks/pre.yml \ - -e host=localhost \ - -i localhost, \ - -e ansible_connection=local \ - -e setup_python=false - - TEST2RUN=podman_import ./ci/run_containers_tests.sh - shell: bash + uses: ./.github/workflows/reusable-module-test.yml + with: + module_name: 'podman_import' + display_name: 'Podman import' diff --git a/.github/workflows/podman_load.yml b/.github/workflows/podman_load.yml index 801489b..84fc1fa 100644 --- a/.github/workflows/podman_load.yml +++ b/.github/workflows/podman_load.yml @@ -4,6 +4,7 @@ on: push: paths: - '.github/workflows/podman_load.yml' + - '.github/workflows/reusable-module-test.yml' - 'ci/*.yml' - 'ci/run_containers_tests.sh' - 'ci/playbooks/containers/podman_load.yml' @@ -14,6 +15,7 @@ on: pull_request: paths: - '.github/workflows/podman_load.yml' + - '.github/workflows/reusable-module-test.yml' - 'ci/*.yml' - 'ci/run_containers_tests.sh' - 'ci/playbooks/containers/podman_load.yml' @@ -23,84 +25,8 @@ on: - cron: 4 0 * * * # Run daily at 0:03 UTC jobs: - test_podman_load: - name: Podman load ${{ matrix.ansible-version }}-${{ matrix.os || 'ubuntu-22.04' }} - runs-on: ${{ matrix.os || 'ubuntu-22.04' }} - defaults: - run: - shell: bash - strategy: - fail-fast: false - matrix: - ansible-version: - - git+https://github.com/ansible/ansible.git@stable-2.18 - - git+https://github.com/ansible/ansible.git@devel - os: - - ubuntu-22.04 - python-version: - - "3.12" - - steps: - - - name: Check out repository - uses: actions/checkout@v4 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - - name: Upgrade pip and display Python and PIP versions - run: | - sudo apt-get update - sudo apt-get install -y python*-wheel python*-yaml - python -m pip install --upgrade pip - python -V - pip --version - - - name: Set up pip cache - uses: actions/cache@v4 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ github.ref }}-units-VMs - restore-keys: | - ${{ runner.os }}-pip- - ${{ runner.os }}- - - - name: Install Ansible ${{ matrix.ansible-version }} - run: python3 -m pip install --user --force-reinstall --upgrade '${{ matrix.ansible-version }}' - - - name: Build and install the collection tarball - run: | - rm -rf /tmp/just_new_collection - ~/.local/bin/ansible-galaxy collection build --output-path /tmp/just_new_collection --force - ~/.local/bin/ansible-galaxy collection install -vvv --force /tmp/just_new_collection/*.tar.gz - - - name: Run collection tests for podman load - run: | - export PATH=~/.local/bin:$PATH - - echo "Run ansible version" - command -v ansible - ansible --version - - export ANSIBLE_CONFIG=$(pwd)/ci/ansible-dev.cfg - if [[ '${{ matrix.ansible-version }}' == 'ansible<2.10' ]]; then - export ANSIBLE_CONFIG=$(pwd)/ci/ansible-2.9.cfg - fi - - echo $ANSIBLE_CONFIG - command -v ansible-playbook - pip --version - python --version - ansible-playbook --version - - ansible-playbook -vv ci/playbooks/pre.yml \ - -e host=localhost \ - -i localhost, \ - -e ansible_connection=local \ - -e setup_python=false - - TEST2RUN=podman_load ./ci/run_containers_tests.sh - shell: bash + uses: ./.github/workflows/reusable-module-test.yml + with: + module_name: 'podman_load' + display_name: 'Podman load' diff --git a/.github/workflows/podman_login.yml b/.github/workflows/podman_login.yml index a54f055..231b58b 100644 --- a/.github/workflows/podman_login.yml +++ b/.github/workflows/podman_login.yml @@ -4,6 +4,7 @@ on: push: paths: - '.github/workflows/podman_login.yml' + - '.github/workflows/reusable-module-test.yml' - 'ci/*.yml' - 'ci/run_containers_tests.sh' - 'ci/playbooks/containers/podman_login.yml' @@ -14,6 +15,7 @@ on: pull_request: paths: - '.github/workflows/podman_login.yml' + - '.github/workflows/reusable-module-test.yml' - 'ci/*.yml' - 'ci/run_containers_tests.sh' - 'ci/playbooks/containers/podman_login.yml' @@ -23,84 +25,8 @@ on: - cron: 4 0 * * * # Run daily at 0:03 UTC jobs: - test_podman_login: - name: Podman login ${{ matrix.ansible-version }}-${{ matrix.os || 'ubuntu-22.04' }} - runs-on: ${{ matrix.os || 'ubuntu-22.04' }} - defaults: - run: - shell: bash - strategy: - fail-fast: false - matrix: - ansible-version: - - git+https://github.com/ansible/ansible.git@stable-2.18 - - git+https://github.com/ansible/ansible.git@devel - os: - - ubuntu-22.04 - python-version: - - "3.12" - - steps: - - - name: Check out repository - uses: actions/checkout@v4 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - - name: Upgrade pip and display Python and PIP versions - run: | - sudo apt-get update - sudo apt-get install -y python*-wheel python*-yaml - python -m pip install --upgrade pip - python -V - pip --version - - - name: Set up pip cache - uses: actions/cache@v4 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ github.ref }}-units-VMs - restore-keys: | - ${{ runner.os }}-pip- - ${{ runner.os }}- - - - name: Install Ansible ${{ matrix.ansible-version }} - run: python3 -m pip install --user --force-reinstall --upgrade '${{ matrix.ansible-version }}' - - - name: Build and install the collection tarball - run: | - rm -rf /tmp/just_new_collection - ~/.local/bin/ansible-galaxy collection build --output-path /tmp/just_new_collection --force - ~/.local/bin/ansible-galaxy collection install -vvv --force /tmp/just_new_collection/*.tar.gz - - - name: Run collection tests for Podman login - run: | - export PATH=~/.local/bin:$PATH - - echo "Run ansible version" - command -v ansible - ansible --version - - export ANSIBLE_CONFIG=$(pwd)/ci/ansible-dev.cfg - if [[ '${{ matrix.ansible-version }}' == 'ansible<2.10' ]]; then - export ANSIBLE_CONFIG=$(pwd)/ci/ansible-2.9.cfg - fi - - echo $ANSIBLE_CONFIG - command -v ansible-playbook - pip --version - python --version - ansible-playbook --version - - ansible-playbook -vv ci/playbooks/pre.yml \ - -e host=localhost \ - -i localhost, \ - -e ansible_connection=local \ - -e setup_python=false - - TEST2RUN=podman_login ./ci/run_containers_tests.sh - shell: bash + uses: ./.github/workflows/reusable-module-test.yml + with: + module_name: 'podman_login' + display_name: 'Podman login' diff --git a/.github/workflows/podman_login_info.yml b/.github/workflows/podman_login_info.yml index ed48b2a..addc15d 100644 --- a/.github/workflows/podman_login_info.yml +++ b/.github/workflows/podman_login_info.yml @@ -4,6 +4,7 @@ on: push: paths: - '.github/workflows/podman_login_info.yml' + - '.github/workflows/reusable-module-test.yml' - 'ci/*.yml' - 'ci/run_containers_tests.sh' - 'ci/playbooks/containers/podman_login_info.yml' @@ -14,6 +15,7 @@ on: pull_request: paths: - '.github/workflows/podman_login_info.yml' + - '.github/workflows/reusable-module-test.yml' - 'ci/*.yml' - 'ci/run_containers_tests.sh' - 'ci/playbooks/containers/podman_login_info.yml' @@ -23,84 +25,8 @@ on: - cron: 4 0 * * * # Run daily at 0:03 UTC jobs: - test_podman_login_info: - name: Podman login info ${{ matrix.ansible-version }}-${{ matrix.os || 'ubuntu-22.04' }} - runs-on: ${{ matrix.os || 'ubuntu-22.04' }} - defaults: - run: - shell: bash - strategy: - fail-fast: false - matrix: - ansible-version: - - git+https://github.com/ansible/ansible.git@stable-2.18 - - git+https://github.com/ansible/ansible.git@devel - os: - - ubuntu-22.04 - python-version: - - "3.12" - - steps: - - - name: Check out repository - uses: actions/checkout@v4 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - - name: Upgrade pip and display Python and PIP versions - run: | - sudo apt-get update - sudo apt-get install -y python*-wheel python*-yaml - python -m pip install --upgrade pip - python -V - pip --version - - - name: Set up pip cache - uses: actions/cache@v4 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ github.ref }}-units-VMs - restore-keys: | - ${{ runner.os }}-pip- - ${{ runner.os }}- - - - name: Install Ansible ${{ matrix.ansible-version }} - run: python3 -m pip install --user --force-reinstall --upgrade '${{ matrix.ansible-version }}' - - - name: Build and install the collection tarball - run: | - rm -rf /tmp/just_new_collection - ~/.local/bin/ansible-galaxy collection build --output-path /tmp/just_new_collection --force - ~/.local/bin/ansible-galaxy collection install -vvv --force /tmp/just_new_collection/*.tar.gz - - - name: Run collection tests for podman login info - run: | - export PATH=~/.local/bin:$PATH - - echo "Run ansible version" - command -v ansible - ansible --version - - export ANSIBLE_CONFIG=$(pwd)/ci/ansible-dev.cfg - if [[ '${{ matrix.ansible-version }}' == 'ansible<2.10' ]]; then - export ANSIBLE_CONFIG=$(pwd)/ci/ansible-2.9.cfg - fi - - echo $ANSIBLE_CONFIG - command -v ansible-playbook - pip --version - python --version - ansible-playbook --version - - ansible-playbook -vv ci/playbooks/pre.yml \ - -e host=localhost \ - -i localhost, \ - -e ansible_connection=local \ - -e setup_python=false - - TEST2RUN=podman_login_info ./ci/run_containers_tests.sh - shell: bash + uses: ./.github/workflows/reusable-module-test.yml + with: + module_name: 'podman_login_info' + display_name: 'Podman login info' diff --git a/.github/workflows/podman_logout.yml b/.github/workflows/podman_logout.yml index cddf678..b9cc816 100644 --- a/.github/workflows/podman_logout.yml +++ b/.github/workflows/podman_logout.yml @@ -4,6 +4,7 @@ on: push: paths: - '.github/workflows/podman_logout.yml' + - '.github/workflows/reusable-module-test.yml' - 'ci/*.yml' - 'ci/run_containers_tests.sh' - 'ci/playbooks/containers/podman_logout.yml' @@ -14,6 +15,7 @@ on: pull_request: paths: - '.github/workflows/podman_logout.yml' + - '.github/workflows/reusable-module-test.yml' - 'ci/*.yml' - 'ci/run_containers_tests.sh' - 'ci/playbooks/containers/podman_logout.yml' @@ -23,84 +25,8 @@ on: - cron: 4 0 * * * # Run daily at 0:03 UTC jobs: - test_podman_logout: - name: Podman logout ${{ matrix.ansible-version }}-${{ matrix.os || 'ubuntu-22.04' }} - runs-on: ${{ matrix.os || 'ubuntu-22.04' }} - defaults: - run: - shell: bash - strategy: - fail-fast: false - matrix: - ansible-version: - - git+https://github.com/ansible/ansible.git@stable-2.18 - - git+https://github.com/ansible/ansible.git@devel - os: - - ubuntu-22.04 - python-version: - - "3.12" - - steps: - - - name: Check out repository - uses: actions/checkout@v4 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - - name: Upgrade pip and display Python and PIP versions - run: | - sudo apt-get update - sudo apt-get install -y python*-wheel python*-yaml - python -m pip install --upgrade pip - python -V - pip --version - - - name: Set up pip cache - uses: actions/cache@v4 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ github.ref }}-units-VMs - restore-keys: | - ${{ runner.os }}-pip- - ${{ runner.os }}- - - - name: Install Ansible ${{ matrix.ansible-version }} - run: python3 -m pip install --user --force-reinstall --upgrade '${{ matrix.ansible-version }}' - - - name: Build and install the collection tarball - run: | - rm -rf /tmp/just_new_collection - ~/.local/bin/ansible-galaxy collection build --output-path /tmp/just_new_collection --force - ~/.local/bin/ansible-galaxy collection install -vvv --force /tmp/just_new_collection/*.tar.gz - - - name: Run collection tests for podman logout - run: | - export PATH=~/.local/bin:$PATH - - echo "Run ansible version" - command -v ansible - ansible --version - - export ANSIBLE_CONFIG=$(pwd)/ci/ansible-dev.cfg - if [[ '${{ matrix.ansible-version }}' == 'ansible<2.10' ]]; then - export ANSIBLE_CONFIG=$(pwd)/ci/ansible-2.9.cfg - fi - - echo $ANSIBLE_CONFIG - command -v ansible-playbook - pip --version - python --version - ansible-playbook --version - - ansible-playbook -vv ci/playbooks/pre.yml \ - -e host=localhost \ - -i localhost, \ - -e ansible_connection=local \ - -e setup_python=false - - TEST2RUN=podman_logout ./ci/run_containers_tests.sh - shell: bash + uses: ./.github/workflows/reusable-module-test.yml + with: + module_name: 'podman_logout' + display_name: 'Podman logout' diff --git a/.github/workflows/podman_network.yml b/.github/workflows/podman_network.yml index c174ab8..f3f9ee6 100644 --- a/.github/workflows/podman_network.yml +++ b/.github/workflows/podman_network.yml @@ -4,6 +4,7 @@ on: push: paths: - '.github/workflows/podman_network.yml' + - '.github/workflows/reusable-module-test.yml' - 'ci/*.yml' - 'ci/run_containers_tests.sh' - 'ci/playbooks/containers/podman_network.yml' @@ -15,6 +16,7 @@ on: pull_request: paths: - '.github/workflows/podman_network.yml' + - '.github/workflows/reusable-module-test.yml' - 'ci/*.yml' - 'ci/run_containers_tests.sh' - 'ci/playbooks/containers/podman_network.yml' @@ -25,84 +27,8 @@ on: - cron: 4 0 * * * # Run daily at 0:03 UTC jobs: - test_podman_network: - name: Podman network ${{ matrix.ansible-version }}-${{ matrix.os || 'ubuntu-22.04' }} - runs-on: ${{ matrix.os || 'ubuntu-22.04' }} - defaults: - run: - shell: bash - strategy: - fail-fast: false - matrix: - ansible-version: - - git+https://github.com/ansible/ansible.git@stable-2.18 - - git+https://github.com/ansible/ansible.git@devel - os: - - ubuntu-22.04 - python-version: - - "3.12" - - steps: - - - name: Check out repository - uses: actions/checkout@v4 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - - name: Upgrade pip and display Python and PIP versions - run: | - sudo apt-get update - sudo apt-get install -y python*-wheel python*-yaml - python -m pip install --upgrade pip - python -V - pip --version - - - name: Set up pip cache - uses: actions/cache@v4 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ github.ref }}-units-VMs - restore-keys: | - ${{ runner.os }}-pip- - ${{ runner.os }}- - - - name: Install Ansible ${{ matrix.ansible-version }} - run: python3 -m pip install --user --force-reinstall --upgrade '${{ matrix.ansible-version }}' - - - name: Build and install the collection tarball - run: | - rm -rf /tmp/just_new_collection - ~/.local/bin/ansible-galaxy collection build --output-path /tmp/just_new_collection --force - ~/.local/bin/ansible-galaxy collection install -vvv --force /tmp/just_new_collection/*.tar.gz - - - name: Run collection tests for podman network - run: | - export PATH=~/.local/bin:$PATH - - echo "Run ansible version" - command -v ansible - ansible --version - - export ANSIBLE_CONFIG=$(pwd)/ci/ansible-dev.cfg - if [[ '${{ matrix.ansible-version }}' == 'ansible<2.10' ]]; then - export ANSIBLE_CONFIG=$(pwd)/ci/ansible-2.9.cfg - fi - - echo $ANSIBLE_CONFIG - command -v ansible-playbook - pip --version - python --version - ansible-playbook --version - - ansible-playbook -vv ci/playbooks/pre.yml \ - -e host=localhost \ - -i localhost, \ - -e ansible_connection=local \ - -e setup_python=false - - TEST2RUN=podman_network ./ci/run_containers_tests.sh - shell: bash + uses: ./.github/workflows/reusable-module-test.yml + with: + module_name: 'podman_network' + display_name: 'Podman network' diff --git a/.github/workflows/podman_network_info.yml b/.github/workflows/podman_network_info.yml index a415caa..ac66fc0 100644 --- a/.github/workflows/podman_network_info.yml +++ b/.github/workflows/podman_network_info.yml @@ -4,6 +4,7 @@ on: push: paths: - '.github/workflows/podman_network_info.yml' + - '.github/workflows/reusable-module-test.yml' - 'ci/*.yml' - 'ci/run_containers_tests.sh' - 'ci/playbooks/containers/podman_network_info.yml' @@ -14,6 +15,7 @@ on: pull_request: paths: - '.github/workflows/podman_network_info.yml' + - '.github/workflows/reusable-module-test.yml' - 'ci/*.yml' - 'ci/run_containers_tests.sh' - 'ci/playbooks/containers/podman_network_info.yml' @@ -23,84 +25,8 @@ on: - cron: 4 0 * * * # Run daily at 0:03 UTC jobs: - test_podman_network_info: - name: Podman network info ${{ matrix.ansible-version }}-${{ matrix.os || 'ubuntu-22.04' }} - runs-on: ${{ matrix.os || 'ubuntu-22.04' }} - defaults: - run: - shell: bash - strategy: - fail-fast: false - matrix: - ansible-version: - - git+https://github.com/ansible/ansible.git@stable-2.18 - - git+https://github.com/ansible/ansible.git@devel - os: - - ubuntu-22.04 - python-version: - - "3.12" - - steps: - - - name: Check out repository - uses: actions/checkout@v4 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - - name: Upgrade pip and display Python and PIP versions - run: | - sudo apt-get update - sudo apt-get install -y python*-wheel python*-yaml - python -m pip install --upgrade pip - python -V - pip --version - - - name: Set up pip cache - uses: actions/cache@v4 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ github.ref }}-units-VMs - restore-keys: | - ${{ runner.os }}-pip- - ${{ runner.os }}- - - - name: Install Ansible ${{ matrix.ansible-version }} - run: python3 -m pip install --user --force-reinstall --upgrade '${{ matrix.ansible-version }}' - - - name: Build and install the collection tarball - run: | - rm -rf /tmp/just_new_collection - ~/.local/bin/ansible-galaxy collection build --output-path /tmp/just_new_collection --force - ~/.local/bin/ansible-galaxy collection install -vvv --force /tmp/just_new_collection/*.tar.gz - - - name: Run collection tests for podman network info - run: | - export PATH=~/.local/bin:$PATH - - echo "Run ansible version" - command -v ansible - ansible --version - - export ANSIBLE_CONFIG=$(pwd)/ci/ansible-dev.cfg - if [[ '${{ matrix.ansible-version }}' == 'ansible<2.10' ]]; then - export ANSIBLE_CONFIG=$(pwd)/ci/ansible-2.9.cfg - fi - - echo $ANSIBLE_CONFIG - command -v ansible-playbook - pip --version - python --version - ansible-playbook --version - - ansible-playbook -vv ci/playbooks/pre.yml \ - -e host=localhost \ - -i localhost, \ - -e ansible_connection=local \ - -e setup_python=false - - TEST2RUN=podman_network_info ./ci/run_containers_tests.sh - shell: bash + uses: ./.github/workflows/reusable-module-test.yml + with: + module_name: 'podman_network_info' + display_name: 'Podman network info' diff --git a/.github/workflows/podman_play.yml b/.github/workflows/podman_play.yml index d7ba71d..4d72a0f 100644 --- a/.github/workflows/podman_play.yml +++ b/.github/workflows/podman_play.yml @@ -25,85 +25,8 @@ on: - cron: 4 0 * * * # Run daily at 0:03 UTC jobs: - test_podman_play: - name: Podman play ${{ matrix.ansible-version }}-${{ matrix.os || 'ubuntu-22.04' }} - runs-on: ${{ matrix.os || 'ubuntu-22.04' }} - defaults: - run: - shell: bash - strategy: - fail-fast: false - matrix: - ansible-version: - - git+https://github.com/ansible/ansible.git@stable-2.18 - - git+https://github.com/ansible/ansible.git@devel - os: - - ubuntu-22.04 - python-version: - - "3.12" - - steps: - - - name: Check out repository - uses: actions/checkout@v4 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - - name: Upgrade pip and display Python and PIP versions - run: | - sudo apt-get update - sudo apt-get install -y python*-wheel python*-yaml - python -m pip install --upgrade pip - python -V - pip --version - - - name: Set up pip cache - uses: actions/cache@v4 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ github.ref }}-units-VMs - restore-keys: | - ${{ runner.os }}-pip- - ${{ runner.os }}- - - - name: Install Ansible ${{ matrix.ansible-version }} - run: python3 -m pip install --user --force-reinstall --upgrade '${{ matrix.ansible-version }}' - - - name: Build and install the collection tarball - run: | - export PATH=~/.local/bin:$PATH - - echo "Run ansible version" - command -v ansible - ansible --version - rm -rf /tmp/just_new_collection - ~/.local/bin/ansible-galaxy collection build --output-path /tmp/just_new_collection --force - ~/.local/bin/ansible-galaxy collection install -vvv --force /tmp/just_new_collection/*.tar.gz - - - name: Run collection tests for podman play - run: | - export PATH=~/.local/bin:$PATH - - export ANSIBLE_CONFIG=$(pwd)/ci/ansible-dev.cfg - if [[ '${{ matrix.ansible-version }}' == 'ansible<2.10' ]]; then - export ANSIBLE_CONFIG=$(pwd)/ci/ansible-2.9.cfg - fi - - echo $ANSIBLE_CONFIG - command -v ansible-playbook - pip --version - python --version - ansible-playbook --version - - ansible-playbook -vv ci/playbooks/pre.yml \ - -e host=localhost \ - -i localhost, \ - -e ansible_connection=local \ - -e setup_python=false - - TEST2RUN=podman_play ./ci/run_containers_tests.sh - shell: bash + uses: ./.github/workflows/reusable-module-test.yml + with: + module_name: 'podman_play' + display_name: 'Podman play' diff --git a/.github/workflows/podman_pod.yml b/.github/workflows/podman_pod.yml index 95c6537..1658117 100644 --- a/.github/workflows/podman_pod.yml +++ b/.github/workflows/podman_pod.yml @@ -31,85 +31,8 @@ on: - cron: 4 0 * * * # Run daily at 0:03 UTC jobs: - test_podman_pod: - name: Podman pod ${{ matrix.ansible-version }}-${{ matrix.os || 'ubuntu-22.04' }} - runs-on: ${{ matrix.os || 'ubuntu-22.04' }} - defaults: - run: - shell: bash - strategy: - fail-fast: false - matrix: - ansible-version: - - git+https://github.com/ansible/ansible.git@stable-2.18 - - git+https://github.com/ansible/ansible.git@devel - os: - - ubuntu-22.04 - python-version: - - "3.12" - - steps: - - - name: Check out repository - uses: actions/checkout@v4 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - - name: Upgrade pip and display Python and PIP versions - run: | - sudo apt-get update - sudo apt-get install -y python*-wheel python*-yaml - python -m pip install --upgrade pip - python -V - pip --version - - - name: Set up pip cache - uses: actions/cache@v4 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ github.ref }}-units-VMs - restore-keys: | - ${{ runner.os }}-pip- - ${{ runner.os }}- - - - name: Install Ansible ${{ matrix.ansible-version }} - run: python3 -m pip install --user --force-reinstall --upgrade '${{ matrix.ansible-version }}' - - - name: Build and install the collection tarball - run: | - export PATH=~/.local/bin:$PATH - - echo "Run ansible version" - command -v ansible - ansible --version - rm -rf /tmp/just_new_collection - ~/.local/bin/ansible-galaxy collection build --output-path /tmp/just_new_collection --force - ~/.local/bin/ansible-galaxy collection install -vvv --force /tmp/just_new_collection/*.tar.gz - - - name: Run collection tests for podman pod - run: | - export PATH=~/.local/bin:$PATH - - export ANSIBLE_CONFIG=$(pwd)/ci/ansible-dev.cfg - if [[ '${{ matrix.ansible-version }}' == 'ansible<2.10' ]]; then - export ANSIBLE_CONFIG=$(pwd)/ci/ansible-2.9.cfg - fi - - echo $ANSIBLE_CONFIG - command -v ansible-playbook - pip --version - python --version - ansible-playbook --version - - ansible-playbook -vv ci/playbooks/pre.yml \ - -e host=localhost \ - -i localhost, \ - -e ansible_connection=local \ - -e setup_python=false - - TEST2RUN=podman_pod ./ci/run_containers_tests.sh - shell: bash + uses: ./.github/workflows/reusable-module-test.yml + with: + module_name: 'podman_pod' + display_name: 'Podman pod' diff --git a/.github/workflows/podman_pod_info.yml b/.github/workflows/podman_pod_info.yml index 2757e1b..8334ae0 100644 --- a/.github/workflows/podman_pod_info.yml +++ b/.github/workflows/podman_pod_info.yml @@ -27,85 +27,8 @@ on: - cron: 4 0 * * * # Run daily at 0:03 UTC jobs: - test_podman_pod_info: - name: Podman pod info ${{ matrix.ansible-version }}-${{ matrix.os || 'ubuntu-22.04' }} - runs-on: ${{ matrix.os || 'ubuntu-22.04' }} - defaults: - run: - shell: bash - strategy: - fail-fast: false - matrix: - ansible-version: - - git+https://github.com/ansible/ansible.git@stable-2.18 - - git+https://github.com/ansible/ansible.git@devel - os: - - ubuntu-22.04 - python-version: - - "3.12" - - steps: - - - name: Check out repository - uses: actions/checkout@v4 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - - name: Upgrade pip and display Python and PIP versions - run: | - sudo apt-get update - sudo apt-get install -y python*-wheel python*-yaml - python -m pip install --upgrade pip - python -V - pip --version - - - name: Set up pip cache - uses: actions/cache@v4 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ github.ref }}-units-VMs - restore-keys: | - ${{ runner.os }}-pip- - ${{ runner.os }}- - - - name: Install Ansible ${{ matrix.ansible-version }} - run: python3 -m pip install --user --force-reinstall --upgrade '${{ matrix.ansible-version }}' - - - name: Build and install the collection tarball - run: | - export PATH=~/.local/bin:$PATH - - echo "Run ansible version" - command -v ansible - ansible --version - rm -rf /tmp/just_new_collection - ~/.local/bin/ansible-galaxy collection build --output-path /tmp/just_new_collection --force - ~/.local/bin/ansible-galaxy collection install -vvv --force /tmp/just_new_collection/*.tar.gz - - - name: Run collection tests for podman pod info - run: | - export PATH=~/.local/bin:$PATH - - export ANSIBLE_CONFIG=$(pwd)/ci/ansible-dev.cfg - if [[ '${{ matrix.ansible-version }}' == 'ansible<2.10' ]]; then - export ANSIBLE_CONFIG=$(pwd)/ci/ansible-2.9.cfg - fi - - echo $ANSIBLE_CONFIG - command -v ansible-playbook - pip --version - python --version - ansible-playbook --version - - ansible-playbook -vv ci/playbooks/pre.yml \ - -e host=localhost \ - -i localhost, \ - -e ansible_connection=local \ - -e setup_python=false - - TEST2RUN=podman_pod_info ./ci/run_containers_tests.sh - shell: bash + uses: ./.github/workflows/reusable-module-test.yml + with: + module_name: 'podman_pod_info' + display_name: 'Podman pod info' diff --git a/.github/workflows/podman_prune.yml b/.github/workflows/podman_prune.yml index 3cf349c..e3d616b 100644 --- a/.github/workflows/podman_prune.yml +++ b/.github/workflows/podman_prune.yml @@ -4,6 +4,7 @@ on: push: paths: - '.github/workflows/podman_prune.yml' + - '.github/workflows/reusable-module-test.yml' - 'ci/*.yml' - 'ci/run_containers_tests.sh' - 'ci/playbooks/containers/podman_prune.yml' @@ -14,6 +15,7 @@ on: pull_request: paths: - '.github/workflows/podman_prune.yml' + - '.github/workflows/reusable-module-test.yml' - 'ci/*.yml' - 'ci/run_containers_tests.sh' - 'ci/playbooks/containers/podman_prune.yml' @@ -23,84 +25,8 @@ on: - cron: 4 0 * * * # Run daily at 0:03 UTC jobs: - test_podman_prune: - name: Podman prune ${{ matrix.ansible-version }}-${{ matrix.os || 'ubuntu-22.04' }} - runs-on: ${{ matrix.os || 'ubuntu-22.04' }} - defaults: - run: - shell: bash - strategy: - fail-fast: false - matrix: - ansible-version: - - git+https://github.com/ansible/ansible.git@stable-2.18 - - git+https://github.com/ansible/ansible.git@devel - os: - - ubuntu-22.04 - python-version: - - "3.12" - - steps: - - - name: Check out repository - uses: actions/checkout@v4 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - - name: Upgrade pip and display Python and PIP versions - run: | - sudo apt-get update - sudo apt-get install -y python*-wheel python*-yaml - python -m pip install --upgrade pip - python -V - pip --version - - - name: Set up pip cache - uses: actions/cache@v4 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ github.ref }}-units-VMs - restore-keys: | - ${{ runner.os }}-pip- - ${{ runner.os }}- - - - name: Install Ansible ${{ matrix.ansible-version }} - run: python3 -m pip install --user --force-reinstall --upgrade '${{ matrix.ansible-version }}' - - - name: Build and install the collection tarball - run: | - rm -rf /tmp/just_new_collection - ~/.local/bin/ansible-galaxy collection build --output-path /tmp/just_new_collection --force - ~/.local/bin/ansible-galaxy collection install -vvv --force /tmp/just_new_collection/*.tar.gz - - - name: Run collection tests for podman prune - run: | - export PATH=~/.local/bin:$PATH - - echo "Run ansible version" - command -v ansible - ansible --version - - export ANSIBLE_CONFIG=$(pwd)/ci/ansible-dev.cfg - if [[ '${{ matrix.ansible-version }}' == 'ansible<2.10' ]]; then - export ANSIBLE_CONFIG=$(pwd)/ci/ansible-2.9.cfg - fi - - echo $ANSIBLE_CONFIG - command -v ansible-playbook - pip --version - python --version - ansible-playbook --version - - ansible-playbook -vv ci/playbooks/pre.yml \ - -e host=localhost \ - -i localhost, \ - -e ansible_connection=local \ - -e setup_python=false - - TEST2RUN=podman_prune ./ci/run_containers_tests.sh - shell: bash + uses: ./.github/workflows/reusable-module-test.yml + with: + module_name: 'podman_prune' + display_name: 'Podman prune' diff --git a/.github/workflows/podman_runlabel.yml b/.github/workflows/podman_runlabel.yml index fb4aaad..89d5e0b 100644 --- a/.github/workflows/podman_runlabel.yml +++ b/.github/workflows/podman_runlabel.yml @@ -4,6 +4,7 @@ on: push: paths: - '.github/workflows/podman_runlabel.yml' + - '.github/workflows/reusable-module-test.yml' - 'ci/*.yml' - 'ci/run_containers_tests.sh' - 'ci/playbooks/containers/podman_runlabel.yml' @@ -14,6 +15,7 @@ on: pull_request: paths: - '.github/workflows/podman_runlabel.yml' + - '.github/workflows/reusable-module-test.yml' - 'ci/*.yml' - 'ci/run_containers_tests.sh' - 'ci/playbooks/containers/podman_runlabel.yml' @@ -23,76 +25,8 @@ on: - cron: 4 0 * * * # Run daily at 0:03 UTC jobs: - test_podman_runlabel: - name: Podman runlabel module ${{ matrix.ansible-version }}-${{ matrix.os || 'ubuntu-22.04' }} - runs-on: ${{ matrix.os || 'ubuntu-22.04' }} - defaults: - run: - shell: bash - strategy: - fail-fast: false - matrix: - ansible-version: - - git+https://github.com/ansible/ansible.git@stable-2.18 - - git+https://github.com/ansible/ansible.git@devel - os: - - ubuntu-22.04 - python-version: - - "3.12" - - steps: - - - name: Check out repository - uses: actions/checkout@v4 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - - name: Upgrade pip and display Python and PIP versions - run: | - sudo apt-get update - sudo apt-get install -y python*-wheel python*-yaml - python -m pip install --upgrade pip - python -V - pip --version - - name: Set up pip cache - uses: actions/cache@v4 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ github.ref }}-units-VMs - restore-keys: | - ${{ runner.os }}-pip- - ${{ runner.os }}- - - name: Install Ansible ${{ matrix.ansible-version }} - run: python3 -m pip install --user --force-reinstall --upgrade '${{ matrix.ansible-version }}' - - - name: Build and install the collection tarball - run: | - rm -rf /tmp/just_new_collection - ~/.local/bin/ansible-galaxy collection build --output-path /tmp/just_new_collection --force - ~/.local/bin/ansible-galaxy collection install -vvv --force /tmp/just_new_collection/*.tar.gz - - name: Run collection tests for Podman runlabel module - run: | - export PATH=~/.local/bin:$PATH - echo "Run ansible version" - command -v ansible - ansible --version - export ANSIBLE_CONFIG=$(pwd)/ci/ansible-dev.cfg - if [[ '${{ matrix.ansible-version }}' == 'ansible<2.10' ]]; then - export ANSIBLE_CONFIG=$(pwd)/ci/ansible-2.9.cfg - fi - echo $ANSIBLE_CONFIG - command -v ansible-playbook - pip --version - python --version - ansible-playbook --version - ansible-playbook -vv ci/playbooks/pre.yml \ - -e host=localhost \ - -i localhost, \ - -e ansible_connection=local \ - -e setup_python=false - TEST2RUN=podman_runlabel ./ci/run_containers_tests.sh - shell: bash + uses: ./.github/workflows/reusable-module-test.yml + with: + module_name: 'podman_runlabel' + display_name: 'Podman runlabel module' diff --git a/.github/workflows/podman_save.yml b/.github/workflows/podman_save.yml index 784db1a..63c28b8 100644 --- a/.github/workflows/podman_save.yml +++ b/.github/workflows/podman_save.yml @@ -4,6 +4,7 @@ on: push: paths: - '.github/workflows/podman_save.yml' + - '.github/workflows/reusable-module-test.yml' - 'ci/*.yml' - 'ci/run_containers_tests.sh' - 'ci/playbooks/containers/podman_save.yml' @@ -14,6 +15,7 @@ on: pull_request: paths: - '.github/workflows/podman_save.yml' + - '.github/workflows/reusable-module-test.yml' - 'ci/*.yml' - 'ci/run_containers_tests.sh' - 'ci/playbooks/containers/podman_save.yml' @@ -23,84 +25,8 @@ on: - cron: 4 0 * * * # Run daily at 0:03 UTC jobs: - test_podman_save: - name: Podman save ${{ matrix.ansible-version }}-${{ matrix.os || 'ubuntu-22.04' }} - runs-on: ${{ matrix.os || 'ubuntu-22.04' }} - defaults: - run: - shell: bash - strategy: - fail-fast: false - matrix: - ansible-version: - - git+https://github.com/ansible/ansible.git@stable-2.18 - - git+https://github.com/ansible/ansible.git@devel - os: - - ubuntu-22.04 - python-version: - - "3.12" - - steps: - - - name: Check out repository - uses: actions/checkout@v4 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - - name: Upgrade pip and display Python and PIP versions - run: | - sudo apt-get update - sudo apt-get install -y python*-wheel python*-yaml - python -m pip install --upgrade pip - python -V - pip --version - - - name: Set up pip cache - uses: actions/cache@v4 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ github.ref }}-units-VMs - restore-keys: | - ${{ runner.os }}-pip- - ${{ runner.os }}- - - - name: Install Ansible ${{ matrix.ansible-version }} - run: python3 -m pip install --user --force-reinstall --upgrade '${{ matrix.ansible-version }}' - - - name: Build and install the collection tarball - run: | - rm -rf /tmp/just_new_collection - ~/.local/bin/ansible-galaxy collection build --output-path /tmp/just_new_collection --force - ~/.local/bin/ansible-galaxy collection install -vvv --force /tmp/just_new_collection/*.tar.gz - - - name: Run collection tests for podman save - run: | - export PATH=~/.local/bin:$PATH - - echo "Run ansible version" - command -v ansible - ansible --version - - export ANSIBLE_CONFIG=$(pwd)/ci/ansible-dev.cfg - if [[ '${{ matrix.ansible-version }}' == 'ansible<2.10' ]]; then - export ANSIBLE_CONFIG=$(pwd)/ci/ansible-2.9.cfg - fi - - echo $ANSIBLE_CONFIG - command -v ansible-playbook - pip --version - python --version - ansible-playbook --version - - ansible-playbook -vv ci/playbooks/pre.yml \ - -e host=localhost \ - -i localhost, \ - -e ansible_connection=local \ - -e setup_python=false - - TEST2RUN=podman_save ./ci/run_containers_tests.sh - shell: bash + uses: ./.github/workflows/reusable-module-test.yml + with: + module_name: 'podman_save' + display_name: 'Podman save' diff --git a/.github/workflows/podman_search.yml b/.github/workflows/podman_search.yml index 8cb9064..c330aef 100644 --- a/.github/workflows/podman_search.yml +++ b/.github/workflows/podman_search.yml @@ -4,6 +4,7 @@ on: push: paths: - '.github/workflows/podman_search.yml' + - '.github/workflows/reusable-module-test.yml' - 'ci/*.yml' - 'ci/run_containers_tests.sh' - 'ci/playbooks/containers/podman_search.yml' @@ -14,6 +15,7 @@ on: pull_request: paths: - '.github/workflows/podman_search.yml' + - '.github/workflows/reusable-module-test.yml' - 'ci/*.yml' - 'ci/run_containers_tests.sh' - 'ci/playbooks/containers/podman_search.yml' @@ -23,84 +25,8 @@ on: - cron: 4 0 * * * # Run daily at 0:03 UTC jobs: - test_podman_search: - name: Podman search ${{ matrix.ansible-version }}-${{ matrix.os || 'ubuntu-22.04' }} - runs-on: ${{ matrix.os || 'ubuntu-22.04' }} - defaults: - run: - shell: bash - strategy: - fail-fast: false - matrix: - ansible-version: - - git+https://github.com/ansible/ansible.git@stable-2.18 - - git+https://github.com/ansible/ansible.git@devel - os: - - ubuntu-22.04 - python-version: - - "3.12" - - steps: - - - name: Check out repository - uses: actions/checkout@v4 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - - name: Upgrade pip and display Python and PIP versions - run: | - sudo apt-get update - sudo apt-get install -y python*-wheel python*-yaml - python -m pip install --upgrade pip - python -V - pip --version - - - name: Set up pip cache - uses: actions/cache@v4 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ github.ref }}-units-VMs - restore-keys: | - ${{ runner.os }}-pip- - ${{ runner.os }}- - - - name: Install Ansible ${{ matrix.ansible-version }} - run: python3 -m pip install --user --force-reinstall --upgrade '${{ matrix.ansible-version }}' - - - name: Build and install the collection tarball - run: | - rm -rf /tmp/just_new_collection - ~/.local/bin/ansible-galaxy collection build --output-path /tmp/just_new_collection --force - ~/.local/bin/ansible-galaxy collection install -vvv --force /tmp/just_new_collection/*.tar.gz - - - name: Run collection tests for podman search - run: | - export PATH=~/.local/bin:$PATH - - echo "Run ansible version" - command -v ansible - ansible --version - - export ANSIBLE_CONFIG=$(pwd)/ci/ansible-dev.cfg - if [[ '${{ matrix.ansible-version }}' == 'ansible<2.10' ]]; then - export ANSIBLE_CONFIG=$(pwd)/ci/ansible-2.9.cfg - fi - - echo $ANSIBLE_CONFIG - command -v ansible-playbook - pip --version - python --version - ansible-playbook --version - - ansible-playbook -vv ci/playbooks/pre.yml \ - -e host=localhost \ - -i localhost, \ - -e ansible_connection=local \ - -e setup_python=false - - TEST2RUN=podman_search ./ci/run_containers_tests.sh - shell: bash + uses: ./.github/workflows/reusable-module-test.yml + with: + module_name: 'podman_search' + display_name: 'Podman search' diff --git a/.github/workflows/podman_secret.yml b/.github/workflows/podman_secret.yml index 7b97991..cca6ed5 100644 --- a/.github/workflows/podman_secret.yml +++ b/.github/workflows/podman_secret.yml @@ -4,6 +4,7 @@ on: push: paths: - '.github/workflows/podman_secret.yml' + - '.github/workflows/reusable-module-test.yml' - 'ci/*.yml' - 'ci/run_containers_tests.sh' - 'ci/playbooks/containers/podman_secret.yml' @@ -15,6 +16,7 @@ on: pull_request: paths: - '.github/workflows/podman_secret.yml' + - '.github/workflows/reusable-module-test.yml' - 'ci/*.yml' - 'ci/run_containers_tests.sh' - 'ci/playbooks/containers/podman_secret.yml' @@ -25,85 +27,9 @@ on: - cron: 4 0 * * * # Run daily at 0:03 UTC jobs: - test_podman_secret: - name: Podman secret ${{ matrix.ansible-version }}-${{ matrix.os || 'ubuntu-22.04' }} - runs-on: ${{ matrix.os || 'ubuntu-22.04' }} - defaults: - run: - shell: bash - strategy: - fail-fast: false - matrix: - ansible-version: - - git+https://github.com/ansible/ansible.git@stable-2.18 - - git+https://github.com/ansible/ansible.git@devel - os: - - ubuntu-22.04 - python-version: - - "3.12" + uses: ./.github/workflows/reusable-module-test.yml + with: + module_name: 'podman_secret' + display_name: 'Podman secret' - steps: - - - name: Check out repository - uses: actions/checkout@v4 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - - name: Upgrade pip and display Python and PIP versions - run: | - sudo apt-get update - sudo apt-get install -y python*-wheel python*-yaml - python -m pip install --upgrade pip - python -V - pip --version - - - name: Set up pip cache - uses: actions/cache@v4 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ github.ref }}-units-VMs - restore-keys: | - ${{ runner.os }}-pip- - ${{ runner.os }}- - - - name: Install Ansible ${{ matrix.ansible-version }} - run: python3 -m pip install --user --force-reinstall --upgrade '${{ matrix.ansible-version }}' - - - name: Build and install the collection tarball - run: | - export PATH=~/.local/bin:$PATH - - echo "Run ansible version" - command -v ansible - ansible --version - rm -rf /tmp/just_new_collection - ~/.local/bin/ansible-galaxy collection build --output-path /tmp/just_new_collection --force - ~/.local/bin/ansible-galaxy collection install -vvv --force /tmp/just_new_collection/*.tar.gz - - - name: Run collection tests for podman secret - run: | - export PATH=~/.local/bin:$PATH - - export ANSIBLE_CONFIG=$(pwd)/ci/ansible-dev.cfg - if [[ '${{ matrix.ansible-version }}' == 'ansible<2.10' ]]; then - export ANSIBLE_CONFIG=$(pwd)/ci/ansible-2.9.cfg - fi - - echo $ANSIBLE_CONFIG - command -v ansible-playbook - pip --version - python --version - ansible-playbook --version - - ansible-playbook -vv ci/playbooks/pre.yml \ - -e host=localhost \ - -i localhost, \ - -e ansible_connection=local \ - -e setup_python=false - - TEST2RUN=podman_secret ./ci/run_containers_tests.sh - shell: bash diff --git a/.github/workflows/podman_secret_info.yml b/.github/workflows/podman_secret_info.yml index 4e6752c..4ab38c3 100644 --- a/.github/workflows/podman_secret_info.yml +++ b/.github/workflows/podman_secret_info.yml @@ -4,6 +4,7 @@ on: push: paths: - '.github/workflows/podman_secret_info.yml' + - '.github/workflows/reusable-module-test.yml' - 'ci/*.yml' - 'ci/run_containers_tests.sh' - 'ci/playbooks/containers/podman_secret_info.yml' @@ -14,6 +15,7 @@ on: pull_request: paths: - '.github/workflows/podman_secret_info.yml' + - '.github/workflows/reusable-module-test.yml' - 'ci/*.yml' - 'ci/run_containers_tests.sh' - 'ci/playbooks/containers/podman_secret_info.yml' @@ -23,85 +25,8 @@ on: - cron: 4 0 * * * # Run daily at 0:03 UTC jobs: - test_podman_secret_info: - name: Podman secret info ${{ matrix.ansible-version }}-${{ matrix.os || 'ubuntu-22.04' }} - runs-on: ${{ matrix.os || 'ubuntu-22.04' }} - defaults: - run: - shell: bash - strategy: - fail-fast: false - matrix: - ansible-version: - - git+https://github.com/ansible/ansible.git@stable-2.18 - - git+https://github.com/ansible/ansible.git@devel - os: - - ubuntu-22.04 - python-version: - - "3.12" - - steps: - - - name: Check out repository - uses: actions/checkout@v4 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - - name: Upgrade pip and display Python and PIP versions - run: | - sudo apt-get update - sudo apt-get install -y python*-wheel python*-yaml - python -m pip install --upgrade pip - python -V - pip --version - - - name: Set up pip cache - uses: actions/cache@v4 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ github.ref }}-units-VMs - restore-keys: | - ${{ runner.os }}-pip- - ${{ runner.os }}- - - - name: Install Ansible ${{ matrix.ansible-version }} - run: python3 -m pip install --user --force-reinstall --upgrade '${{ matrix.ansible-version }}' - - - name: Build and install the collection tarball - run: | - export PATH=~/.local/bin:$PATH - - echo "Run ansible version" - command -v ansible - ansible --version - rm -rf /tmp/just_new_collection - ~/.local/bin/ansible-galaxy collection build --output-path /tmp/just_new_collection --force - ~/.local/bin/ansible-galaxy collection install -vvv --force /tmp/just_new_collection/*.tar.gz - - - name: Run collection tests for podman secret info - run: | - export PATH=~/.local/bin:$PATH - - export ANSIBLE_CONFIG=$(pwd)/ci/ansible-dev.cfg - if [[ '${{ matrix.ansible-version }}' == 'ansible<2.10' ]]; then - export ANSIBLE_CONFIG=$(pwd)/ci/ansible-2.9.cfg - fi - - echo $ANSIBLE_CONFIG - command -v ansible-playbook - pip --version - python --version - ansible-playbook --version - - ansible-playbook -vv ci/playbooks/pre.yml \ - -e host=localhost \ - -i localhost, \ - -e ansible_connection=local \ - -e setup_python=false - - TEST2RUN=podman_secret_info ./ci/run_containers_tests.sh - shell: bash + uses: ./.github/workflows/reusable-module-test.yml + with: + module_name: 'podman_secret_info' + display_name: 'Podman secret info' diff --git a/.github/workflows/podman_system_info.yml b/.github/workflows/podman_system_info.yml index d05673a..59db9c8 100644 --- a/.github/workflows/podman_system_info.yml +++ b/.github/workflows/podman_system_info.yml @@ -23,85 +23,8 @@ on: - cron: 4 0 * * * # Run daily at 0:03 UTC jobs: - test_podman_system_info: - name: Podman system info ${{ matrix.ansible-version }}-${{ matrix.os || 'ubuntu-22.04' }} - runs-on: ${{ matrix.os || 'ubuntu-22.04' }} - defaults: - run: - shell: bash - strategy: - fail-fast: false - matrix: - ansible-version: - - git+https://github.com/ansible/ansible.git@stable-2.18 - - git+https://github.com/ansible/ansible.git@devel - os: - - ubuntu-22.04 - python-version: - - "3.12" - - steps: - - - name: Check out repository - uses: actions/checkout@v4 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - - name: Upgrade pip and display Python and PIP versions - run: | - sudo apt-get update - sudo apt-get install -y python*-wheel python*-yaml - python -m pip install --upgrade pip - python -V - pip --version - - - name: Set up pip cache - uses: actions/cache@v4 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ github.ref }}-units-VMs - restore-keys: | - ${{ runner.os }}-pip- - ${{ runner.os }}- - - - name: Install Ansible ${{ matrix.ansible-version }} - run: python3 -m pip install --user --force-reinstall --upgrade '${{ matrix.ansible-version }}' - - - name: Build and install the collection tarball - run: | - export PATH=~/.local/bin:$PATH - - echo "Run ansible version" - command -v ansible - ansible --version - rm -rf /tmp/just_new_collection - ~/.local/bin/ansible-galaxy collection build --output-path /tmp/just_new_collection --force - ~/.local/bin/ansible-galaxy collection install -vvv --force /tmp/just_new_collection/*.tar.gz - - - name: Run collection tests for podman system info - run: | - export PATH=~/.local/bin:$PATH - - export ANSIBLE_CONFIG=$(pwd)/ci/ansible-dev.cfg - if [[ '${{ matrix.ansible-version }}' == 'ansible<2.10' ]]; then - export ANSIBLE_CONFIG=$(pwd)/ci/ansible-2.9.cfg - fi - - echo $ANSIBLE_CONFIG - command -v ansible-playbook - pip --version - python --version - ansible-playbook --version - - ansible-playbook -vv ci/playbooks/pre.yml \ - -e host=localhost \ - -i localhost, \ - -e ansible_connection=local \ - -e setup_python=false - - TEST2RUN=podman_system_info ./ci/run_containers_tests.sh - shell: bash + uses: ./.github/workflows/reusable-module-test.yml + with: + module_name: 'podman_system_info' + display_name: 'Podman system info' diff --git a/.github/workflows/podman_tag.yml b/.github/workflows/podman_tag.yml index 7e341d3..beee5d7 100644 --- a/.github/workflows/podman_tag.yml +++ b/.github/workflows/podman_tag.yml @@ -4,6 +4,7 @@ on: push: paths: - '.github/workflows/podman_tag.yml' + - '.github/workflows/reusable-module-test.yml' - 'ci/*.yml' - 'ci/run_containers_tests.sh' - 'ci/playbooks/containers/podman_tag.yml' @@ -14,6 +15,7 @@ on: pull_request: paths: - '.github/workflows/podman_tag.yml' + - '.github/workflows/reusable-module-test.yml' - 'ci/*.yml' - 'ci/run_containers_tests.sh' - 'ci/playbooks/containers/podman_tag.yml' @@ -23,84 +25,8 @@ on: - cron: 4 0 * * * # Run daily at 0:03 UTC jobs: - test_podman_tag: - name: Podman tag ${{ matrix.ansible-version }}-${{ matrix.os || 'ubuntu-22.04' }} - runs-on: ${{ matrix.os || 'ubuntu-22.04' }} - defaults: - run: - shell: bash - strategy: - fail-fast: false - matrix: - ansible-version: - - git+https://github.com/ansible/ansible.git@stable-2.18 - - git+https://github.com/ansible/ansible.git@devel - os: - - ubuntu-22.04 - python-version: - - "3.12" - - steps: - - - name: Check out repository - uses: actions/checkout@v4 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - - name: Upgrade pip and display Python and PIP versions - run: | - sudo apt-get update - sudo apt-get install -y python*-wheel python*-yaml - python -m pip install --upgrade pip - python -V - pip --version - - - name: Set up pip cache - uses: actions/cache@v4 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ github.ref }}-units-VMs - restore-keys: | - ${{ runner.os }}-pip- - ${{ runner.os }}- - - - name: Install Ansible ${{ matrix.ansible-version }} - run: python3 -m pip install --user --force-reinstall --upgrade '${{ matrix.ansible-version }}' - - - name: Build and install the collection tarball - run: | - rm -rf /tmp/just_new_collection - ~/.local/bin/ansible-galaxy collection build --output-path /tmp/just_new_collection --force - ~/.local/bin/ansible-galaxy collection install -vvv --force /tmp/just_new_collection/*.tar.gz - - - name: Run collection tests for podman tag - run: | - export PATH=~/.local/bin:$PATH - - echo "Run ansible version" - command -v ansible - ansible --version - - export ANSIBLE_CONFIG=$(pwd)/ci/ansible-dev.cfg - if [[ '${{ matrix.ansible-version }}' == 'ansible<2.10' ]]; then - export ANSIBLE_CONFIG=$(pwd)/ci/ansible-2.9.cfg - fi - - echo $ANSIBLE_CONFIG - command -v ansible-playbook - pip --version - python --version - ansible-playbook --version - - ansible-playbook -vv ci/playbooks/pre.yml \ - -e host=localhost \ - -i localhost, \ - -e ansible_connection=local \ - -e setup_python=false - - TEST2RUN=podman_tag ./ci/run_containers_tests.sh - shell: bash + uses: ./.github/workflows/reusable-module-test.yml + with: + module_name: 'podman_tag' + display_name: 'Podman tag' diff --git a/.github/workflows/podman_volume.yml b/.github/workflows/podman_volume.yml index e5b7fe7..a8c4c2c 100644 --- a/.github/workflows/podman_volume.yml +++ b/.github/workflows/podman_volume.yml @@ -4,6 +4,7 @@ on: push: paths: - '.github/workflows/podman_volume.yml' + - '.github/workflows/reusable-module-test.yml' - 'ci/*.yml' - 'ci/run_containers_tests.sh' - 'ci/playbooks/containers/podman_volume.yml' @@ -15,6 +16,7 @@ on: pull_request: paths: - '.github/workflows/podman_volume.yml' + - '.github/workflows/reusable-module-test.yml' - 'ci/*.yml' - 'ci/run_containers_tests.sh' - 'ci/playbooks/containers/podman_volume.yml' @@ -25,84 +27,8 @@ on: - cron: 4 0 * * * # Run daily at 0:03 UTC jobs: - test_podman_volume: - name: Podman volume ${{ matrix.ansible-version }}-${{ matrix.os || 'ubuntu-22.04' }} - runs-on: ${{ matrix.os || 'ubuntu-22.04' }} - defaults: - run: - shell: bash - strategy: - fail-fast: false - matrix: - ansible-version: - - git+https://github.com/ansible/ansible.git@stable-2.18 - - git+https://github.com/ansible/ansible.git@devel - os: - - ubuntu-22.04 - python-version: - - "3.12" - - steps: - - - name: Check out repository - uses: actions/checkout@v4 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - - name: Upgrade pip and display Python and PIP versions - run: | - sudo apt-get update - sudo apt-get install -y python*-wheel python*-yaml - python -m pip install --upgrade pip - python -V - pip --version - - - name: Set up pip cache - uses: actions/cache@v4 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ github.ref }}-units-VMs - restore-keys: | - ${{ runner.os }}-pip- - ${{ runner.os }}- - - - name: Install Ansible ${{ matrix.ansible-version }} - run: python3 -m pip install --user --force-reinstall --upgrade '${{ matrix.ansible-version }}' - - - name: Build and install the collection tarball - run: | - rm -rf /tmp/just_new_collection - ~/.local/bin/ansible-galaxy collection build --output-path /tmp/just_new_collection --force - ~/.local/bin/ansible-galaxy collection install -vvv --force /tmp/just_new_collection/*.tar.gz - - - name: Run collection tests for podman volume info - run: | - export PATH=~/.local/bin:$PATH - - echo "Run ansible version" - command -v ansible - ansible --version - - export ANSIBLE_CONFIG=$(pwd)/ci/ansible-dev.cfg - if [[ '${{ matrix.ansible-version }}' == 'ansible<2.10' ]]; then - export ANSIBLE_CONFIG=$(pwd)/ci/ansible-2.9.cfg - fi - - echo $ANSIBLE_CONFIG - command -v ansible-playbook - pip --version - python --version - ansible-playbook --version - - ansible-playbook -vv ci/playbooks/pre.yml \ - -e host=localhost \ - -i localhost, \ - -e ansible_connection=local \ - -e setup_python=false - - TEST2RUN=podman_volume ./ci/run_containers_tests.sh - shell: bash + uses: ./.github/workflows/reusable-module-test.yml + with: + module_name: 'podman_volume' + display_name: 'Podman volume' diff --git a/.github/workflows/podman_volume_info.yml b/.github/workflows/podman_volume_info.yml index f43dc2c..7e9a9f6 100644 --- a/.github/workflows/podman_volume_info.yml +++ b/.github/workflows/podman_volume_info.yml @@ -4,6 +4,7 @@ on: push: paths: - '.github/workflows/podman_volume_info.yml' + - '.github/workflows/reusable-module-test.yml' - 'ci/*.yml' - 'ci/run_containers_tests.sh' - 'ci/playbooks/containers/podman_volume_info.yml' @@ -15,6 +16,7 @@ on: pull_request: paths: - '.github/workflows/podman_volume_info.yml' + - '.github/workflows/reusable-module-test.yml' - 'ci/*.yml' - 'ci/run_containers_tests.sh' - 'ci/playbooks/containers/podman_volume_info.yml' @@ -25,84 +27,8 @@ on: - cron: 4 0 * * * # Run daily at 0:03 UTC jobs: - test_podman_volume_info: - name: Podman volume info ${{ matrix.ansible-version }}-${{ matrix.os || 'ubuntu-22.04' }} - runs-on: ${{ matrix.os || 'ubuntu-22.04' }} - defaults: - run: - shell: bash - strategy: - fail-fast: false - matrix: - ansible-version: - - git+https://github.com/ansible/ansible.git@stable-2.18 - - git+https://github.com/ansible/ansible.git@devel - os: - - ubuntu-22.04 - python-version: - - "3.12" - - steps: - - - name: Check out repository - uses: actions/checkout@v4 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - - name: Upgrade pip and display Python and PIP versions - run: | - sudo apt-get update - sudo apt-get install -y python*-wheel python*-yaml - python -m pip install --upgrade pip - python -V - pip --version - - - name: Set up pip cache - uses: actions/cache@v4 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ github.ref }}-units-VMs - restore-keys: | - ${{ runner.os }}-pip- - ${{ runner.os }}- - - - name: Install Ansible ${{ matrix.ansible-version }} - run: python3 -m pip install --user --force-reinstall --upgrade '${{ matrix.ansible-version }}' - - - name: Build and install the collection tarball - run: | - rm -rf /tmp/just_new_collection - ~/.local/bin/ansible-galaxy collection build --output-path /tmp/just_new_collection --force - ~/.local/bin/ansible-galaxy collection install -vvv --force /tmp/just_new_collection/*.tar.gz - - - name: Run collection tests for podman volume info - run: | - export PATH=~/.local/bin:$PATH - - echo "Run ansible version" - command -v ansible - ansible --version - - export ANSIBLE_CONFIG=$(pwd)/ci/ansible-dev.cfg - if [[ '${{ matrix.ansible-version }}' == 'ansible<2.10' ]]; then - export ANSIBLE_CONFIG=$(pwd)/ci/ansible-2.9.cfg - fi - - echo $ANSIBLE_CONFIG - command -v ansible-playbook - pip --version - python --version - ansible-playbook --version - - ansible-playbook -vv ci/playbooks/pre.yml \ - -e host=localhost \ - -i localhost, \ - -e ansible_connection=local \ - -e setup_python=false - - TEST2RUN=podman_volume_info ./ci/run_containers_tests.sh - shell: bash + uses: ./.github/workflows/reusable-module-test.yml + with: + module_name: 'podman_volume_info' + display_name: 'Podman volume info' diff --git a/.github/workflows/reusable-module-test.yml b/.github/workflows/reusable-module-test.yml new file mode 100644 index 0000000..4a5449c --- /dev/null +++ b/.github/workflows/reusable-module-test.yml @@ -0,0 +1,107 @@ +name: Reusable Module Test + +on: + workflow_call: + inputs: + module_name: + description: 'The name of the Podman module to test (e.g., podman_export)' + required: true + type: string + display_name: + description: 'Display name for the module (e.g., Podman export)' + required: false + type: string + default: '' + python_version: + description: 'Python version to use for testing' + required: false + type: string + default: '3.12' + os_matrix: + description: 'OS matrix as JSON string' + required: false + type: string + default: '["ubuntu-22.04"]' + ansible_versions: + description: 'Ansible versions matrix as JSON string' + required: false + type: string + default: '["git+https://github.com/ansible/ansible.git@stable-2.18", "git+https://github.com/ansible/ansible.git@devel"]' + +jobs: + test_module: + name: ${{ inputs.display_name || inputs.module_name }} ${{ matrix.ansible-version }}-${{ matrix.os || 'ubuntu-22.04' }} + runs-on: ${{ matrix.os || 'ubuntu-22.04' }} + defaults: + run: + shell: bash + strategy: + fail-fast: false + matrix: + ansible-version: ${{ fromJSON(inputs.ansible_versions) }} + os: ${{ fromJSON(inputs.os_matrix) }} + python-version: + - ${{ inputs.python_version }} + + steps: + - name: Check out repository + uses: actions/checkout@v4 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + - name: Upgrade pip and display Python and PIP versions + run: | + sudo apt-get update + sudo apt-get install -y python*-wheel python*-yaml + python -m pip install --upgrade pip + python -V + pip --version + + - name: Set up pip cache + uses: actions/cache@v4 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ github.ref }}-units-VMs + restore-keys: | + ${{ runner.os }}-pip- + ${{ runner.os }}- + + - name: Install Ansible ${{ matrix.ansible-version }} + run: python3 -m pip install --user --force-reinstall --upgrade '${{ matrix.ansible-version }}' + + - name: Build and install the collection tarball + run: | + rm -rf /tmp/just_new_collection + ~/.local/bin/ansible-galaxy collection build --output-path /tmp/just_new_collection --force + ~/.local/bin/ansible-galaxy collection install -vvv --force /tmp/just_new_collection/*.tar.gz + + - name: Run collection tests for ${{ inputs.module_name }} + run: | + export PATH=~/.local/bin:$PATH + + echo "Run ansible version" + command -v ansible + ansible --version + + export ANSIBLE_CONFIG=$(pwd)/ci/ansible-dev.cfg + if [[ '${{ matrix.ansible-version }}' == 'ansible<2.10' ]]; then + export ANSIBLE_CONFIG=$(pwd)/ci/ansible-2.9.cfg + fi + + echo $ANSIBLE_CONFIG + command -v ansible-playbook + pip --version + python --version + ansible-playbook --version + + ansible-playbook -vv ci/playbooks/pre.yml \ + -e host=localhost \ + -i localhost, \ + -e ansible_connection=local \ + -e setup_python=false + + TEST2RUN=${{ inputs.module_name }} ./ci/run_containers_tests.sh + shell: bash