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,49 +41,43 @@ 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.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
64+ - run : ansible-playbook tests/integration/prepare/prepare_iso.yml
65+ - run : ansible-playbook tests/integration/prepare/prepare_vm.yml
6866 if : " ${{ github.event.inputs.integ_tests_include || github.event.schedule }}"
6967
7068 integ-matrix :
7169 runs-on : [ubuntu-latest]
72- container : python:3.10-slim-buster
73- env :
74- DEBIAN_FRONTEND : noninteractive
75- ANSIBLE_COLLECTIONS_PATH : /work-dir
70+ container : quay.io/justinc1_github/scale_ci_integ:1
71+ defaults :
72+ run :
73+ working-directory : ${{ env.WORKDIR }}
7674 outputs :
7775 matrix : ${{ steps.set-matrix.outputs.matrix }}
7876 steps :
7977 - name : Checkout
8078 uses : actions/checkout@v3
81- - run : apt update
82- - run : apt install -y jq
83- - run : mkdir -p $WORKDIR
84- - run : cp -a ./ $WORKDIR
79+ with :
80+ path : ${{ env.WORKDIR }}
8581 # We want to run all integ tests periodically - "integ_tests_include || '*'", the '*' is used.
8682 # When running with workflow-dispatch, user is required to put some non-empty string into integ_tests_include.
8783 - run : echo 'INTEG_TESTS_INCLUDE=${{ github.event.inputs.integ_tests_include || env.INTEG_TESTS_INCLUDE_SCHEDULE }}' >> $GITHUB_ENV
9187 shell : bash
9288 run : |-
9389 echo "matrix=$(
94- ls -r $WORKDIR/ tests/integration/targets |
90+ ls -r tests/integration/targets |
9591 grep -v -E "${{ env.INTEG_TESTS_EXCLUDE }}" |
9692 grep -E "${{ env.INTEG_TESTS_INCLUDE }}" |
9793 jq -R -s -c 'split("\n")[:-1]'
@@ -100,27 +96,25 @@ jobs:
10096
10197 examples-matrix :
10298 runs-on : [ ubuntu-latest ]
103- container : python:3.10-slim-buster
104- env :
105- DEBIAN_FRONTEND : noninteractive
106- ANSIBLE_COLLECTIONS_PATH : /work-dir
99+ container : quay.io/justinc1_github/scale_ci_integ:1
100+ defaults :
101+ run :
102+ working-directory : ${{ env.WORKDIR }}
107103 outputs :
108104 matrix : ${{ steps.set-matrix.outputs.matrix }}
109105 steps :
110106 - name : Checkout
111107 uses : actions/checkout@v3
112- - run : apt update
113- - run : apt install -y jq
114- - run : mkdir -p $WORKDIR
115- - run : cp -a ./ $WORKDIR
108+ with :
109+ path : ${{ env.WORKDIR }}
116110 # A few files are not an example playbook:
117111 # hypercore_inventory.yml - inventory example
118112 # cloud-init-user-data-example.yml - cloud-init user-data example
119113 - id : set-matrix
120114 shell : bash
121115 run : |-
122116 echo "matrix=$(
123- ls -r $WORKDIR/ examples |
117+ ls -r examples |
124118 grep -v -E "^README.md$|^hypercore_inventory.yml$|^cloud-init-user-data-example.yml$" |
125119 jq -R -s -c 'split("\n")[:-1]'
126120 )" >> $GITHUB_OUTPUT
@@ -130,9 +124,13 @@ jobs:
130124 needs :
131125 - examples-matrix
132126 runs-on : [ self-hosted2 ]
133- container : python:3.10-slim-buster
127+ container : quay.io/justinc1_github/scale_ci_integ:1
134128 env :
129+ ANSIBLE_COLLECTIONS_PATH : $GITHUB_WORKSPACE/work-dir
135130 DEBIAN_FRONTEND : noninteractive
131+ defaults :
132+ run :
133+ working-directory : ${{ env.WORKDIR }}
136134 strategy :
137135 fail-fast : false
138136 matrix :
@@ -141,26 +139,19 @@ jobs:
141139 steps :
142140 - name : Checkout
143141 uses : actions/checkout@v3
144- - run : pip3 install -r sanity.requirements -r test.requirements -r docs.requirements
145- - run : apt update
146- - run : apt install -y git make
147- - run : apt install -y genisoimage qemu-utils jq
148- - run : pip install yq
142+ with :
143+ path : ${{ env.WORKDIR }}
149144 - run : pip install ansible-core~=${{ matrix.ansible }}
150- - run : mkdir -p $WORKDIR
151- - run : cp -a ./ $WORKDIR
152- - run : cd $WORKDIR && ansible-galaxy collection install community.crypto community.general
153- - run : cd $WORKDIR && ansible-galaxy collection list
145+ - run : ansible-galaxy collection install community.crypto community.general
146+ - run : ansible-galaxy collection list
154147 - run : |
155- cd $WORKDIR
156148 echo "${{ vars.CI_CONFIG_HC_IP50 }}" > tests/integration/integration_config.yml
157149 cat tests/integration/integration_config.yml
158150 echo "sc_password: ${{ secrets.CI_CONFIG_HC_IP50_SC_PASSWORD }}" >> tests/integration/integration_config.yml
159151 echo "smb_password: ${{ secrets.CI_CONFIG_HC_IP50_SMB_PASSWORD }}" >> tests/integration/integration_config.yml
160152 echo "sc_replication_dest_password: ${{ secrets.CI_CONFIG_HC_IP50_SC_REPLICATION_DEST_PASSWORD }}" >> tests/integration/integration_config.yml
161153 ls -al tests/integration/integration_config.yml
162154 - run : |
163- cd $WORKDIR
164155 eval export SC_HOST=$(cat tests/integration/integration_config.yml | yq '.sc_host')
165156 eval export SC_USERNAME=$(cat tests/integration/integration_config.yml | yq '.sc_username')
166157 eval export SC_PASSWORD=$(cat tests/integration/integration_config.yml | yq '.sc_password')
@@ -172,9 +163,12 @@ jobs:
172163 - integ-matrix
173164 # - units-test
174165 runs-on : [self-hosted2]
175- container : python:3.10-slim-buster
166+ container : quay.io/justinc1_github/scale_ci_integ:1
176167 env :
177168 DEBIAN_FRONTEND : noninteractive
169+ defaults :
170+ run :
171+ working-directory : ${{ env.WORKDIR }}
178172 strategy :
179173 fail-fast : false
180174 matrix :
@@ -185,69 +179,63 @@ jobs:
185179 steps :
186180 - name : Checkout
187181 uses : actions/checkout@v3
188- - run : pip3 install -r sanity.requirements -r test.requirements -r docs.requirements
189- - run : apt update
190- - run : apt install -y git make
191- - run : apt install -y genisoimage qemu-utils
182+ with :
183+ path : ${{ env.WORKDIR }}
192184 - run : pip install ansible-core~=${{ matrix.ansible }}
193- - run : mkdir -p $WORKDIR
194- - run : cp -a ./ $WORKDIR
195185 # We have ansible.cfg "for testing" in git repo
196186 # (it is excluded in galaxy.yml, so it is not part of collection artifact)
197187 # But it does affect ansible-galaxy and ansible-test commands.
198- - run : cd $WORKDIR && ansible-galaxy collection install community.crypto
199- - run : cd $WORKDIR && ansible-galaxy collection list
188+ - run : ansible-galaxy collection install community.crypto
189+ - run : ansible-galaxy collection list
200190 # TODO - make integration_config.yml a reusable artifact/output of integration-prepare-env
201191 - run : |
202- cd $WORKDIR
203192 echo "${{ vars.CI_CONFIG_HC_IP50 }}" > tests/integration/integration_config.yml
204193 cat tests/integration/integration_config.yml
205194 echo "sc_password: ${{ secrets.CI_CONFIG_HC_IP50_SC_PASSWORD }}" >> tests/integration/integration_config.yml
206195 echo "smb_password: ${{ secrets.CI_CONFIG_HC_IP50_SMB_PASSWORD }}" >> tests/integration/integration_config.yml
207196 echo "sc_replication_dest_password: ${{ secrets.CI_CONFIG_HC_IP50_SC_REPLICATION_DEST_PASSWORD }}" >> tests/integration/integration_config.yml
208197 ls -al tests/integration/integration_config.yml
209- - run : cd $WORKDIR && ansible-test integration --local ${{ matrix.test_name }}
198+ - run : ansible-test integration --local ${{ matrix.test_name }}
210199
211200
212201 replica_cleanup :
213202 needs :
214203 - integ
215204 runs-on : [self-hosted2]
216- container : python:3.10-slim-buster
205+ container : quay.io/justinc1_github/scale_ci_integ:1
217206 env :
218- ANSIBLE_COLLECTIONS_PATH : /work-dir
207+ ANSIBLE_COLLECTIONS_PATH : $GITHUB_WORKSPACE/work-dir
208+ defaults :
209+ run :
210+ working-directory : ${{ env.WORKDIR }}
219211 steps :
220212 - name : Checkout
221213 uses : actions/checkout@v3
222- - run : pip3 install -r sanity.requirements -r test.requirements -r docs.requirements
223- - run : apt update
224- - run : apt install -y git make
225- - run : pip install ansible-core==2.13.1
214+ with :
215+ path : ${{ env.WORKDIR }}
216+ - run : pip install ansible-core~=2.13.0
226217 # ansible-test needs special directory structure.
227- - run : mkdir -p $WORKDIR
228- - run : cp -a ./ $WORKDIR
229218 - run : |
230- cd $WORKDIR
231219 echo "${{ vars.CI_CONFIG_HC_IP50 }}" > tests/integration/integration_config.yml
232220 cat tests/integration/integration_config.yml
233221 echo "sc_password: ${{ secrets.CI_CONFIG_HC_IP50_SC_PASSWORD }}" >> tests/integration/integration_config.yml
234222 echo "smb_password: ${{ secrets.CI_CONFIG_HC_IP50_SMB_PASSWORD }}" >> tests/integration/integration_config.yml
235223 echo "sc_replication_dest_password: ${{ secrets.CI_CONFIG_HC_IP50_SC_REPLICATION_DEST_PASSWORD }}" >> tests/integration/integration_config.yml
236224 ls -al tests/integration/integration_config.yml
237225 - run : ansible-galaxy collection install community.general
238- - run : cd $WORKDIR && ansible-playbook tests/integration/cleanup/ci_replica_cleanup.yml
226+ - run : ansible-playbook tests/integration/cleanup/ci_replica_cleanup.yml
239227
240228 smb_cleanup :
241229 needs :
242230 - integ
243231 runs-on : [self-hosted2]
244- container : python:3.10-slim-buster
232+ container : quay.io/justinc1_github/scale_ci_integ:1
233+ defaults :
234+ run :
235+ working-directory : ${{ env.WORKDIR }}
245236 steps :
246237 - name : Checkout
247238 uses : actions/checkout@v3
248- - run : apt update
249- - run : apt install -y git make
250- - run : apt install -y smbclient
251- - run : mkdir -p $WORKDIR
252- - run : cp -a ./ $WORKDIR
253- - run : cd $WORKDIR/tests/integration/cleanup && ./smb_cleanup.sh ${{ secrets.SMB_SERVER }} ${{ secrets.SMB_SHARE }} "${{ secrets.SMB_USERNAME }}" ${{ secrets.SMB_PASSWORD }}
239+ with :
240+ path : ${{ env.WORKDIR }}
241+ - run : cd tests/integration/cleanup && ./smb_cleanup.sh ${{ secrets.SMB_SERVER }} ${{ secrets.SMB_SHARE }} "${{ secrets.SMB_USERNAME }}" ${{ secrets.SMB_PASSWORD }}
0 commit comments