Files
kubevirt.core/.github/workflows/integration.yml
Felix Matouschek b719edf5da .github: Update tested Ansible and Python versions
Use Python 3.9 - 3.12 and Ansible 2.14 - 2.16, devel and milestone to run
tests of the collection. Use the latest stable python version in test setups
where sensible. Instead of using the integration.yml workflog from main
use it from the same commit as the test runs instead.

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2024-02-28 09:14:23 +01:00

133 lines
4.0 KiB
YAML

name: Integration tests
on:
workflow_call:
inputs:
matrix_exclude:
default: >-
[
{
"ansible-version": "stable-2.14",
"python-version": "3.12"
},
{
"ansible-version": "stable-2.15",
"python-version": "3.12"
},
{
"ansible-version": "stable-2.16",
"python-version": "3.9"
},
{
"ansible-version": "milestone",
"python-version": "3.9"
},
{
"ansible-version": "devel",
"python-version": "3.9"
}
]
required: false
type: string
matrix_include:
default: >-
[]
required: false
type: string
unstable:
default: >-
[
"devel",
]
required: false
type: string
ansible_test_targets:
required: true
type: string
jobs:
integration:
env:
PY_COLORS: "1"
source: "./source"
core: "./core"
cloud_common: "./cloudcommon"
ansible_posix: "./ansible_posix"
strategy:
fail-fast: false
matrix:
test-target: ${{ fromJSON(inputs.ansible_test_targets) }}
ansible-version:
- stable-2.14
- stable-2.15
- stable-2.16
- milestone
- devel
python-version:
- "3.9"
- "3.10"
- "3.11"
- "3.12"
exclude: ${{ fromJSON(inputs.matrix_exclude) }}
include: ${{ fromJSON(inputs.matrix_include) }}
runs-on: ubuntu-latest
continue-on-error: ${{ contains(fromJSON(inputs.unstable), matrix.ansible-version) }}
name: "${{ matrix.test-target }} / py${{ matrix.python-version }} / ${{ matrix.ansible-version }}"
steps:
- name: Checkout kubevirt.core repository
uses: actions/checkout@v4
with:
path: ${{ env.source }}
fetch-depth: 0
if: inputs.ansible_test_targets != ''
- name: install dependencies collection
run: |
ansible-galaxy collection install ansible.posix --force --pre -p /home/runner/collections
ansible-galaxy collection install cloud.common --force --pre -p /home/runner/collections
ansible-galaxy collection install kubernetes.core --force --pre -p /home/runner/collections
if: inputs.ansible_test_targets != ''
- name: install kubevirt.core collection
id: install-collection
uses: ansible-network/github_actions/.github/actions/build_install_collection@main
with:
install_python_dependencies: true
source_path: ${{ env.source }}
if: inputs.ansible_test_targets != ''
- name: install kind / kubectl
uses: helm/kind-action@v1.9.0
with:
install_only: true
if: inputs.ansible_test_targets != ''
- name: deploy kubevirt
if: inputs.ansible_test_targets != ''
run: >-
${{ env.source }}/hack/e2e-setup.sh \
-v \
--configure-inotify-limits \
--configure-secondary-network \
--deploy-kubevirt \
--deploy-kubevirt-cdi \
--deploy-kubevirt-common-instancetypes \
--deploy-cnao \
--create-cluster \
--create-nad
shell: bash
env:
CLUSTER_NAME: kv-testing
KIND: kind
KUBECTL: kubectl
- name: Run integration tests
uses: ansible-network/github_actions/.github/actions/ansible_test_integration@main
with:
collection_path: ${{ steps.install-collection.outputs.collection_path }}
python_version: ${{ matrix.python-version }}
ansible_version: ${{ matrix.ansible-version }}
ansible_test_targets: ${{ matrix.test-target }}
if: inputs.ansible_test_targets != ''
env:
ANSIBLE_COLLECTIONS_PATHS: /home/runner/collections