|
1 | 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 |
2 | 4 |
|
3 | | -# Worflow for ansible-test sanity tests |
4 | | - |
5 | | -name: ansible-test sanity of the collection |
| 5 | +name: Ansible Test - Sanity |
6 | 6 |
|
7 | 7 | on: |
| 8 | + schedule: |
| 9 | + # This is 01:05 UTC, which is 3:05 AM in Prague/CEST |
| 10 | + - cron: '5 3 * * 1' |
| 11 | + |
8 | 12 | pull_request: |
9 | 13 | branches: |
10 | 14 | - main |
11 | 15 | - dev |
| 16 | + |
12 | 17 | workflow_dispatch: |
13 | 18 |
|
14 | 19 | jobs: |
15 | | - sanity: |
| 20 | + sanity-supported: |
16 | 21 | runs-on: ubuntu-latest |
17 | | - |
| 22 | + name: Sanity (Supported Ⓐ${{ matrix.ansible }}) |
| 23 | + strategy: |
| 24 | + fail-fast: false # Disabled so we can see all failed combinations. |
| 25 | + # Define a build matrix to test compatibility across multiple Ansible versions. |
| 26 | + # Each version listed below will spawn a separate job that runs in parallel. |
| 27 | + matrix: |
| 28 | + ansible: |
| 29 | + # Supported versions (must pass) |
| 30 | + - 'stable-2.18' # Python 3.11 - 3.13 |
| 31 | + - 'stable-2.19' # Python 3.11 - 3.13 |
| 32 | + - 'devel' # Test against the upcoming development version. |
18 | 33 | steps: |
19 | | - - name: Check out the code |
20 | | - uses: actions/checkout@v4 |
| 34 | + - uses: actions/checkout@v5 |
21 | 35 |
|
22 | | - - name: Set up Python 3 |
23 | | - uses: actions/setup-python@v5 |
| 36 | + - name: ansible-test - sanity |
| 37 | + uses: ansible-community/ansible-test-gh-action@release/v1 |
24 | 38 | with: |
25 | | - python-version: '3.12' |
26 | | - |
27 | | - - name: Install test dependencies |
28 | | - run: | |
29 | | - pip3 install ansible ansible-lint==6.8.6 |
30 | | - pip3 install ansible-compat==3.0.2 |
31 | | -
|
32 | | -# - name: Install collection dependencies |
33 | | -# run: ansible-galaxy collection install community.general |
34 | | - |
35 | | -# - name: List directory /home/runner/work/ |
36 | | -# working-directory: /home/runner/ |
37 | | -# run: ls -al /home/runner/work/ |
38 | | - |
39 | | -# - name: List directory /home/runner/work/_actions |
40 | | -# working-directory: /home/runner/ |
41 | | -# run: ls -al /home/runner/work/_actions |
42 | | - |
43 | | - - name: List directory /home/runner/work/_actions/actions |
44 | | - working-directory: /home/runner/ |
45 | | - run: ls -al /home/runner/work/_actions/actions |
46 | | - |
47 | | -# - name: List directory /home/runner/work/community.sap_install |
48 | | -# working-directory: /home/runner/ |
49 | | -# run: ls -al /home/runner/work/community.sap_install |
| 39 | + ansible-core-version: ${{ matrix.ansible }} |
| 40 | + testing-type: sanity |
50 | 41 |
|
51 | | -# - name: List directory /home/runner/work/community.sap_install/community.sap_install |
52 | | -# working-directory: /home/runner/ |
53 | | -# run: ls -al /home/runner/work/community.sap_install/community.sap_install |
54 | | - |
55 | | - - name: Move the collection to the correct location - Create new directory |
56 | | - run: mkdir -p /home/runner/.ansible/collections/ansible_collections/community |
57 | | - |
58 | | - - name: Move the collection to the correct location - Move the collection |
59 | | - working-directory: /home/runner/ |
60 | | - run: mv /home/runner/work/community.sap_install/community.sap_install /home/runner/.ansible/collections/ansible_collections/community |
61 | | - |
62 | | -# - name: List directory /home/runner/.ansible/collections/ansible_collections/community |
63 | | -# working-directory: /home/runner/ |
64 | | -# run: ls -al /home/runner/.ansible/collections/ansible_collections/community |
65 | | - |
66 | | - - name: Move the collection to the correct location - Rename the directory |
67 | | - working-directory: /home/runner/ |
68 | | - run: mv /home/runner/.ansible/collections/ansible_collections/community/community.sap_install /home/runner/.ansible/collections/ansible_collections/community/sap_install |
69 | | - |
70 | | -# - name: List directory /home/runner/.ansible/collections/ansible_collections/community |
71 | | -# working-directory: /home/runner/ |
72 | | -# run: ls -al /home/runner/.ansible/collections/ansible_collections/community |
73 | | - |
74 | | -# - name: List directory /home/runner/.ansible/collections/ansible_collections/community/sap_install |
75 | | -# working-directory: /home/runner/ |
76 | | -# run: ls -al /home/runner/.ansible/collections/ansible_collections/community/sap_install |
77 | | - |
78 | | - - name: Run sanity tests |
79 | | - working-directory: /home/runner/.ansible/collections/ansible_collections/community/sap_install |
80 | | - run: ansible-test sanity |
| 42 | + sanity-eol: |
| 43 | + runs-on: ubuntu-latest |
| 44 | + # This job only runs if the supported tests pass |
| 45 | + needs: sanity-supported |
| 46 | + name: Sanity (EOL Ⓐ${{ matrix.ansible }}) |
| 47 | + continue-on-error: true # This entire job is allowed to fail |
| 48 | + strategy: |
| 49 | + fail-fast: false # Disabled so we can see all failed combinations. |
| 50 | + # Define a build matrix to test compatibility across multiple Ansible versions. |
| 51 | + # Each version listed below will spawn a separate job that runs in parallel. |
| 52 | + matrix: |
| 53 | + ansible: |
| 54 | + # EOL versions (allowed to fail) |
| 55 | + # NOTE: Ensure that meta/runtime.yml `requires_ansible` version is aligned with tested versions. |
| 56 | + - 'stable-2.14' # Python 3.9 - 3.11 |
| 57 | + - 'stable-2.15' # Python 3.9 - 3.11 |
| 58 | + - 'stable-2.16' # Python 3.10 - 3.12 |
| 59 | + - 'stable-2.17' # Python 3.10 - 3.12 |
| 60 | + steps: |
| 61 | + - uses: actions/checkout@v5 |
81 | 62 |
|
82 | | - - name: Move the collection to its previous location |
83 | | - working-directory: /home/runner/ |
84 | | - run: mv /home/runner/.ansible/collections/ansible_collections/community/sap_install /home/runner/work/community.sap_install/community.sap_install |
| 63 | + - name: ansible-test - sanity |
| 64 | + uses: ansible-community/ansible-test-gh-action@release/v1 |
| 65 | + with: |
| 66 | + ansible-core-version: ${{ matrix.ansible }} |
| 67 | + testing-type: sanity |
0 commit comments