mirror of
https://github.com/containers/ansible-podman-collections.git
synced 2026-02-04 07:11:49 +00:00
121 lines
4.1 KiB
YAML
121 lines
4.1 KiB
YAML
name: Podman API container
|
|
|
|
on:
|
|
push:
|
|
paths:
|
|
- '.github/workflows/podman_container_api.yml'
|
|
- 'ci/*.yml'
|
|
- 'ci/run_containers_tests.sh'
|
|
- 'ci/playbooks/containers/podman_container_api.yml'
|
|
#- 'plugins/modules/podman_container.py'
|
|
- 'plugins/module_utils/podman/podman_container_lib.py'
|
|
- 'plugins/module_utils/podman/podman_api.py'
|
|
- 'plugins/module_utils/podman/common.py'
|
|
- 'tests/integration/targets/podman_container_api/**'
|
|
branches:
|
|
- master
|
|
pull_request:
|
|
paths:
|
|
- '.github/workflows/podman_container_api.yml'
|
|
- 'ci/*.yml'
|
|
- 'ci/run_containers_tests.sh'
|
|
- 'ci/playbooks/containers/podman_container_api.yml'
|
|
#- 'plugins/modules/podman_container.py'
|
|
- 'plugins/module_utils/podman/podman_container_lib.py'
|
|
- 'plugins/module_utils/podman/podman_api.py'
|
|
- 'plugins/module_utils/podman/common.py'
|
|
- 'tests/integration/targets/podman_container_api/**'
|
|
schedule:
|
|
- cron: 4 0 * * * # Run daily at 0:03 UTC
|
|
|
|
jobs:
|
|
|
|
test_podman_container_api:
|
|
name: Podman API container ${{ matrix.ansible-version }}-${{ matrix.os || 'ubuntu-22.04' }}-${{ matrix.podman-version || 'unstable' }}
|
|
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"
|
|
podman-version:
|
|
- unstable
|
|
|
|
steps:
|
|
|
|
- name: Check out repository
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Set up Python ${{ matrix.python-version }}
|
|
uses: actions/setup-python@v4
|
|
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@v3
|
|
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 container API
|
|
run: |
|
|
export PATH=~/.local/bin:$PATH
|
|
|
|
if [[ '${{ matrix.ansible-version }}' == 'git+https://github.com/ansible/ansible.git@devel' ]]; then
|
|
export ANSIBLE_CONFIG=$(pwd)/ci/ansible-dev.cfg
|
|
elif [[ '${{ matrix.ansible-version }}' == 'ansible<2.10' ]]; then
|
|
export ANSIBLE_CONFIG=$(pwd)/ci/ansible-2.9.cfg
|
|
fi
|
|
python3 -m pip install --user -r requirements.txt
|
|
podman system service --time=0 unix:///tmp/podman.sock &
|
|
sudo podman system service --time=0 unix:///tmp/root-podman.sock &
|
|
podman system service --time=0 tcp:localhost:25771 &
|
|
|
|
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 \
|
|
-e podman_version_ubuntu=${{ matrix.podman-version }}
|
|
|
|
TEST2RUN=podman_container_api ./ci/run_containers_tests.sh
|
|
shell: bash
|