@@ -16,6 +16,12 @@ inputs:
16
16
ansible_test_environment :
17
17
description : list of environment variables to set when running ansible-test
18
18
required : false
19
+ ansible_test_requirement_files :
20
+ description : Requirements files containing python dependencies to run integration.
21
+ default : " requirements.txt test-requirements.txt"
22
+ ansible_test_constraint_files :
23
+ description : Collection python constraints files.
24
+ default : " "
19
25
20
26
runs :
21
27
using : composite
@@ -39,10 +45,39 @@ runs:
39
45
python3 -m pip install selinux_please_lie_to_me
40
46
shell : bash
41
47
48
+ - name : Create requirements files argument
49
+ id : requirements
50
+ run : |
51
+ set -eux
52
+ REQ_ARG=""
53
+ for item in $(echo ${FILES_LIST} | tr ' ' '\n'); do
54
+ REQ_ARG="-r ${item} ${REQ_ARG}"
55
+ done
56
+ echo "argument=${REQ_ARG}" >> $GITHUB_OUTPUT
57
+ shell : bash
58
+ env :
59
+ FILES_LIST : ${{ inputs.ansible_test_requirement_files }}
60
+ if : inputs.ansible_test_requirement_files != ''
61
+
62
+ - name : Create constraints files argument
63
+ id : constraints
64
+ run : |
65
+ set -eux
66
+ CONSTRAINTS_ARG=""
67
+ for item in $(echo ${CONSTRAINTS_FILES} | tr ' ' '\n'); do
68
+ CONSTRAINTS_ARG="-r ${item} ${CONSTRAINTS_ARG}"
69
+ done
70
+ echo "argument=${CONSTRAINTS_ARG}" >> $GITHUB_OUTPUT
71
+ shell : bash
72
+ env :
73
+ CONSTRAINTS_FILES : ${{ inputs.ansible_test_constraint_files }}
74
+ if : inputs.ansible_test_constraint_files != ''
75
+
42
76
- name : Install collection python requirements
43
- run : python3 -m pip install -r requirements.txt -r test-requirements.txt
77
+ run : python3 -m pip install ${{ steps. requirements.outputs.argument }} ${{ steps.constraints.outputs.argument }}
44
78
shell : bash
45
79
working-directory : ${{ inputs.collection_path }}
80
+ if : ${{ (steps.requirements.outputs.argument != '') || (steps.constraints.outputs.argument != '') }}
46
81
47
82
- name : Set environment variables
48
83
run : echo "${{ inputs.ansible_test_environment }}" >> $GITHUB_ENV
0 commit comments