diff --git a/.github/workflows/podman_system_info.yml b/.github/workflows/podman_system_info.yml new file mode 100644 index 0000000..5693211 --- /dev/null +++ b/.github/workflows/podman_system_info.yml @@ -0,0 +1,105 @@ +name: Podman system info + +on: + push: + paths: + - '.github/workflows/podman_system_info.yml' + - 'ci/*.yml' + - 'ci/run_containers_tests.sh' + - 'ci/playbooks/containers/podman_system_info.yml' + - 'plugins/modules/podman_system_info.py' + branches: + - main + pull_request: + paths: + - '.github/workflows/podman_system_info.yml' + - 'ci/*.yml' + - 'ci/run_containers_tests.sh' + - 'ci/playbooks/containers/podman_system_info.yml' + - 'plugins/modules/podman_system_info.py' + schedule: + - 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.17 + - git+https://github.com/ansible/ansible.git@devel + os: + - ubuntu-22.04 + python-version: + - "3.11" + + 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 diff --git a/tests/integration/targets/podman_system_info/tasks/main.yml b/tests/integration/targets/podman_system_info/tasks/main.yml index 1b5c0b0..9071b59 100644 --- a/tests/integration/targets/podman_system_info/tasks/main.yml +++ b/tests/integration/targets/podman_system_info/tasks/main.yml @@ -1,3 +1,8 @@ - name: Get Podman system info containers.podman.podman_system_info: - register: podman_info \ No newline at end of file + register: podman_info + +- name: Check results + assert: + that: + - podman_info.podman_system_info | length > 0