Skip to content

Commit 2d7fc6d

Browse files
committed
feat(workflow): add compiler configuration check to CI pipeline
- Added a new step to check if compilers are configured correctly. - Included steps to redact passwords in `litmus_inventory.yaml`. - Added steps to retrieve and verify `peadm_config` for primary and compiler nodes. - Implemented a smoke test to ensure the correct configuration of legacy and current compilers.
1 parent d6a2f0e commit 2d7fc6d

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

.github/workflows/test-convert-to-legacy.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,32 @@ jobs:
246246
sleep 60
247247
done
248248
echo "${HOME}/pause absent, continuing workflow."
249+
- name: Check if compilers are configured
250+
timeout-minutes: 120
251+
run: |
252+
echo ::group::inventory
253+
sed -e 's/password: .*/password: "[redacted]"/' < spec/fixtures/litmus_inventory.yaml || true
254+
echo ::endgroup::
255+
echo ::group::get_peadm_config
256+
primary=$(yq '.groups[].targets[] | select(.vars.role == "primary") | .name' spec/fixtures/litmus_inventory.yaml)
257+
compiler=$(yq '.groups[].targets[] | select(.vars.role == "compiler") | .name' spec/fixtures/litmus_inventory.yaml | head -n 1)
258+
legacy_compiler=$(yq '.groups[].targets[] | select(.vars.role == "compiler") | .name' spec/fixtures/litmus_inventory.yaml | head -n 2)
259+
bundle exec bolt task run peadm::get_peadm_config \
260+
--targets $primary \
261+
--inventoryfile spec/fixtures/litmus_inventory.yaml \
262+
--modulepath spec/fixtures/modules \
263+
--no-host-key-check \
264+
--format json > peadm_config.json
265+
cat peadm_config.json
266+
echo ::endgroup::
267+
echo ::group::smoke_test
268+
configured_legacy_compiler=$(yq '.items[0].value.params.legacy_compilers[0]' peadm_config.json)
269+
configured_compiler=$(yq '.items[0].value.params.compiler_hosts[0]' peadm_config.json)
270+
if [ "$configured_legacy_compiler" != "$legacy_compiler" AND "$configured_compiler" != "$compiler" ]
271+
echo "Compilers are not configured, expected $legacy_compiler and $compiler, got $configured_legacy_compiler and $configured_compiler"
272+
exit 1
273+
fi
274+
echo ::endgroup::
249275
- name: Tear down test cluster
250276
if: ${{ always() }}
251277
continue-on-error: true

0 commit comments

Comments
 (0)