| 1 |
# Ansible collection testing with ansible-test-gh-action |
| 2 |
# |
| 3 |
# Note: Integration tests are handled separately via Zuul due to their |
| 4 |
# complexity and duration. |
| 5 |
|
| 6 |
name: ansible-test |
| 7 |
|
| 8 |
on: [workflow_call] # allow this workflow to be called from other workflows |
| 9 |
|
| 10 |
jobs: |
| 11 |
sanity: |
| 12 |
runs-on: ubuntu-latest |
| 13 |
strategy: |
| 14 |
fail-fast: false |
| 15 |
matrix: |
| 16 |
ansible-core-version: |
| 17 |
- stable-2.17 |
| 18 |
- stable-2.18 |
| 19 |
- stable-2.19 |
| 20 |
- stable-2.20 |
| 21 |
- milestone |
| 22 |
- devel |
| 23 |
python-version: |
| 24 |
- "3.10" |
| 25 |
- "3.11" |
| 26 |
- "3.12" |
| 27 |
- "3.13" |
| 28 |
- "3.14" |
| 29 |
exclude: |
| 30 |
# devel and milestone don't support older Python versions |
| 31 |
- ansible-core-version: devel |
| 32 |
python-version: "3.10" |
| 33 |
- ansible-core-version: devel |
| 34 |
python-version: "3.11" |
| 35 |
- ansible-core-version: milestone |
| 36 |
python-version: "3.10" |
| 37 |
- ansible-core-version: milestone |
| 38 |
python-version: "3.11" |
| 39 |
# stable-2.20 excludes |
| 40 |
- ansible-core-version: stable-2.20 |
| 41 |
python-version: "3.10" |
| 42 |
- ansible-core-version: stable-2.20 |
| 43 |
python-version: "3.11" |
| 44 |
# stable-2.19 excludes |
| 45 |
- ansible-core-version: stable-2.19 |
| 46 |
python-version: "3.10" |
| 47 |
- ansible-core-version: stable-2.19 |
| 48 |
python-version: "3.14" |
| 49 |
# stable-2.18 excludes |
| 50 |
- ansible-core-version: stable-2.18 |
| 51 |
python-version: "3.10" |
| 52 |
- ansible-core-version: stable-2.18 |
| 53 |
python-version: "3.14" |
| 54 |
# stable-2.17 excludes |
| 55 |
- ansible-core-version: stable-2.17 |
| 56 |
python-version: "3.13" |
| 57 |
- ansible-core-version: stable-2.17 |
| 58 |
python-version: "3.14" |
| 59 |
steps: |
| 60 |
- name: Perform sanity testing |
| 61 |
uses: ansible-community/ansible-test-gh-action@d3a8ec7a59694e25e210fcd44738910149537f0e # v1.17.0 |
| 62 |
with: |
| 63 |
ansible-core-version: ${{ matrix.ansible-core-version }} |
| 64 |
testing-type: sanity |
| 65 |
target-python-version: ${{ matrix.python-version }} |
| 66 |
|
| 67 |
units: |
| 68 |
runs-on: ubuntu-latest |
| 69 |
strategy: |
| 70 |
fail-fast: false |
| 71 |
matrix: |
| 72 |
ansible-core-version: |
| 73 |
- stable-2.17 |
| 74 |
- stable-2.18 |
| 75 |
- stable-2.19 |
| 76 |
- stable-2.20 |
| 77 |
- milestone |
| 78 |
- devel |
| 79 |
python-version: |
| 80 |
- "3.10" |
| 81 |
- "3.11" |
| 82 |
- "3.12" |
| 83 |
- "3.13" |
| 84 |
- "3.14" |
| 85 |
exclude: |
| 86 |
# devel and milestone don't support older Python versions |
| 87 |
- ansible-core-version: devel |
| 88 |
python-version: "3.10" |
| 89 |
- ansible-core-version: devel |
| 90 |
python-version: "3.11" |
| 91 |
- ansible-core-version: milestone |
| 92 |
python-version: "3.10" |
| 93 |
- ansible-core-version: milestone |
| 94 |
python-version: "3.11" |
| 95 |
# stable-2.20 excludes |
| 96 |
- ansible-core-version: stable-2.20 |
| 97 |
python-version: "3.10" |
| 98 |
- ansible-core-version: stable-2.20 |
| 99 |
python-version: "3.11" |
| 100 |
# stable-2.19 excludes |
| 101 |
- ansible-core-version: stable-2.19 |
| 102 |
python-version: "3.10" |
| 103 |
- ansible-core-version: stable-2.19 |
| 104 |
python-version: "3.14" |
| 105 |
# stable-2.18 excludes |
| 106 |
- ansible-core-version: stable-2.18 |
| 107 |
python-version: "3.10" |
| 108 |
- ansible-core-version: stable-2.18 |
| 109 |
python-version: "3.14" |
| 110 |
# stable-2.17 excludes |
| 111 |
- ansible-core-version: stable-2.17 |
| 112 |
python-version: "3.13" |
| 113 |
- ansible-core-version: stable-2.17 |
| 114 |
python-version: "3.14" |
| 115 |
steps: |
| 116 |
- name: Perform unit testing |
| 117 |
uses: ansible-community/ansible-test-gh-action@d3a8ec7a59694e25e210fcd44738910149537f0e # v1.17.0 |
| 118 |
with: |
| 119 |
ansible-core-version: ${{ matrix.ansible-core-version }} |
| 120 |
testing-type: units |
| 121 |
target-python-version: ${{ matrix.python-version }} |
| 122 |
# test-deps: -r tests/unit/requirements.txt |