Skip to content

Commit 5ad5089

Browse files
authored
Merge pull request sap-linuxlab#1115 from marcelmamula/sanity
collection: Update sanity github action and add missing ignore files for 2.19 and 2.20
2 parents ce86d2f + c937b5a commit 5ad5089

3 files changed

Lines changed: 52 additions & 67 deletions

File tree

Lines changed: 50 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,84 +1,67 @@
11
---
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
24

3-
# Worflow for ansible-test sanity tests
4-
5-
name: ansible-test sanity of the collection
5+
name: Ansible Test - Sanity
66

77
on:
8+
schedule:
9+
# This is 01:05 UTC, which is 3:05 AM in Prague/CEST
10+
- cron: '5 3 * * 1'
11+
812
pull_request:
913
branches:
1014
- main
1115
- dev
16+
1217
workflow_dispatch:
1318

1419
jobs:
15-
sanity:
20+
sanity-supported:
1621
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.
1833
steps:
19-
- name: Check out the code
20-
uses: actions/checkout@v4
34+
- uses: actions/checkout@v5
2135

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
2438
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
5041

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
8162

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

tests/sanity/ignore-2.19.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ignore-2.txt

tests/sanity/ignore-2.20.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ignore-2.txt

0 commit comments

Comments
 (0)