mirror of
https://github.com/kubevirt/kubevirt.core.git
synced 2026-03-26 19:03:16 +00:00
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>
138 lines
3.4 KiB
YAML
138 lines
3.4 KiB
YAML
name: CI
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
|
cancel-in-progress: true
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
pull_request:
|
|
workflow_dispatch:
|
|
schedule:
|
|
- cron: '0 6 * * *'
|
|
jobs:
|
|
linter:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Check out code
|
|
uses: actions/checkout@v4
|
|
with:
|
|
path: ansible_collections/kubevirt/core
|
|
fetch-depth: 0
|
|
- run: |
|
|
mkdir -p /home/runner/.kube/
|
|
cat <<- EOF > /home/runner/.kube/config
|
|
apiVersion: v1
|
|
kind: Config
|
|
clusters:
|
|
- cluster:
|
|
server: http://localhost:12345
|
|
name: default
|
|
contexts:
|
|
- context:
|
|
cluster: default
|
|
name: default
|
|
current-context: default
|
|
EOF
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: 3.x
|
|
cache: pip
|
|
- name: Install yamllint, ansible
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install yamllint ansible-core ansible-lint
|
|
- name: Run linter
|
|
run: |
|
|
ansible-lint --version
|
|
ansible-lint -v
|
|
working-directory: ./ansible_collections/kubevirt/core
|
|
sanity:
|
|
uses: ansible-network/github_actions/.github/workflows/sanity.yml@main
|
|
needs:
|
|
- linter
|
|
with:
|
|
matrix_include: "[]"
|
|
matrix_exclude: >-
|
|
[
|
|
{
|
|
"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"
|
|
}
|
|
]
|
|
unit-source:
|
|
uses: ansible-network/github_actions/.github/workflows/unit_source.yml@main
|
|
needs:
|
|
- linter
|
|
with:
|
|
matrix_exclude: >-
|
|
[
|
|
{
|
|
"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"
|
|
}
|
|
]
|
|
collection_pre_install: ''
|
|
integration:
|
|
uses: ./.github/workflows/integration.yml
|
|
needs:
|
|
- linter
|
|
with:
|
|
ansible_test_targets: >-
|
|
[
|
|
"kubevirt_vm",
|
|
"kubevirt_vm_info",
|
|
"inventory_kubevirt"
|
|
]
|
|
name: "integration"
|
|
|
|
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']"
|