| 1 |
# README FIRST |
| 2 |
# 1. If you don't have unit tests, remove that section. |
| 3 |
# 2. If your collection depends on other collections ensure they are installed, |
| 4 |
# add them to the "test-deps" input. |
| 5 |
# 3. For the comprehensive list of the inputs supported by the |
| 6 |
# ansible-community/ansible-test-gh-action GitHub Action, see |
| 7 |
# https://github.com/marketplace/actions/ansible-test. |
| 8 |
# 4. If you need help please ask in #ansible-community on the Libera.chat IRC |
| 9 |
# network. |
| 10 |
|
| 11 |
name: CI |
| 12 |
on: |
| 13 |
# Run CI against all pushes (direct commits, also merged PRs), Pull Requests |
| 14 |
push: |
| 15 |
branches: |
| 16 |
- main |
| 17 |
- stable-* |
| 18 |
pull_request: |
| 19 |
# Run CI once every Sunday (at 06:00 UTC) |
| 20 |
# This ensures that even if there haven't been commits that we are still |
| 21 |
# testing against latest version of ansible-test for each ansible-core |
| 22 |
# version |
| 23 |
schedule: |
| 24 |
- cron: "0 6 * * 0" |
| 25 |
# manual |
| 26 |
workflow_dispatch: |
| 27 |
|
| 28 |
jobs: |
| 29 |
### |
| 30 |
# Sanity tests (REQUIRED) |
| 31 |
# |
| 32 |
# https://docs.ansible.com/ansible/latest/dev_guide/testing_sanity.html |
| 33 |
|
| 34 |
sanity: |
| 35 |
name: Sanity tests |
| 36 |
runs-on: ${{ matrix.os }} |
| 37 |
strategy: |
| 38 |
fail-fast: false |
| 39 |
matrix: |
| 40 |
# Ansible Support Matrix |
| 41 |
# https://docs.ansible.com/ansible/latest/reference_appendices/release_and_maintenance.html#ansible-core-support-matrix |
| 42 |
ansible: |
| 43 |
- stable-2.14 |
| 44 |
- stable-2.15 |
| 45 |
- stable-2.16 |
| 46 |
- stable-2.19 |
| 47 |
- devel |
| 48 |
python: |
| 49 |
- "3.9" |
| 50 |
- "3.10" |
| 51 |
- "3.11" |
| 52 |
- "3.12" |
| 53 |
- "3.13" |
| 54 |
os: |
| 55 |
- ubuntu-24.04 |
| 56 |
exclude: |
| 57 |
# no support |
| 58 |
- ansible: stable-2.14 |
| 59 |
python: "3.12" |
| 60 |
- ansible: stable-2.14 |
| 61 |
python: "3.13" |
| 62 |
- ansible: stable-2.15 |
| 63 |
python: "3.12" |
| 64 |
- ansible: stable-2.15 |
| 65 |
python: "3.13" |
| 66 |
- ansible: stable-2.16 |
| 67 |
python: "3.13" |
| 68 |
steps: |
| 69 |
- name: Sanity testing |
| 70 |
uses: ansible-community/ansible-test-gh-action@release/v1 |
| 71 |
with: |
| 72 |
ansible-core-version: ${{ matrix.ansible }} |
| 73 |
target-python-version: ${{ matrix.python }} |
| 74 |
testing-type: sanity |
| 75 |
test-deps: >- |
| 76 |
ansible.netcommon ansible.utils community.internal_test_tools |
| 77 |
|
| 78 |
### |
| 79 |
# Unit tests (OPTIONAL) |
| 80 |
# |
| 81 |
# https://docs.ansible.com/ansible/latest/dev_guide/testing_units.html |
| 82 |
|
| 83 |
units: |
| 84 |
name: Unit tests (${{ matrix.ansible }}+py${{ matrix.python }}) |
| 85 |
runs-on: ${{ matrix.os }} |
| 86 |
strategy: |
| 87 |
fail-fast: false |
| 88 |
matrix: |
| 89 |
# Ansible Support matrix |
| 90 |
# https://docs.ansible.com/ansible/latest/reference_appendices/release_and_maintenance.html#ansible-core-support-matrix |
| 91 |
ansible: |
| 92 |
- stable-2.14 |
| 93 |
- stable-2.15 |
| 94 |
- stable-2.16 |
| 95 |
- stable-2.19 |
| 96 |
- devel |
| 97 |
python: |
| 98 |
- "3.9" |
| 99 |
- "3.10" |
| 100 |
- "3.11" |
| 101 |
- "3.12" |
| 102 |
- "3.13" |
| 103 |
os: |
| 104 |
- ubuntu-24.04 |
| 105 |
exclude: |
| 106 |
# no support |
| 107 |
- ansible: stable-2.14 |
| 108 |
python: "3.12" |
| 109 |
- ansible: stable-2.14 |
| 110 |
python: "3.13" |
| 111 |
- ansible: stable-2.15 |
| 112 |
python: "3.12" |
| 113 |
- ansible: stable-2.15 |
| 114 |
python: "3.13" |
| 115 |
- ansible: stable-2.16 |
| 116 |
python: "3.13" |
| 117 |
steps: |
| 118 |
- name: Unit testing |
| 119 |
uses: ansible-community/ansible-test-gh-action@release/v1 |
| 120 |
with: |
| 121 |
ansible-core-version: ${{ matrix.ansible }} |
| 122 |
target-python-version: ${{ matrix.python }} |
| 123 |
testing-type: units |
| 124 |
test-deps: >- |
| 125 |
ansible.netcommon ansible.utils community.internal_test_tools |