Skip to content

Commit 73af489

Browse files
authored
Prepare CI for Podman v3 backward compatibility (#528)
Signed-off-by: Sagi Shnaidman <[email protected]> Signed-off-by: Sagi Shnaidman <[email protected]>
1 parent 2498c52 commit 73af489

File tree

4 files changed

+27
-90
lines changed

4 files changed

+27
-90
lines changed

.github/workflows/podman_container.yml

Lines changed: 11 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ on:
3131
jobs:
3232

3333
test_podman_container:
34-
name: Podman container ${{ matrix.ansible-version }}-${{ matrix.os || 'ubuntu-22.04' }}
34+
name: Podman container ${{ matrix.ansible-version }}-${{ matrix.os || 'ubuntu-22.04' }}-${{ matrix.podman-version || 'unstable' }}
3535
runs-on: ${{ matrix.os || 'ubuntu-22.04' }}
3636
defaults:
3737
run:
@@ -41,13 +41,19 @@ jobs:
4141
matrix:
4242
ansible-version:
4343
- ansible<2.10
44-
- git+https://github.com/ansible/[email protected]
45-
- git+https://github.com/ansible/[email protected]
44+
- git+https://github.com/ansible/[email protected]
4645
- git+https://github.com/ansible/ansible.git@devel
4746
os:
4847
- ubuntu-22.04
4948
python-version:
5049
- 3.9
50+
podman-version:
51+
- unstable
52+
include:
53+
- os: ubuntu-22.04
54+
ansible-version: git+https://github.com/ansible/[email protected]
55+
python-version: 3.9
56+
podman-version: stable
5157

5258
steps:
5359

@@ -109,89 +115,8 @@ jobs:
109115
-e host=localhost \
110116
-i localhost, \
111117
-e ansible_connection=local \
112-
-e setup_python=false
113-
114-
TEST2RUN=podman_container ./ci/run_containers_tests.sh
115-
shell: bash
116-
117-
test_podman_container_with_pip:
118-
name: Podman container w/ pip ${{ matrix.ansible-version }}-${{ matrix.os || 'ubuntu-22.04' }}
119-
runs-on: ${{ matrix.os || 'ubuntu-22.04' }}
120-
defaults:
121-
run:
122-
shell: bash
123-
strategy:
124-
fail-fast: false
125-
matrix:
126-
ansible-version:
127-
- ansible<2.10
128-
#- git+https://github.com/ansible/[email protected]
129-
os:
130-
- ubuntu-22.04
131-
python-version:
132-
- 3.9
133-
134-
steps:
135-
136-
- name: Check out repository
137-
uses: actions/checkout@v3
138-
139-
- name: Set up Python ${{ matrix.python-version }}
140-
uses: actions/setup-python@v4
141-
with:
142-
python-version: ${{ matrix.python-version }}
143-
144-
- name: Upgrade pip and display Python and PIP versions
145-
run: |
146-
sudo apt-get update
147-
sudo apt-get install -y python*-wheel python*-yaml
148-
python -m pip install --upgrade pip
149-
python -V
150-
pip --version
151-
152-
- name: Set up pip cache
153-
uses: actions/cache@v3
154-
with:
155-
path: ~/.cache/pip
156-
key: ${{ runner.os }}-pip-${{ github.ref }}-units-VMs
157-
restore-keys: |
158-
${{ runner.os }}-pip-
159-
${{ runner.os }}-
160-
161-
- name: Install Ansible ${{ matrix.ansible-version }}
162-
run: python3 -m pip install --user --force-reinstall --upgrade '${{ matrix.ansible-version }}'
163-
164-
- name: Build and install the collection tarball
165-
run: |
166-
export PATH=~/.local/bin:$PATH
167-
168-
echo "Run ansible version"
169-
command -v ansible
170-
ansible --version
171-
python3 -m pip install --user --force-reinstall --upgrade .
172-
173-
174-
- name: Run collection tests for podman container
175-
run: |
176-
export PATH=~/.local/bin:$PATH
177-
export ANSIBLE_COLLECTIONS_PATHS=~/.local/share/ansible/collections
178-
179-
export ANSIBLE_CONFIG=$(pwd)/ci/ansible-dev.cfg
180-
if [[ '${{ matrix.ansible-version }}' == 'ansible<2.10' ]]; then
181-
export ANSIBLE_CONFIG=$(pwd)/ci/ansible-2.9.cfg
182-
fi
183-
184-
echo $ANSIBLE_CONFIG
185-
command -v ansible-playbook
186-
pip --version
187-
python --version
188-
ansible-playbook --version
189-
190-
ansible-playbook -vv ci/playbooks/pre.yml \
191-
-e host=localhost \
192-
-i localhost, \
193-
-e ansible_connection=local \
194-
-e setup_python=false
118+
-e setup_python=false \
119+
-e podman_version_ubuntu=${{ matrix.podman-version }}
195120
196121
TEST2RUN=podman_container ./ci/run_containers_tests.sh
197122
shell: bash

.github/workflows/podman_containers.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,7 @@ jobs:
4141
matrix:
4242
ansible-version:
4343
- ansible<2.10
44-
- git+https://github.com/ansible/[email protected]
45-
- git+https://github.com/ansible/[email protected]
44+
- git+https://github.com/ansible/[email protected]
4645
- git+https://github.com/ansible/ansible.git@devel
4746
os:
4847
- ubuntu-22.04

.github/workflows/podman_secret.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
matrix:
3838
ansible-version:
3939
- ansible<2.10
40-
- git+https://github.com/ansible/ansible.git@stable-2.12
40+
- git+https://github.com/ansible/ansible.git@stable-2.14
4141
- git+https://github.com/ansible/ansible.git@devel
4242
os:
4343
- ubuntu-22.04

ci/playbooks/install_repos.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,19 @@
44
shell: |
55
. /etc/os-release
66
echo "deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/unstable/xUbuntu_${VERSION_ID}/ /" > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list
7+
curl -L https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/unstable/xUbuntu_${VERSION_ID}/Release.key | apt-key add -
8+
apt-get update
9+
when:
10+
- ansible_distribution|lower == "ubuntu"
11+
- podman_version_ubuntu | default('unstable') == 'unstable'
12+
13+
- name: Install repo for ubuntu
14+
become: true
15+
shell: |
16+
. /etc/os-release
17+
echo "deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_${VERSION_ID}/ /" > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list
718
curl -L https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_${VERSION_ID}/Release.key | apt-key add -
819
apt-get update
9-
when: ansible_distribution|lower == "ubuntu"
20+
when:
21+
- ansible_distribution|lower == "ubuntu"
22+
- podman_version_ubuntu | default('unstable') == 'stable'

0 commit comments

Comments
 (0)