From 1395f12c5eebf11b0001598de4eb6a15c2a4bd7a Mon Sep 17 00:00:00 2001 From: Florian Haas Date: Thu, 5 Mar 2026 12:26:50 +0100 Subject: [PATCH 1/3] build: Expand tox test matrix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add more tox environments, expanding the test coverage as follows: * Ansible Core versions 2.18–2.20 (these are the versions currently supported upstream), and 2.16 (this is the version packaged in the latest Ubuntu LTS) * OpenStack clients matching OpenStack Epoxy and Flamingo (these are the two most recent OpenStack releases), and Caracal (packaged in the latest Ubuntu LTS). As of tox 4.47.1, if a testenv factor is a bare version number, and that version number starts with 2 or 3, tox looks for a Python interpreter matching that version. Thus, if a testenv name includes the string "ansible-2.19", it looks for a Python interpreter for the 2.19 version (which never existed). This is intentional behaviour in tox, and will not be fixed. Therefore, name the testenvs "ansible2.19" (etc.), without the hyphen. References: https://docs.ansible.com/projects/ansible/latest/reference_appendices/release_and_maintenance.html#ansible-core-support-matrix https://packages.ubuntu.com/noble/ansible-core https://releases.openstack.org/ https://packages.ubuntu.com/noble/python3-openstackclient https://packages.ubuntu.com/noble/python3-heatclient https://packages.ubuntu.com/noble/python3-openstacksdk https://github.com/tox-dev/tox/issues/3850#issuecomment-3994284059 --- tox.ini | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/tox.ini b/tox.ini index ccd3d13..8c9e1a5 100644 --- a/tox.ini +++ b/tox.ini @@ -30,6 +30,17 @@ commands = ansible-galaxy collection install -r {toxinidir}/ansible/requirements.yaml ansible-lint {toxinidir}/ansible/build.yaml {toxinidir}/ansible/teardown.yaml {posargs} +[testenv:ansible{2.16,2.18,2.19,2.20}-lint] +deps = + ansible2.16: ansible-core<2.17 + ansible2.18: ansible-core<2.19 + ansible2.19: ansible-core<2.20 + ansible2.20: ansible-core<2.21 + ansible-lint +commands = + ansible-galaxy collection install -r {toxinidir}/ansible/requirements.yaml + ansible-lint {toxinidir}/ansible/build.yaml {toxinidir}/ansible/teardown.yaml {posargs} + [testenv:ansible-playbook] passenv = OS_* deps = -r {toxinidir}/ansible/requirements.txt @@ -37,8 +48,41 @@ commands = ansible-galaxy collection install -r {toxinidir}/ansible/requirements.yaml ansible-playbook {posargs} +[testenv:ansible{2.16,2.18,2.19,2.20}-playbook-{epoxy,flamingo}] +passenv = OS_* +deps = + ansible2.18: ansible-core<2.19 + ansible2.19: ansible-core<2.20 + ansible2.20: ansible-core<2.21 + epoxy: openstacksdk<4.5 + flamingo: openstacksdk<4.8 +commands = + ansible-galaxy collection install -r {toxinidir}/ansible/requirements.yaml + ansible-playbook {posargs} + +[testenv:ansible{2.16}-playbook-{caracal}] +passenv = OS_* +deps = + ansible2.16: ansible-core<2.17 + caracal: openstacksdk<3.1 +commands = + ansible-galaxy collection install -r {toxinidir}/ansible/requirements.yaml + ansible-playbook {posargs} + [testenv:openstack] passenv = OS_* deps = -r {toxinidir}/heat/requirements.txt commands = openstack {posargs} + +[testenv:openstack-{caracal,epoxy,flamingo}] +passenv = OS_* +deps = + caracal: python-openstackclient<7.0 + caracal: python-heatclient<4.0 + epoxy: python-openstackclient<8.0 + epoxy: python-heatclient<4.3 + flamingo: python-openstackclient<8.3 + flamingo: python-heatclient<5.0 +commands = + openstack {posargs} From be96ff5b3456e8a5a2a65bbf82c72fa2fef864dd Mon Sep 17 00:00:00 2001 From: Florian Haas Date: Thu, 5 Mar 2026 13:53:31 +0100 Subject: [PATCH 2/3] build: Update CI pipeline Add coverage for multiple ansible-core versions. --- .gitlab-ci.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index cad1b48..a065a4b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -14,10 +14,17 @@ lint: - tox -e gitlint - tox -e yamllint,markdownlint -test-tox: +test-ansible: stage: test script: - - tox + - "tox -e ansible${VERSION}-lint" + parallel: + matrix: + - VERSION: + - "2.20" + - "2.19" + - "2.18" + - "2.16" test-tf: stage: test From 5d35435455929e33167cbe36810f7c8cc084dc41 Mon Sep 17 00:00:00 2001 From: Florian Haas Date: Thu, 5 Mar 2026 15:13:10 +0100 Subject: [PATCH 3/3] build: Streamline GitHub Actions and GitLab CI pipeline * Add the same matrix for Ansible Core releases as in the GitLab pipeline * Split "build" and "test" jobs as in the GitLab pipeline --- .github/workflows/build.yml | 26 ++--------------- .github/workflows/test.yml | 57 +++++++++++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+), 24 deletions(-) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2642d38..0718876 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,6 +1,6 @@ --- jobs: - test-tox: + lint: runs-on: "ubuntu-latest" steps: - name: "Check out code" @@ -19,29 +19,7 @@ jobs: - name: "Test with tox" run: | tox -e gitlint - tox - - test-tf: - runs-on: "ubuntu-latest" - steps: - - name: "Check out code" - uses: "actions/checkout@v6" - - name: "Set up OpenTofu" - uses: "opentofu/setup-opentofu@v1" - with: - tofu_version: "${{ matrix.tofu_version }}" - - name: "Test configuration" - run: | - tofu version - tofu -chdir=tf init - tofu -chdir=tf validate - strategy: - fail-fast: true - matrix: - tofu_version: - - "1.11" - - "1.10" - - "1.9" + tox -e yamllint,markdownlint name: build diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..4ce52b4 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,57 @@ +--- +jobs: + test-ansible: + runs-on: "ubuntu-latest" + steps: + - name: "Check out code" + uses: "actions/checkout@v6" + with: + # Checkout a pull request's HEAD commit instead of the merge + # commit, so that gitlint lints the correct commit message. + ref: "${{ github.event.pull_request.head.sha }}" + - name: "Set up Python 3.13" + uses: "actions/setup-python@v6" + with: + python-version: "3.13" + - name: "Install Python dependencies" + run: | + pip install tox + - name: "Test with tox" + run: | + tox -e ansible${{ matrix.ansible_version }}-lint + strategy: + fail-fast: true + matrix: + ansible_version: + - "2.20" + - "2.19" + - "2.18" + - "2.16" + + test-tf: + runs-on: "ubuntu-latest" + steps: + - name: "Check out code" + uses: "actions/checkout@v6" + - name: "Set up OpenTofu" + uses: "opentofu/setup-opentofu@v1" + with: + tofu_version: "${{ matrix.tofu_version }}" + - name: "Test configuration" + run: | + tofu version + tofu -chdir=tf init + tofu -chdir=tf validate + strategy: + fail-fast: true + matrix: + tofu_version: + - "1.11" + - "1.10" + - "1.9" + +name: test + +'on': + pull_request: {} + push: {}