Skip to content

Commit 20a01a9

Browse files
committed
ci: several changes related to new qemu test, ansible-lint, python versions, ubuntu versions
There is a new QEMU based test which uses the qemu/kvm capability of github action runners. This is the basis for new bootc/image mode tests which we will be rolling out in the near future. ansible-lint requires that the collection path is set so that the requirements it installs are installed in the correct place. There has been some general github action deprecation of python versions and ubuntu versions that we have had to fix. Remove `CONTRIBUTOR` from the list of users who can trigger citest. For more information, see * linux-system-roles/.github#98 * linux-system-roles/.github#94 * linux-system-roles/.github#93 * linux-system-roles/.github#92 * linux-system-roles/.github#91 Signed-off-by: Rich Megginson <[email protected]>
1 parent ebae5cd commit 20a01a9

File tree

7 files changed

+72
-26
lines changed

7 files changed

+72
-26
lines changed

.github/workflows/ansible-lint.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
- name: Install tox, tox-lsr
3333
run: |
3434
set -euxo pipefail
35-
pip3 install "git+https://github.com/linux-system-roles/tox-lsr@3.4.0"
35+
pip3 install "git+https://github.com/linux-system-roles/tox-lsr@3.5.1"
3636
3737
- name: Convert role to collection format
3838
id: collection
@@ -80,3 +80,5 @@ jobs:
8080
with:
8181
working_directory: ${{ github.workspace }}/.tox/ansible_collections/${{ env.LSR_ROLE2COLL_NAMESPACE }}/${{ env.LSR_ROLE2COLL_NAME }}
8282
requirements_file: ${{ steps.collection.outputs.coll_req_file }}
83+
env:
84+
ANSIBLE_COLLECTIONS_PATH: ${{ github.workspace }}/.tox

.github/workflows/ansible-managed-var-comment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
- name: Install tox, tox-lsr
3131
run: |
3232
set -euxo pipefail
33-
pip3 install "git+https://github.com/linux-system-roles/tox-lsr@3.4.0"
33+
pip3 install "git+https://github.com/linux-system-roles/tox-lsr@3.5.1"
3434
3535
- name: Run ansible-plugin-scan
3636
run: |

.github/workflows/ansible-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
- name: Install tox, tox-lsr
3434
run: |
3535
set -euxo pipefail
36-
pip3 install "git+https://github.com/linux-system-roles/tox-lsr@3.4.0"
36+
pip3 install "git+https://github.com/linux-system-roles/tox-lsr@3.5.1"
3737
3838
- name: Convert role to collection format
3939
run: |

.github/workflows/qemu-kvm-integration-tests.yml

Lines changed: 64 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -11,75 +11,119 @@ on: # yamllint disable-line rule:truthy
1111
branches:
1212
- main
1313
workflow_dispatch:
14-
env:
15-
TOX_ENV: qemu-ansible-core-2.16
1614

1715
permissions:
1816
contents: read
17+
# This is required for the ability to create/update the Pull request status
18+
statuses: write
1919
jobs:
20-
tox:
20+
qemu_kvm:
2121
runs-on: ubuntu-latest
2222

