Files
kubevirt.core/.github/workflows/integration.yml
Felix Matouschek f92c500de4 .github: Cleanup actions
Cleanup the .github actions:

- Use the same syntax and/or commands where possible
- Drop unnecessary parameters and steps / commands
- In the all-green job ensure that all CI jobs passed
- Update the naming of jobs
- Review permissions and grant write permission only where
  necessary (repo is set to read-only by default)
- Review installed dependencies (try to fix the failing docs job)
- Run yamllint and fix findings
- Replace deprecated set-output syntax

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2024-02-28 17:04:54 +01:00

136 lines
3.9 KiB
YAML

---
name: Integration tests
# yamllint disable-line rule:truthy
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:
name: >-
${{ matrix.test-target }} /
py${{ matrix.python-version }} /
${{ matrix.ansible-version }}
runs-on: ubuntu-latest
continue-on-error: >-
${{ contains(fromJSON(inputs.unstable), matrix.ansible-version) }}
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) }}
env:
source_directory: ./source
steps:
- name: Checkout kubevirt.core repository
if: inputs.ansible_test_targets != ''
uses: actions/checkout@v4
with:
path: ${{ env.source_directory }}
fetch-depth: 0
- name: Install collection dependencies
if: inputs.ansible_test_targets != ''
run: |
ansible-galaxy collection install \
-r ${{ env.source_directory }}/requirements.yml \
-p /home/runner/collections --force-with-deps
- name: Install kubevirt.core collection
id: install
if: inputs.ansible_test_targets != ''
# yamllint disable-line rule:line-length
uses: ansible-network/github_actions/.github/actions/build_install_collection@main
with:
install_python_dependencies: true
source_path: ${{ env.source_directory }}
- name: Install kind / kubectl
if: inputs.ansible_test_targets != ''
uses: helm/kind-action@v1.9.0
with:
install_only: true
- name: Deploy kubevirt
if: inputs.ansible_test_targets != ''
shell: bash
run: >-
${{ env.source_directory }}/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
env:
KIND: kind
KUBECTL: kubectl
- name: Run integration tests
if: inputs.ansible_test_targets != ''
# yamllint disable-line rule:line-length
uses: ansible-network/github_actions/.github/actions/ansible_test_integration@main
with:
collection_path: ${{ steps.install.outputs.collection_path }}
python_version: ${{ matrix.python-version }}
ansible_version: ${{ matrix.ansible-version }}
ansible_test_targets: ${{ matrix.test-target }}
env:
ANSIBLE_COLLECTIONS_PATHS: /home/runner/collections