.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>
This commit is contained in:
Felix Matouschek
2024-02-27 18:56:18 +01:00
parent b719edf5da
commit f92c500de4
5 changed files with 113 additions and 109 deletions

View File

@@ -1,4 +1,6 @@
---
name: Integration tests
# yamllint disable-line rule:truthy
on:
workflow_call:
inputs:
@@ -45,12 +47,13 @@ on:
type: string
jobs:
integration:
env:
PY_COLORS: "1"
source: "./source"
core: "./core"
cloud_common: "./cloudcommon"
ansible_posix: "./ansible_posix"
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:
@@ -68,43 +71,44 @@ jobs:
- "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 }}"
env:
source_directory: ./source
steps:
- name: Checkout kubevirt.core repository
if: inputs.ansible_test_targets != ''
uses: actions/checkout@v4
with:
path: ${{ env.source }}
path: ${{ env.source_directory }}
fetch-depth: 0
if: inputs.ansible_test_targets != ''
- name: install dependencies collection
- name: Install collection dependencies
if: inputs.ansible_test_targets != ''
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 != ''
ansible-galaxy collection install \
-r ${{ env.source_directory }}/requirements.yml \
-p /home/runner/collections --force-with-deps
- name: install kubevirt.core collection
id: install-collection
- 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 }}
if: inputs.ansible_test_targets != ''
source_path: ${{ env.source_directory }}
- name: install kind / kubectl
- name: Install kind / kubectl
if: inputs.ansible_test_targets != ''
uses: helm/kind-action@v1.9.0
with:
install_only: true
if: inputs.ansible_test_targets != ''
- name: deploy kubevirt
- name: Deploy kubevirt
if: inputs.ansible_test_targets != ''
shell: bash
run: >-
${{ env.source }}/hack/e2e-setup.sh \
${{ env.source_directory }}/hack/e2e-setup.sh \
-v \
--configure-inotify-limits \
--configure-secondary-network \
@@ -114,19 +118,18 @@ jobs:
--deploy-cnao \
--create-cluster \
--create-nad
shell: bash
env:
CLUSTER_NAME: kv-testing
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-collection.outputs.collection_path }}
collection_path: ${{ steps.install.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