2323
strategy:
2424
fail-fast: false
2525
matrix:
26-
image:
27-
- centos-9
28-
- centos-10
26+
scenario:
27+
- { image: "centos-9", env: "qemu-ansible-core-2.16" }
28+
- { image: "centos-10", env: "qemu-ansible-core-2.17" }
2929
# ansible/libdnf5 bug: https://issues.redhat.com/browse/RHELMISC-10110
30-
# - fedora-41
31-
- fedora-42
32-
30+
# - { image: "fedora-41", env: "qemu-ansible-core-2.17" }
31+
- { image: "fedora-42", env: "qemu-ansible-core-2.17" }
3332
steps:
33+
- name: Checkout repo
34+
uses: actions/checkout@v4
35+
36+
- name: Check if platform is supported
37+
id: check_platform
38+
run: |
39+
set -euxo pipefail
40+
image="${{ matrix.scenario.image }}"
41+
42+
# convert image to tag formats
43+
platform=
44+
platform_version=
45+
case "$image" in
46+
centos-*) platform=el; platform_version=el"${image#centos-}" ;;
47+
fedora-*) platform=fedora; platform_version="${image/-/}" ;;
48+
esac
49+
supported=
50+
if yq -e '.galaxy_info.galaxy_tags[] | select(. == "'${platform_version}'" or . == "'${platform}'")' meta/main.yml; then
51+
supported=true
52+
fi
53+
54+
echo "supported=$supported" >> "$GITHUB_OUTPUT"
55+
3456
- name: Set up /dev/kvm
57+
if: steps.check_platform.outputs.supported
3558
run: |
3659
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm.rules
3760
sudo udevadm control --reload-rules
3861
sudo udevadm trigger --name-match=kvm --settle
3962
ls -l /dev/kvm
4063
4164
- name: Disable man-db to speed up package install
65+
if: steps.check_platform.outputs.supported
4266
run: |
4367
echo "set man-db/auto-update false" | sudo debconf-communicate
4468
sudo dpkg-reconfigure man-db
4569
4670
- name: Install test dependencies
71+
if: steps.check_platform.outputs.supported
4772
run: |
4873
set -euxo pipefail
4974
python3 -m pip install --upgrade pip
5075
sudo apt update
5176
sudo apt install -y --no-install-recommends git ansible-core genisoimage qemu-system-x86
5277
pip3 install "git+https://github.com/linux-system-roles/[email protected]"
5378
54-
- name: Checkout repo
55-
uses: actions/checkout@v4
56-
5779
- name: Configure tox-lsr
58-
run: |
59-
curl -o ~/.config/linux-system-roles.json https://raw.githubusercontent.com/linux-system-roles/linux-system-roles.github.io/master/download/linux-system-roles.json
80+
if: steps.check_platform.outputs.supported
81+
run: >-
82+
curl -o ~/.config/linux-system-roles.json
83+
https://raw.githubusercontent.com/linux-system-roles/linux-system-roles.github.io/master/download/linux-system-roles.json
6084
61-
- name: Run tox integration tests
62-
run: tox -e ${{ env.TOX_ENV }} -- --image-name ${{ matrix.image }} --make-batch --log-level=debug --
85+
- name: Run qemu/kvm tox integration tests
86+
if: steps.check_platform.outputs.supported
87+
run: >-
88+
tox -e ${{ matrix.scenario.env }} -- --image-name ${{ matrix.scenario.image }} --make-batch
89+
--log-level=debug --skip-tags tests::infiniband --
6390
6491
- name: Test result summary
65-
if: always()
92+
if: steps.check_platform.outputs.supported && always()
6693
run: |
6794
set -euo pipefail
68-
while read code start end f; do
95+
# some platforms may have setup/cleanup playbooks - need to find the
96+
# actual test playbook that starts with tests_
97+
while read code start end test_files; do
98+
for f in $test_files; do
99+
f="$(basename $f)"
100+
if [[ "$f" =~ ^tests_ ]]; then
101+
break
102+
fi
103+
done
69104
if [ "$code" = "0" ]; then
70105
echo -n "PASS: "
71106
else
72107
echo -n "FAIL: "
73108
fi
74-
echo "$(basename $f)"
109+
echo "$f"
75110
done < batch.report
76111
77112
- name: Show test logs on failure
78-
if: failure()
113+
if: steps.check_platform.outputs.supported && failure()
79114
run: |
80115
set -euo pipefail
81116
for f in tests/*.log; do
82117
echo "::group::$(basename $f)"
83118
cat "$f"
84119
echo "::endgroup::"
85120
done
121+
122+
- name: Set commit status as success with a description that platform is skipped
123+
if: ${{ steps.check_platform.outputs.supported == '' }}
124+
uses: myrotvorets/set-commit-status-action@master
125+
with:
126+
status: success
127+
context: "${{ github.workflow }} / qemu_kvm (${{ matrix.scenario.image }}, ${{ matrix.scenario.env }}) (pull_request)"
128+
description: The role does not support this platform. Skipping.
129+
targetUrl: ""

.github/workflows/tft.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
if: |
2222
github.event.issue.pull_request
2323
&& contains(github.event.comment.body, '[citest]')
24-
&& (contains(fromJson('["OWNER", "MEMBER", "COLLABORATOR", "CONTRIBUTOR"]'), github.event.comment.author_association)
24+
&& (contains(fromJson('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.comment.author_association)
2525
|| contains('systemroller', github.event.comment.user.login))
2626
runs-on: ubuntu-latest
2727
outputs:

.github/workflows/tft_citest_bad.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
if: |
1212
github.event.issue.pull_request
1313
&& contains(fromJson('["[citest_bad]", "[citest-bad]", "[citest bad]"]'), github.event.comment.body)
14-
&& contains(fromJson('["OWNER", "MEMBER", "COLLABORATOR", "CONTRIBUTOR"]'), github.event.comment.author_association)
14+
&& contains(fromJson('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.comment.author_association)
1515
permissions:
1616
actions: write # for re-running failed jobs: https://docs.github.com/en/rest/actions/workflow-runs?apiVersion=2022-11-28#re-run-a-job-from-a-workflow-run
1717
runs-on: ubuntu-latest

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,4 +463,4 @@ See README-ostree.md
463463
MIT
464464

465465
Based on [Ansible-sudoers](https://github.com/ahuffman/ansible-sudoers).
466-
[![ansible-lint.yml](https://github.com/linux-system-roles/sudo/actions/workflows/ansible-lint.yml/badge.svg)](https://github.com/linux-system-roles/sudo/actions/workflows/ansible-lint.yml) [![ansible-test.yml](https://github.com/linux-system-roles/sudo/actions/workflows/ansible-test.yml/badge.svg)](https://github.com/linux-system-roles/sudo/actions/workflows/ansible-test.yml) [![codeql.yml](https://github.com/linux-system-roles/sudo/actions/workflows/codeql.yml/badge.svg)](https://github.com/linux-system-roles/sudo/actions/workflows/codeql.yml) [![codespell.yml](https://github.com/linux-system-roles/sudo/actions/workflows/codespell.yml/badge.svg)](https://github.com/linux-system-roles/sudo/actions/workflows/codespell.yml) [![markdownlint.yml](https://github.com/linux-system-roles/sudo/actions/workflows/markdownlint.yml/badge.svg)](https://github.com/linux-system-roles/sudo/actions/workflows/markdownlint.yml) [![python-unit-test.yml](https://github.com/linux-system-roles/sudo/actions/workflows/python-unit-test.yml/badge.svg)](https://github.com/linux-system-roles/sudo/actions/workflows/python-unit-test.yml) [![shellcheck.yml](https://github.com/linux-system-roles/sudo/actions/workflows/shellcheck.yml/badge.svg)](https://github.com/linux-system-roles/sudo/actions/workflows/shellcheck.yml) [![tft.yml](https://github.com/linux-system-roles/sudo/actions/workflows/tft.yml/badge.svg)](https://github.com/linux-system-roles/sudo/actions/workflows/tft.yml) [![tft_citest_bad.yml](https://github.com/linux-system-roles/sudo/actions/workflows/tft_citest_bad.yml/badge.svg)](https://github.com/linux-system-roles/sudo/actions/workflows/tft_citest_bad.yml) [![woke.yml](https://github.com/linux-system-roles/sudo/actions/workflows/woke.yml/badge.svg)](https://github.com/linux-system-roles/sudo/actions/workflows/woke.yml)
466+
[![ansible-lint.yml](https://github.com/linux-system-roles/sudo/actions/workflows/ansible-lint.yml/badge.svg)](https://github.com/linux-system-roles/sudo/actions/workflows/ansible-lint.yml) [![ansible-test.yml](https://github.com/linux-system-roles/sudo/actions/workflows/ansible-test.yml/badge.svg)](https://github.com/linux-system-roles/sudo/actions/workflows/ansible-test.yml) [![codeql.yml](https://github.com/linux-system-roles/sudo/actions/workflows/codeql.yml/badge.svg)](https://github.com/linux-system-roles/sudo/actions/workflows/codeql.yml) [![codespell.yml](https://github.com/linux-system-roles/sudo/actions/workflows/codespell.yml/badge.svg)](https://github.com/linux-system-roles/sudo/actions/workflows/codespell.yml) [![markdownlint.yml](https://github.com/linux-system-roles/sudo/actions/workflows/markdownlint.yml/badge.svg)](https://github.com/linux-system-roles/sudo/actions/workflows/markdownlint.yml) [![python-unit-test.yml](https://github.com/linux-system-roles/sudo/actions/workflows/python-unit-test.yml/badge.svg)](https://github.com/linux-system-roles/sudo/actions/workflows/python-unit-test.yml) [![qemu-kvm-integration-tests.yml](https://github.com/linux-system-roles/sudo/actions/workflows/qemu-kvm-integration-tests.yml/badge.svg)](https://github.com/linux-system-roles/sudo/actions/workflows/qemu-kvm-integration-tests.yml) [![shellcheck.yml](https://github.com/linux-system-roles/sudo/actions/workflows/shellcheck.yml/badge.svg)](https://github.com/linux-system-roles/sudo/actions/workflows/shellcheck.yml) [![tft.yml](https://github.com/linux-system-roles/sudo/actions/workflows/tft.yml/badge.svg)](https://github.com/linux-system-roles/sudo/actions/workflows/tft.yml) [![tft_citest_bad.yml](https://github.com/linux-system-roles/sudo/actions/workflows/tft_citest_bad.yml/badge.svg)](https://github.com/linux-system-roles/sudo/actions/workflows/tft_citest_bad.yml) [![woke.yml](https://github.com/linux-system-roles/sudo/actions/workflows/woke.yml/badge.svg)](https://github.com/linux-system-roles/sudo/actions/workflows/woke.yml)

0 commit comments

Comments
 (0)