2727env :
2828 INTEG_TESTS_INCLUDE_SCHEDULE : " *"
2929 INTEG_TESTS_EXCLUDE_SCHEDULE : " ^dns_config$|^cluster_shutdown$|^version_update$|^oidc_config$|^smtp$|^role_"
30- WORKDIR : /work-dir/ansible_collections/scale_computing/hypercore
30+ # ansible-test needs special directory structure.
31+ # WORKDIR is a subdir of GITHUB_WORKSPACE
32+ WORKDIR : work-dir/ansible_collections/scale_computing/hypercore
3133# Run only one workflow for specific branch.
3234concurrency :
3335 group : ${{ github.ref_name }}
@@ -39,50 +41,44 @@ jobs:
3941 # to delay integ-test until integration-prepare-env finishes.
4042 integration-prepare-env :
4143 runs-on : [self-hosted2]
42- container : python:3.10-slim-buster
44+ container : quay.io/justinc1_github/scale_ci_integ:1
4345 env :
44- DEBIAN_FRONTEND : noninteractive
45- ANSIBLE_COLLECTIONS_PATH : /work-dir
46+ ANSIBLE_COLLECTIONS_PATH : $GITHUB_WORKSPACE/work-dir
47+ defaults :
48+ run :
49+ working-directory : ${{ env.WORKDIR }}
4650 steps :
4751 - name : Checkout
4852 uses : actions/checkout@v3
49- - run : pip3 install -r sanity.requirements -r test.requirements -r docs.requirements
50- - run : apt update
51- - run : apt install -y git make
52- - run : pip install ansible-core==2.13.1
53- - run : apt install -y genisoimage qemu-utils
54- - run : apt install -y jq
55- - run : mkdir -p $WORKDIR
56- - run : cp -a ./ $WORKDIR
53+ with :
54+ path : ${{ env.WORKDIR }}
5755 - run : ansible-galaxy collection install community.crypto community.general
56+ - run : ansible-galaxy collection list
5857 - run : |
59- cd $WORKDIR
6058 echo "${{ vars.CI_CONFIG_HC_IP50 }}" > tests/integration/integration_config.yml
6159 cat tests/integration/integration_config.yml
6260 echo "sc_password: ${{ secrets.CI_CONFIG_HC_IP50_SC_PASSWORD }}" >> tests/integration/integration_config.yml
6361 echo "smb_password: ${{ secrets.CI_CONFIG_HC_IP50_SMB_PASSWORD }}" >> tests/integration/integration_config.yml
6462 echo "sc_replication_dest_password: ${{ secrets.CI_CONFIG_HC_IP50_SC_REPLICATION_DEST_PASSWORD }}" >> tests/integration/integration_config.yml
6563 ls -al tests/integration/integration_config.yml
66- - run : cd $WORKDIR && ansible-playbook tests/integration/prepare/prepare_iso.yml
67- - run : cd $WORKDIR && ansible-playbook tests/integration/prepare/prepare_vm.yml
68- - run : cd $WORKDIR && ansible-playbook tests/integration/prepare/prepare_examples.yml
64+ - run : ansible-playbook tests/integration/prepare/prepare_iso.yml
65+ - run : ansible-playbook tests/integration/prepare/prepare_vm.yml
66+ - run : ansible-playbook tests/integration/prepare/prepare_examples.yml
6967 if : " ${{ github.event.inputs.integ_tests_include || github.event.schedule }}"
7068
7169 integ-matrix :
7270 runs-on : [ubuntu-latest]
73- container : python:3.10-slim-buster
74- env :
75- DEBIAN_FRONTEND : noninteractive
76- ANSIBLE_COLLECTIONS_PATH : /work-dir
71+ container : quay.io/justinc1_github/scale_ci_integ:1
72+ defaults :
73+ run :
74+ working-directory : ${{ env.WORKDIR }}
7775 outputs :
7876 matrix : ${{ steps.set-matrix.outputs.matrix }}
7977 steps :
8078 - name : Checkout
8179 uses : actions/checkout@v3
82- - run : apt update
83- - run : apt install -y jq
84- - run : mkdir -p $WORKDIR
85- - run : cp -a ./ $WORKDIR
80+ with :
81+ path : ${{ env.WORKDIR }}
8682 # We want to run all integ tests periodically - "integ_tests_include || '*'", the '*' is used.
8783 # When running with workflow-dispatch, user is required to put some non-empty string into integ_tests_include.
8884 - run : echo 'INTEG_TESTS_INCLUDE=${{ github.event.inputs.integ_tests_include || env.INTEG_TESTS_INCLUDE_SCHEDULE }}' >> $GITHUB_ENV
9288 shell : bash
9389 run : |-
9490 echo "matrix=$(
95- ls -r $WORKDIR/ tests/integration/targets |
91+ ls -r tests/integration/targets |
9692 grep -v -E "${{ env.INTEG_TESTS_EXCLUDE }}" |
9793 grep -E "${{ env.INTEG_TESTS_INCLUDE }}" |
9894 jq -R -s -c 'split("\n")[:-1]'
@@ -101,27 +97,25 @@ jobs:
10197
10298 examples-matrix :
10399 runs-on : [ ubuntu-latest ]
104- container : python:3.10-slim-buster
105- env :
106- DEBIAN_FRONTEND : noninteractive
107- ANSIBLE_COLLECTIONS_PATH : /work-dir
100+ container : quay.io/justinc1_github/scale_ci_integ:1
101+ defaults :
102+ run :
103+ working-directory : ${{ env.WORKDIR }}
108104 outputs :
109105 matrix : ${{ steps.set-matrix.outputs.matrix }}
110106 steps :
111107 - name : Checkout
112108 uses : actions/checkout@v3
113- - run : apt update
114- - run : apt install -y jq
115- - run : mkdir -p $WORKDIR
116- - run : cp -a ./ $WORKDIR
109+ with :
110+ path : ${{ env.WORKDIR }}
117111 # A few files are not an example playbook:
118112 # hypercore_inventory.yml - inventory example
119113 # cloud-init-user-data-example.yml - cloud-init user-data example
120114 - id : set-matrix
121115 shell : bash
122116 run : |-
123117 echo "matrix=$(
124- ls -r $WORKDIR/ examples |
118+ ls -r examples |
125119 grep -v -E "^README.md$|^hypercore_inventory.yml$|^cloud-init-user-data-example.yml$" |
126120 jq -R -s -c 'split("\n")[:-1]'
127121 )" >> $GITHUB_OUTPUT
@@ -131,9 +125,13 @@ jobs:
131125 needs :
132126 - examples-matrix
133127 runs-on : [ self-hosted2 ]
134- container : python:3.10-slim-buster
128+ container : quay.io/justinc1_github/scale_ci_integ:1
135129 env :
130+ ANSIBLE_COLLECTIONS_PATH : $GITHUB_WORKSPACE/work-dir
136131 DEBIAN_FRONTEND : noninteractive
132+ defaults :
133+ run :
134+ working-directory : ${{ env.WORKDIR }}
137135 strategy :
138136 fail-fast : false
139137 matrix :
@@ -142,26 +140,19 @@ jobs:
142140 steps :
143141 - name : Checkout
144142 uses : actions/checkout@v3
145- - run : pip3 install -r sanity.requirements -r test.requirements -r docs.requirements
146- - run : apt update
147- - run : apt install -y git make
148- - run : apt install -y genisoimage qemu-utils jq
149- - run : pip install yq
143+ with :
144+ path : ${{ env.WORKDIR }}
150145 - run : pip install ansible-core~=${{ matrix.ansible }}
151- - run : mkdir -p $WORKDIR
152- - run : cp -a ./ $WORKDIR
153- - run : cd $WORKDIR && ansible-galaxy collection install community.crypto community.general
154- - run : cd $WORKDIR && ansible-galaxy collection list
146+ - run : ansible-galaxy collection install community.crypto community.general
147+ - run : ansible-galaxy collection list
155148 - run : |
156- cd $WORKDIR
157149 echo "${{ vars.CI_CONFIG_HC_IP50 }}" > tests/integration/integration_config.yml
158150 cat tests/integration/integration_config.yml
159151 echo "sc_password: ${{ secrets.CI_CONFIG_HC_IP50_SC_PASSWORD }}" >> tests/integration/integration_config.yml
160152 echo "smb_password: ${{ secrets.CI_CONFIG_HC_IP50_SMB_PASSWORD }}" >> tests/integration/integration_config.yml
161153 echo "sc_replication_dest_password: ${{ secrets.CI_CONFIG_HC_IP50_SC_REPLICATION_DEST_PASSWORD }}" >> tests/integration/integration_config.yml
162154 ls -al tests/integration/integration_config.yml
163155 - run : |
164- cd $WORKDIR
165156 eval export SC_HOST=$(cat tests/integration/integration_config.yml | yq '.sc_host')
166157 eval export SC_USERNAME=$(cat tests/integration/integration_config.yml | yq '.sc_username')
167158 eval export SC_PASSWORD=$(cat tests/integration/integration_config.yml | yq '.sc_password')
@@ -173,9 +164,12 @@ jobs:
173164 - integ-matrix
174165 # - units-test
175166 runs-on : [self-hosted2]
176- container : python:3.10-slim-buster
167+ container : quay.io/justinc1_github/scale_ci_integ:1
177168 env :
178169 DEBIAN_FRONTEND : noninteractive
170+ defaults :
171+ run :
172+ working-directory : ${{ env.WORKDIR }}
179173 strategy :
180174 fail-fast : false
181175 matrix :
@@ -186,69 +180,63 @@ jobs:
186180 steps :
187181 - name : Checkout
188182 uses : actions/checkout@v3
189- - run : pip3 install -r sanity.requirements -r test.requirements -r docs.requirements
190- - run : apt update
191- - run : apt install -y git make
192- - run : apt install -y genisoimage qemu-utils
183+ with :
184+ path : ${{ env.WORKDIR }}
193185 - run : pip install ansible-core~=${{ matrix.ansible }}
194- - run : mkdir -p $WORKDIR
195- - run : cp -a ./ $WORKDIR
196186 # We have ansible.cfg "for testing" in git repo
197187 # (it is excluded in galaxy.yml, so it is not part of collection artifact)
198188 # But it does affect ansible-galaxy and ansible-test commands.
199- - run : cd $WORKDIR && ansible-galaxy collection install community.crypto
200- - run : cd $WORKDIR && ansible-galaxy collection list
189+ - run : ansible-galaxy collection install community.crypto
190+ - run : ansible-galaxy collection list
201191 # TODO - make integration_config.yml a reusable artifact/output of integration-prepare-env
202192 - run : |
203- cd $WORKDIR
204193 echo "${{ vars.CI_CONFIG_HC_IP50 }}" > tests/integration/integration_config.yml
205194 cat tests/integration/integration_config.yml
206195 echo "sc_password: ${{ secrets.CI_CONFIG_HC_IP50_SC_PASSWORD }}" >> tests/integration/integration_config.yml
207196 echo "smb_password: ${{ secrets.CI_CONFIG_HC_IP50_SMB_PASSWORD }}" >> tests/integration/integration_config.yml
208197 echo "sc_replication_dest_password: ${{ secrets.CI_CONFIG_HC_IP50_SC_REPLICATION_DEST_PASSWORD }}" >> tests/integration/integration_config.yml
209198 ls -al tests/integration/integration_config.yml
210- - run : cd $WORKDIR && ansible-test integration --local ${{ matrix.test_name }}
199+ - run : ansible-test integration --local ${{ matrix.test_name }}
211200
212201
213202 replica_cleanup :
214203 needs :
215204 - integ
216205 runs-on : [self-hosted2]
217- container : python:3.10-slim-buster
206+ container : quay.io/justinc1_github/scale_ci_integ:1
218207 env :
219- ANSIBLE_COLLECTIONS_PATH : /work-dir
208+ ANSIBLE_COLLECTIONS_PATH : $GITHUB_WORKSPACE/work-dir
209+ defaults :
210+ run :
211+ working-directory : ${{ env.WORKDIR }}
220212 steps :
221213 - name : Checkout
222214 uses : actions/checkout@v3
223- - run : pip3 install -r sanity.requirements -r test.requirements -r docs.requirements
224- - run : apt update
225- - run : apt install -y git make
226- - run : pip install ansible-core==2.13.1
215+ with :
216+ path : ${{ env.WORKDIR }}
217+ - run : pip install ansible-core~=2.13.0
227218 # ansible-test needs special directory structure.
228- - run : mkdir -p $WORKDIR
229- - run : cp -a ./ $WORKDIR
230219 - run : |
231- cd $WORKDIR
232220 echo "${{ vars.CI_CONFIG_HC_IP50 }}" > tests/integration/integration_config.yml
233221 cat tests/integration/integration_config.yml
234222 echo "sc_password: ${{ secrets.CI_CONFIG_HC_IP50_SC_PASSWORD }}" >> tests/integration/integration_config.yml
235223 echo "smb_password: ${{ secrets.CI_CONFIG_HC_IP50_SMB_PASSWORD }}" >> tests/integration/integration_config.yml
236224 echo "sc_replication_dest_password: ${{ secrets.CI_CONFIG_HC_IP50_SC_REPLICATION_DEST_PASSWORD }}" >> tests/integration/integration_config.yml
237225 ls -al tests/integration/integration_config.yml
238226 - run : ansible-galaxy collection install community.general
239- - run : cd $WORKDIR && ansible-playbook tests/integration/cleanup/ci_replica_cleanup.yml
227+ - run : ansible-playbook tests/integration/cleanup/ci_replica_cleanup.yml
240228
241229 smb_cleanup :
242230 needs :
243231 - integ
244232 runs-on : [self-hosted2]
245- container : python:3.10-slim-buster
233+ container : quay.io/justinc1_github/scale_ci_integ:1
234+ defaults :
235+ run :
236+ working-directory : ${{ env.WORKDIR }}
246237 steps :
247238 - name : Checkout
248239 uses : actions/checkout@v3
249- - run : apt update
250- - run : apt install -y git make
251- - run : apt install -y smbclient
252- - run : mkdir -p $WORKDIR
253- - run : cp -a ./ $WORKDIR
254- - run : cd $WORKDIR/tests/integration/cleanup && ./smb_cleanup.sh ${{ secrets.SMB_SERVER }} ${{ secrets.SMB_SHARE }} "${{ secrets.SMB_USERNAME }}" ${{ secrets.SMB_PASSWORD }}
240+ with :
241+ path : ${{ env.WORKDIR }}
242+ - run : cd tests/integration/cleanup && ./smb_cleanup.sh ${{ secrets.SMB_SERVER }} ${{ secrets.SMB_SHARE }} "${{ secrets.SMB_USERNAME }}" ${{ secrets.SMB_PASSWORD }}
0 commit comments