mirror of
https://github.com/kubevirt/kubevirt.core.git
synced 2026-03-27 03:13:10 +00:00
Update Ansible GitHub workflows
The workflows committed in the first commit were missing the installation of required dependencies and other fixes. Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
This commit is contained in:
266
.github/workflows/ci.yml
vendored
266
.github/workflows/ci.yml
vendored
@@ -7,6 +7,18 @@ on:
|
||||
schedule:
|
||||
- cron: '0 6 * * *'
|
||||
jobs:
|
||||
prereq:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
path: ansible_collections/kubernetes/kubevirt
|
||||
fetch-depth: 0
|
||||
- run: |
|
||||
mkdir -p /home/runner/.kube/
|
||||
cp -rp ${GITHUB_WORKSPACE}/ansible_collections/kubernetes/kubevirt/tests/.kubeconfig /home/runner/.kube/config
|
||||
cat /home/runner/.kube/config
|
||||
sanity:
|
||||
uses: ansible-network/github_actions/.github/workflows/sanity.yml@main
|
||||
with:
|
||||
@@ -71,50 +83,232 @@ jobs:
|
||||
{
|
||||
"ansible-version": "devel",
|
||||
"python-version": "3.8"
|
||||
},
|
||||
{
|
||||
"ansible-version": "devel",
|
||||
"python-version": "3.9"
|
||||
}
|
||||
]
|
||||
integration:
|
||||
unit-source:
|
||||
uses: ansible-network/github_actions/.github/workflows/unit_source.yml@main
|
||||
needs:
|
||||
- prereq
|
||||
with:
|
||||
matrix_exclude: >-
|
||||
[
|
||||
{
|
||||
"python-version": "3.11"
|
||||
},
|
||||
{
|
||||
"ansible-version": "stable-2.12",
|
||||
"python-version": "3.7"
|
||||
},
|
||||
{
|
||||
"ansible-version": "stable-2.13",
|
||||
"python-version": "3.7"
|
||||
},
|
||||
{
|
||||
"ansible-version": "stable-2.12",
|
||||
"python-version": "3.8"
|
||||
},
|
||||
{
|
||||
"ansible-version": "stable-2.13",
|
||||
"python-version": "3.8"
|
||||
},
|
||||
{
|
||||
"ansible-version": "stable-2.14",
|
||||
"python-version": "3.7"
|
||||
},
|
||||
{
|
||||
"ansible-version": "stable-2.14",
|
||||
"python-version": "3.8"
|
||||
},
|
||||
{
|
||||
"ansible-version": "stable-2.15",
|
||||
"python-version": "3.7"
|
||||
},
|
||||
{
|
||||
"ansible-version": "stable-2.15",
|
||||
"python-version": "3.8"
|
||||
},
|
||||
{
|
||||
"ansible-version": "milestone",
|
||||
"python-version": "3.7"
|
||||
},
|
||||
{
|
||||
"ansible-version": "milestone",
|
||||
"python-version": "3.8"
|
||||
},
|
||||
{
|
||||
"ansible-version": "devel",
|
||||
"python-version": "3.7"
|
||||
},
|
||||
{
|
||||
"ansible-version": "devel",
|
||||
"python-version": "3.8"
|
||||
},
|
||||
{
|
||||
"ansible-version": "devel",
|
||||
"python-version": "3.9"
|
||||
}
|
||||
]
|
||||
collection_pre_install: ''
|
||||
splitter:
|
||||
env:
|
||||
source_dir: "./source"
|
||||
runs-on: ubuntu-latest
|
||||
name: I (${{ matrix.ansible }}+py${{ matrix.python }})
|
||||
outputs:
|
||||
test_targets: ${{ steps.display.outputs.test_targets }}
|
||||
steps:
|
||||
- name: Checkout the collection repository
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
path: ${{ env.source_dir }}
|
||||
fetch-depth: "0"
|
||||
|
||||
- name: list changes for pull request
|
||||
id: splitter
|
||||
uses: ansible-network/github_actions/.github/actions/ansible_test_splitter@main
|
||||
with:
|
||||
collections_to_test: ${{ env.source_dir }}
|
||||
total_jobs: 8
|
||||
|
||||
- name: display targets
|
||||
id: display
|
||||
run: echo "test_targets=${{ steps.splitter.outputs.test_targets }}" >> $GITHUB_OUTPUT
|
||||
shell: bash
|
||||
|
||||
integration:
|
||||
needs:
|
||||
- splitter
|
||||
env:
|
||||
source: "./source"
|
||||
cloud_common: "./cloudcommon"
|
||||
ansible_posix: "./ansible_posix"
|
||||
test_targets: ${{ needs.splitter.outputs.test_targets }}
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 60
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
ansible:
|
||||
- stable-2.9
|
||||
- stable-2.11
|
||||
ansible-version:
|
||||
- stable-2.12
|
||||
- stable-2.13
|
||||
- milestone
|
||||
- devel
|
||||
python:
|
||||
- '3.8'
|
||||
- '3.9'
|
||||
- '3.10'
|
||||
python-version:
|
||||
- "3.8"
|
||||
- "3.9"
|
||||
exclude:
|
||||
# Because ansible-test doesn't support Python 3.9 for Ansible 2.9
|
||||
# and Python 3.10 is supported in 2.12 or later.
|
||||
- ansible: stable-2.9
|
||||
python: '3.9'
|
||||
- ansible: stable-2.9
|
||||
python: '3.10'
|
||||
- ansible: stable-2.10
|
||||
python: '3.10'
|
||||
- ansible: stable-2.11
|
||||
python: '3.10'
|
||||
|
||||
- ansible-version: stable-2.9
|
||||
python-version: 3.9
|
||||
- ansible-version: stable-2.9
|
||||
python-version: 3.10
|
||||
- ansible-version: stable-2.9
|
||||
python-version: 3.11
|
||||
- ansible-version: stable-2.12
|
||||
python-version: 3.11
|
||||
- ansible-version: stable-2.13
|
||||
python-version: 3.11
|
||||
- ansible-version: stable-2.14
|
||||
python-version: 3.8
|
||||
- ansible-version: stable-2.15
|
||||
python-version: 3.8
|
||||
- ansible-version: milestone
|
||||
python-version: 3.8
|
||||
- ansible-version: devel
|
||||
python-version: 3.8
|
||||
enable-turbo-mode:
|
||||
- true
|
||||
- false
|
||||
job-index: [1, 2, 3, 4, 5, 6, 7, 8]
|
||||
name: "integration-py${{ matrix.python-version }}-${{ matrix.ansible-version }}-turbo-mode=${{ matrix.enable-turbo-mode }}-${{ matrix.job-index }}"
|
||||
steps:
|
||||
- name: >-
|
||||
Perform integration testing against
|
||||
Ansible version ${{ matrix.ansible }}
|
||||
under Python ${{ matrix.python }}
|
||||
uses: ansible-community/ansible-test-gh-action@release/v1
|
||||
- name: Read ansible-test targets
|
||||
id: read-targets
|
||||
run: >-
|
||||
echo "ansible_test_targets=$(echo "${{ env.test_targets }}" | sed s/';'/'\n'/g |
|
||||
grep "kubernetes.core-${{ matrix.job-index }}" | cut -d ':' -f2 | sed s/','/' '/g)" >> $GITHUB_OUTPUT
|
||||
shell: bash
|
||||
|
||||
- name: Display targets
|
||||
run: >-
|
||||
echo "targets to test: $ANSIBLE_TARGETS"
|
||||
shell: bash
|
||||
env:
|
||||
ANSIBLE_TARGETS: ${{ steps.read-targets.outputs.ansible_test_targets }}
|
||||
|
||||
- name: Checkout kubernetes.core repository
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
ansible-core-version: ${{ matrix.ansible }}
|
||||
# OPTIONAL command to run before invoking `ansible-test integration`
|
||||
# pre-test-cmd:
|
||||
target-python-version: ${{ matrix.python }}
|
||||
testing-type: integration
|
||||
# OPTIONAL If your integration tests require code
|
||||
# from other collections, install them like this
|
||||
test-deps: >-
|
||||
ansible.netcommon
|
||||
kubernetes.core
|
||||
path: ${{ env.source }}
|
||||
fetch-depth: "0"
|
||||
if: steps.read-targets.outputs.ansible_test_targets != ''
|
||||
|
||||
- name: checkout ansible-collections/cloud.common
|
||||
uses: ansible-network/github_actions/.github/actions/checkout_dependency@main
|
||||
with:
|
||||
repository: ansible-collections/cloud.common
|
||||
path: ${{ env.cloud_common }}
|
||||
ref: main
|
||||
if: steps.read-targets.outputs.ansible_test_targets != ''
|
||||
|
||||
- name: checkout ansible-collections/ansible.posix
|
||||
uses: ansible-network/github_actions/.github/actions/checkout_dependency@main
|
||||
with:
|
||||
repository: ansible-collections/ansible.posix
|
||||
path: ${{ env.ansible_posix }}
|
||||
ref: main
|
||||
if: steps.read-targets.outputs.ansible_test_targets != ''
|
||||
|
||||
- name: install kubernetes.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: steps.read-targets.outputs.ansible_test_targets != ''
|
||||
|
||||
- name: install cloud.common collection
|
||||
uses: ansible-network/github_actions/.github/actions/build_install_collection@main
|
||||
with:
|
||||
install_python_dependencies: true
|
||||
source_path: ${{ env.cloud_common }}
|
||||
if: steps.read-targets.outputs.ansible_test_targets != ''
|
||||
|
||||
- name: install ansible.posix collection
|
||||
uses: ansible-network/github_actions/.github/actions/build_install_collection@main
|
||||
with:
|
||||
install_python_dependencies: true
|
||||
source_path: ${{ env.ansible_posix }}
|
||||
if: steps.read-targets.outputs.ansible_test_targets != ''
|
||||
|
||||
- name: create kubernetes cluster
|
||||
uses: helm/kind-action@v1.4.0
|
||||
if: steps.read-targets.outputs.ansible_test_targets != ''
|
||||
|
||||
- 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: ${{ steps.read-targets.outputs.ansible_test_targets }}
|
||||
ansible_test_environment: |
|
||||
ENABLE_TURBO_MODE=${{ matrix.enable-turbo-mode }}
|
||||
if: steps.read-targets.outputs.ansible_test_targets != ''
|
||||
all_green:
|
||||
if: ${{ always() }}
|
||||
needs:
|
||||
- sanity
|
||||
- unit-source
|
||||
- integration
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- run: >-
|
||||
python -c "assert set([
|
||||
'${{ needs.unit-source.result }}',
|
||||
'${{ needs.integration.result }}'
|
||||
]) == {'success'}"
|
||||
- run: >-
|
||||
python -c "assert '${{ needs.sanity.result }}'
|
||||
in ['success', 'failure']"
|
||||
|
||||
5
.github/workflows/docs.yml
vendored
5
.github/workflows/docs.yml
vendored
@@ -48,10 +48,7 @@ jobs:
|
||||
- name: Create default collection path
|
||||
run: |
|
||||
mkdir -p /home/runner/.ansible/
|
||||
cp -rp /home/runner/work/kubevirt/kubevirt/ansible_collections /home/runner/.ansible/collections/
|
||||
ls -l /home/runner/.ansible/collections/ansible_collections/
|
||||
ls -l /home/runner/.ansible/collections/ansible_collections/kubernetes/
|
||||
ls -l /home/runner/.ansible/collections/ansible_collections/kubernetes/kubevirt/
|
||||
cp -rp ${GITHUB_WORKSPACE}/ansible_collections /home/runner/.ansible/collections/
|
||||
|
||||
- name: Create changelog and documentation
|
||||
uses: ansible-middleware/collection-docs-action@main
|
||||
|
||||
Reference in New Issue
Block a user