|
| 1 | +# README: |
| 2 | +# - When changing the module name, it needs to be changed in 'env:MODULE_NAME' and in 'on:pull_requests:path'! |
| 3 | +# |
| 4 | +# Resources: |
| 5 | +# - Template for this file: https://github.com/ansible-collections/collection_template/blob/main/.github/workflows/ansible-test.yml |
| 6 | +# - About Ansible integration tests: https://docs.ansible.com/ansible/latest/dev_guide/testing_integration.html |
| 7 | + |
| 8 | +env: |
| 9 | + NAMESPACE: checkmk |
| 10 | + COLLECTION_NAME: general |
| 11 | + MODULE_NAME: dcd |
| 12 | + |
| 13 | +concurrency: |
| 14 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 15 | + cancel-in-progress: true |
| 16 | + |
| 17 | +name: Ansible Integration Tests for the DCD Module |
| 18 | +on: |
| 19 | + workflow_dispatch: |
| 20 | + schedule: |
| 21 | + - cron: '0 0 * * 0' |
| 22 | + pull_request: |
| 23 | + branches: |
| 24 | + - main |
| 25 | + - devel |
| 26 | + paths: |
| 27 | + - 'plugins/modules/dcd.py' |
| 28 | + push: |
| 29 | + paths: |
| 30 | + - 'plugins/modules/dcd.py' |
| 31 | + - '.github/workflows/ans-int-test-dcd.yaml' |
| 32 | + |
| 33 | +jobs: |
| 34 | + |
| 35 | + integration: |
| 36 | + runs-on: ubuntu-22.04 |
| 37 | + name: Ⓐ${{ matrix.ansible }}+py${{ matrix.python }} |
| 38 | + strategy: |
| 39 | + fail-fast: false |
| 40 | + matrix: |
| 41 | + ansible: |
| 42 | + - stable-2.15 |
| 43 | + - stable-2.16 |
| 44 | + - stable-2.17 |
| 45 | + - devel |
| 46 | + python: |
| 47 | + - '3.9' |
| 48 | + - '3.10' |
| 49 | + - '3.11' |
| 50 | + - '3.12' |
| 51 | + exclude: |
| 52 | + # Exclude unsupported sets. |
| 53 | + - ansible: stable-2.15 |
| 54 | + python: '3.12' |
| 55 | + - ansible: stable-2.16 |
| 56 | + python: '3.9' |
| 57 | + - ansible: stable-2.17 |
| 58 | + python: '3.9' |
| 59 | + - ansible: devel |
| 60 | + python: '3.9' |
| 61 | + - ansible: devel |
| 62 | + python: '3.10' |
| 63 | + |
| 64 | + services: |
| 65 | + ancient_cre: |
| 66 | + image: checkmk/check-mk-raw:2.2.0p42 |
| 67 | + ports: |
| 68 | + - 5022:5000 |
| 69 | + env: |
| 70 | + CMK_SITE_ID: "ancient_cre" |
| 71 | + CMK_PASSWORD: "Sup3rSec4et!" |
| 72 | + old_cre: |
| 73 | + image: checkmk/check-mk-raw:2.3.0p33 |
| 74 | + ports: |
| 75 | + - 5023:5000 |
| 76 | + env: |
| 77 | + CMK_SITE_ID: "old_cre" |
| 78 | + CMK_PASSWORD: "Sup3rSec4et!" |
| 79 | + old_cme: |
| 80 | + image: checkmk/check-mk-managed:2.3.0p33 |
| 81 | + ports: |
| 82 | + - 5323:5000 |
| 83 | + env: |
| 84 | + CMK_SITE_ID: "old_cme" |
| 85 | + CMK_PASSWORD: "Sup3rSec4et!" |
| 86 | + stable_cre: |
| 87 | + image: checkmk/check-mk-raw:2.4.0p2 |
| 88 | + ports: |
| 89 | + - 5024:5000 |
| 90 | + env: |
| 91 | + CMK_SITE_ID: "stable_cre" |
| 92 | + CMK_PASSWORD: "Sup3rSec4et!" |
| 93 | + stable_cme: |
| 94 | + image: checkmk/check-mk-managed:2.4.0p2 |
| 95 | + ports: |
| 96 | + - 5324:5000 |
| 97 | + env: |
| 98 | + CMK_SITE_ID: "stable_cme" |
| 99 | + CMK_PASSWORD: "Sup3rSec4et!" |
| 100 | + |
| 101 | + steps: |
| 102 | + - name: Check out code |
| 103 | + uses: actions/checkout@v4 |
| 104 | + with: |
| 105 | + path: ansible_collections/${{env.NAMESPACE}}/${{env.COLLECTION_NAME}} |
| 106 | + |
| 107 | + - name: Set up Python |
| 108 | + uses: actions/setup-python@v5 |
| 109 | + with: |
| 110 | + python-version: ${{ matrix.python }} |
| 111 | + |
| 112 | + - name: Install ansible-base (${{ matrix.ansible }}) |
| 113 | + run: pip install https://github.com/ansible/ansible/archive/${{ matrix.ansible }}.tar.gz --disable-pip-version-check |
| 114 | + |
| 115 | + - name: Run integration test |
| 116 | + run: ansible-test integration ${{env.MODULE_NAME}} -v --color --retry-on-error --continue-on-error --diff --python ${{ matrix.python }} |
| 117 | + working-directory: ./ansible_collections/${{env.NAMESPACE}}/${{env.COLLECTION_NAME}} |
0 commit comments