Files
kubevirt.core/.github/workflows/ci.yml
Guido Grazioli 44d8a4f64a make sanity and unit matrix the same
Signed-off-by: Guido Grazioli <ggraziol@redhat.com>
2023-11-29 09:39:58 +01:00

129 lines
3.1 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@v3
with:
path: ansible_collections/kubevirt/core
fetch-depth: 0
- run: |
mkdir -p /home/runner/.kube/
cp -rp ${GITHUB_WORKSPACE}/ansible_collections/kubevirt/core/tests/.kubeconfig /home/runner/.kube/config
cat /home/runner/.kube/config
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
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.12"
},
{
"ansible-version": "stable-2.13"
},
{
"python-version": "3.7"
},
{
"python-version": "3.8"
},
{
"python-version": "3.9"
},
{
"python-version": "3.10"
},
{
"python-version": "3.12"
}
]
unit-source:
uses: ansible-network/github_actions/.github/workflows/unit_source.yml@main
needs:
- linter
with:
matrix_exclude: >-
[
{
"ansible-version": "stable-2.12"
},
{
"ansible-version": "stable-2.13"
},
{
"python-version": "3.7"
},
{
"python-version": "3.8"
},
{
"python-version": "3.9"
},
{
"python-version": "3.10"
},
{
"python-version": "3.12"
}
]
collection_pre_install: ''
integration:
uses: kubevirt/kubevirt.core/.github/workflows/integration.yml@main
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']"