CI #222
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.9" | |
}, | |
{ | |
"ansible-version": "stable-2.12", | |
"python-version": "3.7" | |
}, | |
{ | |
"ansible-version": "stable-2.12", | |
"python-version": "3.11" | |
}, | |
{ | |
"ansible-version": "stable-2.13", | |
"python-version": "3.7" | |
}, | |
{ | |
"ansible-version": "stable-2.13", | |
"python-version": "3.11" | |
}, | |
{ | |
"ansible-version": "stable-2.14", | |
"python-version": "3.7" | |
}, | |
{ | |
"ansible-version": "stable-2.14", | |
"python-version": "3.8" | |
}, | |
{ | |
"ansible-version": "stable-2.14", | |
"python-version": "3.11" | |
}, | |
{ | |
"ansible-version": "stable-2.15", | |
"python-version": "3.7" | |
}, | |
{ | |
"ansible-version": "stable-2.15", | |
"python-version": "3.8" | |
}, | |
{ | |
"ansible-version": "stable-2.15", | |
"python-version": "3.11" | |
}, | |
{ | |
"ansible-version": "milestone", | |
"python-version": "3.7" | |
}, | |
{ | |
"ansible-version": "milestone", | |
"python-version": "3.8" | |
}, | |
{ | |
"ansible-version": "milestone", | |
"python-version": "3.9" | |
}, | |
{ | |
"ansible-version": "devel", | |
"python-version": "3.7" | |
}, | |
{ | |
"ansible-version": "devel", | |
"python-version": "3.8" | |
}, | |
{ | |
"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: >- | |
[ | |
{ | |
"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": "milestone", | |
"python-version": "3.9" | |
}, | |
{ | |
"ansible-version": "devel", | |
"python-version": "3.7" | |
}, | |
{ | |
"ansible-version": "devel", | |
"python-version": "3.8" | |
}, | |
{ | |
"ansible-version": "devel", | |
"python-version": "3.9" | |
} | |
] | |
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']" |