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: {} 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 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}