Skip to content

Commit d55b27a

Browse files
committed
Use --pre only with supported Ansible versions
Signed-off-by: NilashishC <[email protected]>
1 parent 6ad0914 commit d55b27a

File tree

6 files changed

+21
-4
lines changed

6 files changed

+21
-4
lines changed

.github/actions/build_install_collection/action.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,11 @@ inputs:
1818
The collection tarball when built
1919
If not set, this will be determined by the action
2020
default: ""
21-
21+
ansible_version:
22+
description: |
23+
Ansible Core version from the workflow.
24+
required: false
25+
default: ""
2226
outputs:
2327
collection_path:
2428
description: The final collection path
@@ -62,6 +66,7 @@ runs:
6266

6367
- name: Install collection python requirements
6468
if: ${{ inputs.install_python_dependencies == 'true' }}
69+
6570
run: python3 -m pip install -r requirements.txt -r test-requirements.txt
6671
shell: bash
6772
working-directory: ${{ inputs.source_path }}
@@ -78,10 +83,17 @@ runs:
7883
shell: bash
7984
working-directory: ${{ inputs.source_path }}
8085

81-
- name: Install collection and dependencies
86+
- name: Install collection and dependencies (with --pre flag)
8287
run: ansible-galaxy collection install ./${{ steps.identify.outputs.tar_file || inputs.tar_file }} --pre -p /home/runner/collections
8388
shell: bash
8489
working-directory: ${{ inputs.source_path }}
90+
if: ${{ inputs.ansible_version != "stable-2.9" }}
91+
92+
- name: Install collection and dependencies (without --pre flag)
93+
run: ansible-galaxy collection install ./${{ steps.identify.outputs.tar_file || inputs.tar_file }} -p /home/runner/collections
94+
shell: bash
95+
working-directory: ${{ inputs.source_path }}
96+
if: ${{ inputs.ansible_version == "stable-2.9" }}
8597

8698
- name: Copy the galaxy.yml from source to destination, needed for pytest-ansible-units
8799
run: cp galaxy.yml ${{ steps.identify.outputs.collection_path || inputs.collection_path }}/galaxy.yml

.github/workflows/integration.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ jobs:
117117
source_path: ${{ env.source_directory }}
118118
collection_path: ${{ steps.identify.outputs.collection_path }}
119119
tar_file: ${{ steps.identify.outputs.tar_file }}
120+
ansible_version: ${{ matrix.ansible-version }}
120121

121122
- name: Print the ansible version
122123
run: ansible --version

.github/workflows/integration_simple.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ jobs:
123123
source_path: ${{ env.source_directory }}
124124
collection_path: ${{ steps.identify.outputs.collection_path }}
125125
tar_file: ${{ steps.identify.outputs.tar_file }}
126+
ansible_version: ${{ matrix.ansible-version }}
126127

127128
- name: Print the ansible version
128129
run: ansible --version

.github/workflows/sanity.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ jobs:
150150

151151
- name: Pre install collections dependencies first so the collection install does not
152152
run: ansible-galaxy collection install --pre ${{ inputs.collection_pre_install }} -p /home/runner/collections/
153-
if: inputs.collection_pre_install != ''
153+
if: ${{ inputs.collection_pre_install != '' && matrix.ansible-version != 'stable-2.9' }}
154154

155155
- name: Read collection metadata from galaxy.yml
156156
id: identify
@@ -165,6 +165,7 @@ jobs:
165165
source_path: ${{ env.source_directory }}
166166
collection_path: ${{ steps.identify.outputs.collection_path }}
167167
tar_file: ${{ steps.identify.outputs.tar_file }}
168+
ansible_version: ${{ matrix.ansible-version }}
168169

169170
- name: Print the ansible version
170171
run: ansible --version

.github/workflows/unit_galaxy.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ jobs:
143143

144144
- name: Pre install collections dependencies first so the collection install does not
145145
run: ansible-galaxy collection install --pre ${{ inputs.collection_pre_install }} -p /home/runner/collections
146-
if: inputs.collection_pre_install != ''
146+
if: ${{ inputs.collection_pre_install != '' && matrix.ansible-version != 'stable-2.9' }}
147147

148148
- name: Read collection metadata from galaxy.yml
149149
id: identify
@@ -158,6 +158,7 @@ jobs:
158158
source_path: ${{ env.source_directory }}
159159
collection_path: ${{ steps.identify.outputs.collection_path }}
160160
tar_file: ${{ steps.identify.outputs.tar_file }}
161+
ansible_version: ${{ matrix.ansible-version }}
161162

162163
- name: Print the ansible version
163164
run: ansible --version

.github/workflows/unit_source.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ jobs:
104104
source_path: ${{ env.source_directory }}
105105
collection_path: ${{ steps.identify.outputs.collection_path }}
106106
tar_file: ${{ steps.identify.outputs.tar_file }}
107+
ansible_version: ${{ matrix.ansible-version }}
107108

108109
- name: Print the ansible version
109110
run: ansible --version

0 commit comments

Comments
 (0)