Skip to content

Commit 47f94ea

Browse files
committed
add workflow for podman_system_info module
Signed-off-by: johnsonlien <[email protected]>
1 parent 22d8381 commit 47f94ea

File tree

2 files changed

+111
-1
lines changed

2 files changed

+111
-1
lines changed
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
name: Podman system info
2+
3+
on:
4+
push:
5+
paths:
6+
- '.github/workflows/podman_system_info.yml'
7+
- 'ci/*.yml'
8+
- 'ci/run_containers_tests.sh'
9+
- 'ci/playbooks/containers/podman_system_info.yml'
10+
- 'plugins/modules/podman_system_info.py'
11+
branches:
12+
- main
13+
pull_request:
14+
paths:
15+
- '.github/workflows/podman_system_info.yml'
16+
- 'ci/*.yml'
17+
- 'ci/run_containers_tests.sh'
18+
- 'ci/playbooks/containers/podman_system_info.yml'
19+
- 'plugins/modules/podman_system_info.py'
20+
schedule:
21+
- cron: 4 0 * * * # Run daily at 0:03 UTC
22+
23+
jobs:
24+
25+
test_podman_system_info:
26+
name: Podman system info ${{ matrix.ansible-version }}-${{ matrix.os || 'ubuntu-22.04' }}
27+
runs-on: ${{ matrix.os || 'ubuntu-22.04' }}
28+
defaults:
29+
run:
30+
shell: bash
31+
strategy:
32+
fail-fast: false
33+
matrix:
34+
ansible-version:
35+
- git+https://github.com/ansible/[email protected]
36+
- git+https://github.com/ansible/ansible.git@devel
37+
os:
38+
- ubuntu-22.04
39+
python-version:
40+
- "3.11"
41+
42+
steps:
43+
44+
- name: Check out repository
45+
uses: actions/checkout@v4
46+
47+
- name: Set up Python ${{ matrix.python-version }}
48+
uses: actions/setup-python@v5
49+
with:
50+
python-version: ${{ matrix.python-version }}
51+
52+
- name: Upgrade pip and display Python and PIP versions
53+
run: |
54+
sudo apt-get update
55+
sudo apt-get install -y python*-wheel python*-yaml
56+
python -m pip install --upgrade pip
57+
python -V
58+
pip --version
59+
60+
- name: Set up pip cache
61+
uses: actions/cache@v4
62+
with:
63+
path: ~/.cache/pip
64+
key: ${{ runner.os }}-pip-${{ github.ref }}-units-VMs
65+
restore-keys: |
66+
${{ runner.os }}-pip-
67+
${{ runner.os }}-
68+
69+
- name: Install Ansible ${{ matrix.ansible-version }}
70+
run: python3 -m pip install --user --force-reinstall --upgrade '${{ matrix.ansible-version }}'
71+
72+
- name: Build and install the collection tarball
73+
run: |
74+
export PATH=~/.local/bin:$PATH
75+
76+
echo "Run ansible version"
77+
command -v ansible
78+
ansible --version
79+
rm -rf /tmp/just_new_collection
80+
~/.local/bin/ansible-galaxy collection build --output-path /tmp/just_new_collection --force
81+
~/.local/bin/ansible-galaxy collection install -vvv --force /tmp/just_new_collection/*.tar.gz
82+
83+
- name: Run collection tests for podman system info
84+
run: |
85+
export PATH=~/.local/bin:$PATH
86+
87+
export ANSIBLE_CONFIG=$(pwd)/ci/ansible-dev.cfg
88+
if [[ '${{ matrix.ansible-version }}' == 'ansible<2.10' ]]; then
89+
export ANSIBLE_CONFIG=$(pwd)/ci/ansible-2.9.cfg
90+
fi
91+
92+
echo $ANSIBLE_CONFIG
93+
command -v ansible-playbook
94+
pip --version
95+
python --version
96+
ansible-playbook --version
97+
98+
ansible-playbook -vv ci/playbooks/pre.yml \
99+
-e host=localhost \
100+
-i localhost, \
101+
-e ansible_connection=local \
102+
-e setup_python=false
103+
104+
TEST2RUN=podman_system_info ./ci/run_containers_tests.sh
105+
shell: bash
Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
11
- name: Get Podman system info
22
containers.podman.podman_system_info:
3-
register: podman_info
3+
register: podman_info
4+
5+
- name: Check results
6+
assert:
7+
that:
8+
- podman_info.podman_system_info | length > 0

0 commit comments

Comments
 (0)