1
0
Fork 0
mirror of https://github.com/containers/ansible-podman-collections.git synced 2026-02-04 07:11:49 +00:00

Add CI for podman_image, podman_image_info, podman_volume_info (#37)

This commit is contained in:
Sergey 2020-05-10 23:47:57 +03:00 committed by GitHub
parent 2e3dcfd7c5
commit 76add0a15b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 321 additions and 38 deletions

View file

@ -0,0 +1,101 @@
name: Podman container info
on:
push:
paths:
- '.github/workflows/podman_container_info.yml'
- 'ci/*.yml'
- 'ci/containers/podman_container_info.yml'
- 'plugins/modules/podman_container.py'
- 'plugins/modules/podman_container_info.py'
- 'tests/integration/targets/podman_container_info/**'
branches:
- master
pull_request:
paths:
- '.github/workflows/podman_container_info.yml'
- 'ci/*.yml'
- 'ci/containers/podman_container_info.yml'
- 'plugins/modules/podman_container.py'
- 'plugins/modules/podman_container_info.py'
- 'tests/integration/targets/podman_container_info/**'
schedule:
- cron: 4 0 * * * # Run daily at 0:03 UTC
jobs:
test_podman_container_info:
name: Podman container info ${{ matrix.ansible-version }}-${{ matrix.os.vm || 'ubuntu-latest' }}
runs-on: ${{ matrix.os.vm || 'ubuntu-latest' }}
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
ansible-version:
- ansible<2.10
- git+https://github.com/ansible/ansible.git@devel
os:
- vm: ubuntu-latest
python-version:
- 3.7
steps:
- name: Check out repository
uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Upgrade pip and display Python and PIP versions
run: |
python -m pip install --upgrade pip
python -V
pip --version
- name: Set up pip cache
uses: actions/cache@v1
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: python -m pip install --user '${{ 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
sudo ~/.local/bin/ansible-galaxy collection install -vvv --force /tmp/just_new_collection/*.tar.gz
- name: Run collection tests for connection
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
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

View file

@ -24,8 +24,8 @@ on:
jobs:
test_podman_container:
name: Podman container ${{ matrix.ansible-version }}-${{ matrix.os.vm || 'ubuntu-latest' }}
test_podman_image:
name: Podman image ${{ matrix.ansible-version }}-${{ matrix.os.vm || 'ubuntu-latest' }}
runs-on: ${{ matrix.os.vm || 'ubuntu-latest' }}
defaults:
run:

101
.github/workflows/podman_image_info.yml vendored Normal file
View file

@ -0,0 +1,101 @@
name: Podman image info
on:
push:
paths:
- '.github/workflows/podman_image_info.yml'
- 'ci/*.yml'
- 'ci/containers/podman_image_info.yml'
- 'plugins/modules/podman_image.py'
- 'plugins/modules/podman_image_info.py'
- 'tests/integration/targets/podman_image_info/**'
branches:
- master
pull_request:
paths:
- '.github/workflows/podman_image_info.yml'
- 'ci/*.yml'
- 'ci/containers/podman_image_info.yml'
- 'plugins/modules/podman_image.py'
- 'plugins/modules/podman_image_info.py'
- 'tests/integration/targets/podman_image_info/**'
schedule:
- cron: 4 0 * * * # Run daily at 0:03 UTC
jobs:
test_podman_image_info:
name: Podman image info ${{ matrix.ansible-version }}-${{ matrix.os.vm || 'ubuntu-latest' }}
runs-on: ${{ matrix.os.vm || 'ubuntu-latest' }}
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
ansible-version:
- ansible<2.10
- git+https://github.com/ansible/ansible.git@devel
os:
- vm: ubuntu-latest
python-version:
- 3.7
steps:
- name: Check out repository
uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Upgrade pip and display Python and PIP versions
run: |
python -m pip install --upgrade pip
python -V
pip --version
- name: Set up pip cache
uses: actions/cache@v1
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: python -m pip install --user '${{ 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
sudo ~/.local/bin/ansible-galaxy collection install -vvv --force /tmp/just_new_collection/*.tar.gz
- name: Run collection tests for connection
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
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

View file

@ -0,0 +1,99 @@
name: Podman volume info
on:
push:
paths:
- '.github/workflows/podman_volume_info.yml'
- 'ci/*.yml'
- 'ci/containers/podman_volume_info.yml'
- 'plugins/modules/podman_volume_info.py'
- 'tests/integration/targets/podman_volume_info/**'
branches:
- master
pull_request:
paths:
- '.github/workflows/podman_volume_info.yml'
- 'ci/*.yml'
- 'ci/containers/podman_volume_info.yml'
- 'plugins/modules/podman_volume_info.py'
- 'tests/integration/targets/podman_volume_info/**'
schedule:
- cron: 4 0 * * * # Run daily at 0:03 UTC
jobs:
test_podman_volume_info:
name: Podman volume info ${{ matrix.ansible-version }}-${{ matrix.os.vm || 'ubuntu-latest' }}
runs-on: ${{ matrix.os.vm || 'ubuntu-latest' }}
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
ansible-version:
- ansible<2.10
- git+https://github.com/ansible/ansible.git@devel
os:
- vm: ubuntu-latest
python-version:
- 3.7
steps:
- name: Check out repository
uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Upgrade pip and display Python and PIP versions
run: |
python -m pip install --upgrade pip
python -V
pip --version
- name: Set up pip cache
uses: actions/cache@v1
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: python -m pip install --user '${{ 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
sudo ~/.local/bin/ansible-galaxy collection install -vvv --force /tmp/just_new_collection/*.tar.gz
- name: Run collection tests for connection
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
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

View file

@ -0,0 +1,6 @@
---
- hosts: all
gather_facts: true
tasks:
- include_role:
name: podman_container_info

View file

@ -0,0 +1,6 @@
---
- hosts: all
gather_facts: true
tasks:
- include_role:
name: podman_image_info

View file

@ -0,0 +1,6 @@
---
- hosts: all
gather_facts: true
tasks:
- include_role:
name: podman_volume_info

View file

@ -1,5 +0,0 @@
shippable/posix/group2
skip/aix
skip/osx
skip/freebsd
destructive

View file

@ -1,2 +0,0 @@
dependencies:
- setup_podman

View file

@ -1,7 +1,4 @@
- name: Test podman_container_info
when:
- ansible_facts.virtualization_type != 'docker'
- ansible_facts.distribution == 'RedHat'
block:
- name: Generate random value for container name

View file

@ -1,5 +0,0 @@
shippable/posix/group2
skip/aix
skip/osx
skip/freebsd
destructive

View file

@ -1,2 +0,0 @@
dependencies:
- setup_podman

View file

@ -1,7 +1,4 @@
- name: Test podman_image_info
when:
- ansible_facts.virtualization_type != 'docker'
- ansible_facts.distribution == 'RedHat'
block:
- name: Pull image
command: podman pull quay.io/coreos/etcd

View file

@ -1,4 +0,0 @@
shippable/posix/group2
skip/osx
skip/freebsd
destructive

View file

@ -1,2 +0,0 @@
dependencies:
- setup_podman

View file

@ -1,5 +0,0 @@
shippable/posix/group2
skip/aix
skip/osx
skip/freebsd
destructive

View file

@ -1,2 +0,0 @@
dependencies:
- setup_podman

View file

@ -1,7 +1,4 @@
- name: Test podman_volume_info
when:
- ansible_facts.virtualization_type != 'docker'
- ansible_facts.distribution == 'RedHat'
block:
- name: Print podman version