| 1 |
--- |
| 2 |
# Always check ansible-core support matrix before configuring units matrix. |
| 3 |
# https://docs.ansible.com/ansible/latest/reference_appendices/release_and_maintenance.html#ansible-core-support-matrix |
| 4 |
|
| 5 |
name: CI |
| 6 |
on: |
| 7 |
push: |
| 8 |
branches: |
| 9 |
- main |
| 10 |
- dev |
| 11 |
|
| 12 |
pull_request: |
| 13 |
|
| 14 |
# Run CI once per day (at 06:00 UTC) |
| 15 |
# This ensures that even if there haven't been commits that we are still testing against latest version of ansible-test for each ansible-base version |
| 16 |
schedule: |
| 17 |
- cron: '0 6 * * *' |
| 18 |
|
| 19 |
workflow_dispatch: |
| 20 |
|
| 21 |
jobs: |
| 22 |
sanity-supported: |
| 23 |
runs-on: ubuntu-latest |
| 24 |
name: Sanity (Supported Ⓐ${{ matrix.ansible }}) |
| 25 |
strategy: |
| 26 |
fail-fast: false # Disabled so we can see all failed combinations. |
| 27 |
# Define a build matrix to test compatibility across multiple Ansible versions. |
| 28 |
# Each version listed below will spawn a separate job that runs in parallel. |
| 29 |
matrix: |
| 30 |
ansible: |
| 31 |
# Supported versions (must pass) |
| 32 |
- 'stable-2.18' # Python 3.11 - 3.13 |
| 33 |
- 'stable-2.19' # Python 3.11 - 3.13 |
| 34 |
- 'devel' # Test against the upcoming development version. |
| 35 |
steps: |
| 36 |
- uses: actions/checkout@v5 |
| 37 |
|
| 38 |
- name: ansible-test - sanity |
| 39 |
uses: ansible-community/ansible-test-gh-action@release/v1 |
| 40 |
with: |
| 41 |
ansible-core-version: ${{ matrix.ansible }} |
| 42 |
testing-type: sanity |
| 43 |
|
| 44 |
|
| 45 |
sanity-eol: |
| 46 |
runs-on: ubuntu-latest |
| 47 |
# This job only runs if the supported tests pass |
| 48 |
needs: sanity-supported |
| 49 |
name: Sanity (EOL Ⓐ${{ matrix.ansible }}) |
| 50 |
continue-on-error: true # This entire job is allowed to fail |
| 51 |
strategy: |
| 52 |
fail-fast: false # Disabled so we can see all failed combinations. |
| 53 |
# Define a build matrix to test compatibility across multiple Ansible versions. |
| 54 |
# Each version listed below will spawn a separate job that runs in parallel. |
| 55 |
matrix: |
| 56 |
ansible: |
| 57 |
# EOL versions (allowed to fail) |
| 58 |
# NOTE: Ensure that meta/runtime.yml `requires_ansible` version is aligned with tested versions. |
| 59 |
- 'stable-2.14' # Python 3.9 - 3.11 |
| 60 |
- 'stable-2.15' # Python 3.9 - 3.11 |
| 61 |
- 'stable-2.16' # Python 3.10 - 3.12 |
| 62 |
- 'stable-2.17' # Python 3.10 - 3.12 |
| 63 |
steps: |
| 64 |
- uses: actions/checkout@v5 |
| 65 |
|
| 66 |
- name: ansible-test - sanity |
| 67 |
uses: ansible-community/ansible-test-gh-action@release/v1 |
| 68 |
with: |
| 69 |
ansible-core-version: ${{ matrix.ansible }} |
| 70 |
testing-type: sanity |
| 71 |
|
| 72 |
units-supported: |
| 73 |
runs-on: ubuntu-latest |
| 74 |
name: Units (Supported Ⓐ${{ matrix.ansible }}+py${{ matrix.python }}) |
| 75 |
strategy: |
| 76 |
fail-fast: false # Disabled so we can see all failed combinations. |
| 77 |
# Define a build matrix to test compatibility across multiple Ansible versions. |
| 78 |
# Each version listed below will spawn a separate job that runs in parallel. |
| 79 |
matrix: |
| 80 |
ansible: |
| 81 |
- 'stable-2.18' # Python 3.11 - 3.13 |
| 82 |
- 'stable-2.19' # Python 3.11 - 3.13 |
| 83 |
- 'devel' # Test against the upcoming development version. |
| 84 |
python: |
| 85 |
- '3.11' |
| 86 |
- '3.12' |
| 87 |
- '3.13' |
| 88 |
|
| 89 |
steps: |
| 90 |
- uses: actions/checkout@v5 |
| 91 |
|
| 92 |
- name: ansible-test - units |
| 93 |
uses: ansible-community/ansible-test-gh-action@release/v1 |
| 94 |
with: |
| 95 |
ansible-core-version: ${{ matrix.ansible }} |
| 96 |
target-python-version: ${{ matrix.python }} |
| 97 |
testing-type: units |
| 98 |
|
| 99 |
units-eol: |
| 100 |
runs-on: ubuntu-latest |
| 101 |
# This job only runs if the supported tests pass |
| 102 |
needs: units-supported |
| 103 |
name: Units (EOL Ⓐ${{ matrix.ansible }}+py${{ matrix.python }}) |
| 104 |
continue-on-error: true # This entire job is allowed to fail |
| 105 |
strategy: |
| 106 |
fail-fast: false # Disabled so we can see all failed combinations. |
| 107 |
# Define a build matrix to test compatibility across multiple Ansible versions. |
| 108 |
# Each version listed below will spawn a separate job that runs in parallel. |
| 109 |
matrix: |
| 110 |
ansible: |
| 111 |
- 'stable-2.14' # Python 3.9 - 3.11 |
| 112 |
- 'stable-2.15' # Python 3.9 - 3.11 |
| 113 |
- 'stable-2.16' # Python 3.10 - 3.12 |
| 114 |
- 'stable-2.17' # Python 3.10 - 3.12 |
| 115 |
python: |
| 116 |
- '3.9' |
| 117 |
- '3.10' |
| 118 |
- '3.11' |
| 119 |
- '3.12' |
| 120 |
exclude: |
| 121 |
# Exclusions for incompatible Python versions. |
| 122 |
- ansible: 'stable-2.14' |
| 123 |
python: '3.12' |
| 124 |
|
| 125 |
- ansible: 'stable-2.15' |
| 126 |
python: '3.12' |
| 127 |
|
| 128 |
- ansible: 'stable-2.16' |
| 129 |
python: '3.9' |
| 130 |
|
| 131 |
- ansible: 'stable-2.17' |
| 132 |
python: '3.9' |
| 133 |
|
| 134 |
steps: |
| 135 |
- uses: actions/checkout@v5 |
| 136 |
|
| 137 |
- name: ansible-test - units |
| 138 |
uses: ansible-community/ansible-test-gh-action@release/v1 |
| 139 |
with: |
| 140 |
ansible-core-version: ${{ matrix.ansible }} |
| 141 |
target-python-version: ${{ matrix.python }} |
| 142 |
testing-type: units |
| 143 |
|
| 144 |
# Please consult the Readme for information on why we disabled integration tests temporarily. |